[Scummvm-tracker] [ScummVM] #10615: QFG4: Head Monk tentacles do not go back down after crossing chasm at start of game

Vhati trac at scummvm.org
Wed Nov 21 03:42:27 CET 2018


#10615: QFG4: Head Monk tentacles do not go back down after crossing chasm at start
of game
--------------------------------+-------------------------
  Reporter:  2Mourty            |      Owner:  (none)
      Type:  defect             |     Status:  new
  Priority:  normal             |  Component:  Engine: SCI
Resolution:                     |   Keywords:  Tentacle
      Game:  Quest for Glory 4  |
--------------------------------+-------------------------

Comment (by Vhati):

 sLevitateOverPit schedules and attempts to manage sTentacleDeath (the
 sequence presenting and retracting the tentacle). There is, of course, a
 race condition.
 \\
 \\
 script 710 - sLevitateOverPit::changeState()
 {{{
         0
         (g1_Glory handsOff:)
         (= register (if (> (g0_hero x?) 190) 1 else 0))

 # hero is on the righthand side. register will be 1.
 # ...
         5
         (if (not (proc0_4 101))
                 (tentacle setScript: sTentacleDeath 0 1)
         )
 # ...
         6
         (if (not (proc0_4 101)) ((tentacle script?) cue:))
 }}}
 After crossing, sLevitateOverPit advances sTentacleDeath to its next
 state, whatever that is, assuming cue() will be timed right to end it.
 \\
 \\
 script 710 - sTentacleDeath
 {{{
 (0
         0
         (if (not register) (global1 handsOff:))
         (tentacle setLoop: 0 1 setCel: 0 show: setCycle: End self)
 )
 (1
         1
         (tentacle setLoop: 1 1 setCel: 0 setCycle: End self)
 )
 (2 2 (= cycles 6))
 (3
         3
         (if register
                 (= state 5)
                 (tentacle setCycle: RandCycle tentacle)
         else
                 (tentacle setLoop: 4 1 setCel: 0 setCycle: CT 3 1 self)
         )
 )
 (4
         4
         (global0 hide:)
         (torchEff hide:)
         (tentacle cycleSpeed: 10 setCycle: End self)
 )
 (5 5 (proc26_0 1 710 6))
 (6
         6
         (tentacle setLoop: 0 1 setCel: 10 setCycle: Beg self)
 )
 (7
         7
         (tentacle hide:)
         (= register 0)
         (self dispose:)
 )
 }}}

 Under normal circumstances sTentacleDeath goes through states 0, 1, 2, 3
 (it sets state to skip ahead), 6 (retract), 7 (done).

 State 3 sets a RandCycle. Incidentally, the original interpreter would
 have the tentacle wriggle, but it does not wriggle in ScummVM. With no
 goal of its own to trigger further progress, it waits for the external
 cue(). If the cue comes too soon, it'll hurry up and wait, indefinitely.

 At max speed, the cue() comes so early it only advances to state 1. From
 there, it advances itself only up to 3.

 When the tentacle is stuck like that, the debugger can unstick it: "send
 sTentacleDeath cue".

--
Ticket URL: <https://bugs.scummvm.org/ticket/10615#comment:3>
ScummVM <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list