I did a little testing with PQ2 v1.002.011. After copying over the scr folder and .ini from github and fixing a few minor issues I was able to compile in SCICompanion. Unfortunately, it seems to introduce the same new bugs as the ones that decompiling in SCICompanion produces.
Since Sluice's github doesn't have an issue tracker, and we get the same problems from decompiling in SC, I'll mention them here instead:
At the start of the game, Sonny's car pulls in and transitions to the interior of the personal car. TAKE KEYS, then EXIT. The scene returns to the parking lot (rm1), but sonny never exits the vehicle - ego is at posn: 0 0. This can be mitigated by changing the following in rm1::doit
...
((== global132 local5 1)
;(if (not (gCast contains: ourCar))
(if (gCast contains: ourCar)
(= global132 0)
(self setScript: exitScript)
)
)
...
Now that Sonny can get out of the car correctly, we run into a very common bug with a decompiled version of PQ2:
With the keys from the car Sonny should be able to OPEN DOOR to the police station, but because the autodoor doesn't animate it never reaches cel 2 and Sonny is stuck.
Generally these autodoor animation failures are related to "stopUpd:", removing them will often fix the issue, but in this case I didn't test enough to resolve the problem.
Edit: In case anyone wants to test (or verifiy I'm not introducing the bugs) here are the items I had to correct to get Sluices PQ2 1.002.011 source to compile in SC 3.2.4:
Error: (Main.sc) Undeclared identifier 'sndVOLUME' . Line: 663, col: 11
;(DoSound sndVOLUME 15)
(DoSound 8 15)
Error: (Main.sc) &rest cannot be used if the send target itself contains nested procedure calls or sends. Assign the result of the procedure call or send to a temporary variable and use that instead. Line: 411, col: 27
;comment out the entire procedure because it's unused or fix like so:
;;;(procedure (Notify param1) ; UNUSED
;;; ((ScriptID param1) notify: &rest)
;;;)
(procedure (Notify param1 &tmp temp0) ; UNUSED
(= temp0 (ScriptID param1))
(temp0 notify: &rest)
)
Error: (rm8.sc) The rest modifier must be followed by a parameter name. Line: 56, col: 23
;(Display &rest dsCOORD 73 local143 dsFONT 7 dsCOLOR 0 dsBACKGROUND 0)
(Display &rest 100 73 local143 dsFONT 7 dsCOLOR 0 dsBACKGROUND 0)
Error: (Introduction.sc) The rest modifier must be followed by a parameter name. Line: 31, col: 32
;(= temp1 (Display &rest dsALIGN alCENTER dsCOORD 10 10 dsWIDTH 300 dsCOLOR 15 dsSAVEPIXELS))
(= temp1 (Display &rest 101 alCENTER dsCOORD 10 10 dsWIDTH 300 dsCOLOR 15 dsSAVEPIXELS))
Error: (Interface.sc) Unknown procedure 'proc999_4' . Line: 35, col: 13
; procedure is unused just block comment it out:
;;;(procedure (MousedOn obj event theMods) ; UNUSED
;;; (cond
;;; ((!= (event type:) 1) 0)
;;; ((and (>= argc 3) theMods (== (& (event modifiers:) theMods) 0)) 0)
;;; ((obj respondsTo: #nsLeft)
;;; (proc999_4
;;; (obj nsLeft:)
;;; (obj nsTop:)
;;; (obj nsRight:)
;;; (obj nsBottom:)
;;; event
;;; )
;;; )
;;; )
;;;)
;and the public export:
(public
Print 0
ShowView 1
GetInput 2
GetNumber 3
Printf 4
;MousedOn 5
StillDown 6
)
Error: (Game.sc) Undeclared identifier 'sndRESUME' . Line: 129, col: 11
;(DoSound sndRESUME)
(DoSound 7)
Error: (User.sc) Unknown procedure 'proc984_0' . Line: 101, col: 13
;script 984 doesn't exist so comment it out
...
(method (said event)
(if global54
;(proc984_0 alterEgo gSortedFeatures gCast gFeatures)
else
...
Error: (Actor.sc) Unknown procedure 'CosMult' . Line: 522, col: 41
;(= x (+ xOrg (* legLen (sign (CosMult (* legDir 45) 100)))))
(= x (+ xOrg (* legLen (sign (TimesCos (* legDir 45) 100)))))
Error: (Actor.sc) Unknown procedure 'SinMult' . Line: 523, col: 41
;(= y (- yOrg (* legLen (sign (SinMult (* legDir 45) 100)))))
(= y (- yOrg (* legLen (sign (TimesSin (* legDir 45) 100)))))
Some of these will need to be fixed in multiple places, but this should allow "Compile All" to complete without error.
Edit2: a few other changes are need to get things running in ScummVM. In script 989 find and change the following:
;in script 989 "Sound"
;in init:
;(DoSound sndINIT self)
(DoSound 0 self)
;in play:
;(DoSound sndPLAY self)
(DoSound 1 self)
in dispose:
;(DoSound sndDISPOSE handle)
(DoSound 10 handle)