Opened 5 years ago

Closed 5 years ago

#10830 closed defect (fixed)

QFG4: Stuck at closed town gate after resting til night

Reported by: Vhati Owned by: bluegr
Priority: normal Component: Engine: SCI
Version: Keywords: SCI32 original has-pull-request
Cc: Game: Quest for Glory 4


ScummVM 2.1.0git3990-ge0307e9 (Dec 6, 2018 14:26:10)
Windows 7 64bit
QFG4 CD (English)

In town at the staff, after waking at dawn from a dream... then resting there repeatedly until nightfall... Going south will not prompt to climb over the wall (as normally happens at night). The room will change to the town exterior, and hero will be stuck behind the closed gate.

The original interpreter also does this.

File - 5kb MD5 - Full MD5
RESOURCE.000 - 263dce4aa34c49d3ad29bec889007b1c - 1364ba69e3c0abb68cc0170650a56692
RESOURCE.AUD - c39521bffb1d8b19a57394866184a0ca - 71098b9e97e20c8941c0e4812d5f906f
RESOURCE.MAP - aba367f2102e81782d961b14fbe3d630 - 801a04cc6aa5d437681a2dd0b6545248
RESOURCE.SFX - 3cf95e09dab8b11d675e0537e18b499a - 7c858d7253f86dab4cc6066013c5ecec

Change History (6)

comment:1 by Vhati, 5 years ago

Occurs in the floppy edition under ScummVM, and its original interpreter, too.

QFG4 Floppy 1.1a + note patch (English)

File - 5kb MD5 - Full MD5
RESOURCE.000 - f64fd6aa3977939a86ff30783dd677e1 - ff42260a665995a85aeb277ad80aac8a
RESOURCE.MAP - d10a4cc177d2091d744e2ad8c049b0ae - 3695b1b0a1d15f3d324ea9f0cc325245
RESOURCE.SFX - 3cf95e09dab8b11d675e0537e18b499a - 7c858d7253f86dab4cc6066013c5ecec

comment:2 by Vhati, 5 years ago

Quick and dirty way to get stuck...

  • Create a new character.
  • Fake a night (preciseTime, isNight, currentSpan).
    • vv g 120 2863
    • vv g 121 1
    • vv g 123 4
  • Teleport to the staff.
    • room 270
  • Sleep until morning.
  • Fake night again.
  • Walk south.
Last edited 5 years ago by Vhati (previous) (diff)

comment:3 by Vhati, 5 years ago

script 270 - rm270::init()

# If arriving at night and not waking from a dream room.
(if (and g121_myIsNight (not (== g12_myPrevRoomNum 110)))
	(= local2 1)
	(fSouth init:)
	(gateTeller init: fSouth 270 9 125)
	(g2_myCurrentRoom south: 290)
# ...
(g0_hero setScript: sComeOnIn)

fSouth::init() makes its "heading" property a doorMat that schedules sTo290Night... which shows gateTeller. That prompts about climbing the wall.

Even if hero walked to the staff during the day, doit() constantly checks for nightfall, to init fSouth and gateTeller. It sets local2=1 to stop further checking & inits.

script 270 - rm270::doit()

(if (and g121_myIsNight (not local2))
	(= local2 1)
	(fSouth init:)
	(gateTeller init: fSouth 270 9 125)

If hero came from a dream room, sComeOnIn::changeState(0) schedules sAfterTheDream. Since hero wakes when it's morning, it does nearly the opposite, disposing fSouth and gateTeller.

script 270 - sAfterTheDream::changeState(2)

(gateTeller dispose:)
(fSouth actions: 0)
(if (fSouth heading?)
	((fSouth heading?) dispose:)
	(fSouth heading: 0)

However, local2 will still be 1.
If time passes until nightfall, doit() will never check again to init another doorMat.

Last edited 5 years ago by Vhati (previous) (diff)

comment:4 by Vhati, 5 years ago

There's a second bug here.

No other mechanism gets rid of the doorMat. So if hero rests repeatedly until sunrise (no dream), going south will still prompt to climb the then-open gate.

rm270::doit() doesn't have room to handle both init as needed AND dispose.

That bug's harmless though. The prompt sets global423 (1=climb, 2=levitate). The gate room only honors that global for dramatic entrances at night. Hero will just walk out through the gate normally.

Well, a fighter unable to climb or levitate *would* be thwarted by the prompt, but the gate will be passable after they re-enter the room.

Last edited 5 years ago by Vhati (previous) (diff)

comment:5 by Vhati, 5 years ago

Keywords: has-pull-request added

Pull Request: SCI32: Fix QFG4 town gate after a staff dream

comment:6 by bluegr, 5 years ago

Owner: set to bluegr
Resolution: fixed
Status: newclosed

Nice work! The pull request has been merged, so this can be closed now

Note: See TracTickets for help on using tickets.