Opened 21 years ago

Closed 18 years ago

Last modified 18 years ago

#1031 closed defect (fixed)

ZAK: Lotto numbers never picked

Reported by: SF/voodoofx Owned by: Kirben
Priority: high Component: Engine: SCUMM
Version: Keywords: script
Cc: Game: Zak McKracken

Description

ScummVM version: ScummVM 0.5.0pre-cvs Built on Jul 15 2003 11:47:01

Platform: win32(WinXP) Zak version: EGA(V2 enhanced) Language: english

When you read the winning numbers in spaceship, and you buy the ticket, the numbers are never picked. In original if you come too early the guy says that numbers weren't picked yet. But here, when you enter the store he only says "hi, buddy". I went travelling, came back and it still didn't work.

While this isn't necessary for completing the game, one can run out of money if he travels blindly. Which means, you get stuck, and have to load some very, very early savegame.

Ticket imported from: #771499. Ticket imported from: bugs/1031.

Attachments (2)

zak.s24 (53.2 KB ) - added by SF/voodoofx 21 years ago.
Lotto
zak64.s48 (50.6 KB ) - added by Kirben 21 years ago.
V1 zak save, enter buy Lotto and leave.

Download all attachments as: .zip

Change History (30)

by SF/voodoofx, 21 years ago

Attachment: zak.s24 added

Lotto

comment:1 by SF/ender, 21 years ago

This is fairly release critical for players just wanting to play. Raising priority, marking 0.5.0 RC

comment:2 by SF/ender, 21 years ago

Priority: normalblocker
Summary: Zak: Lotto numbers never picked0.5.0 RC Zak: Lotto numbers never picked

comment:3 by (none), 21 years ago

Logged In: NO

Here is my analysis:

When switching to room 52 (the numeric keypad) the exit script for the shop is called, which stops the buy script. This mustn't happen since the code to start the lotto timeout is in the buy script.

Obviously the exit room script must not be called when switching to the keypad room. But why?

comment:4 by SF/hoenicke, 21 years ago

The comment from nobody, is really from me (hoenicke). Is there a way to make sourceforge remember me for longer than five minutes?

comment:5 by fingolfin, 21 years ago

Use the "remember me" feature (there is a checkbox you have to select when logging in). And of course make sure your browser accepts & saves the SF.net cookie.

comment:6 by fingolfin, 21 years ago

I think it's very unlikely that there is a special case in the engine that makes it not run an exit script...

Can you attach the .dmp files for the scripts in question (i.e. exit script of the shop) ?

comment:7 by SF/hoenicke, 21 years ago

I can give you URLs to my own parsed scripts. You may want to look at these pages:

The shop is room 07: http://csd.informatik.uni-oldenburg.de/~hoenicke/scummvm/zak/lvl07.html The exit script chain script 19 (to reset verbs) and then stops a bunch of scripts 24-27: 000: setBit(1445, 0, *234) 005: chainScript(19) 007: stopScript(24) 009: stopScript(25) 00b: stopScript(26) 00d: stopScript(27) ....

The buy script is script 24. At offset 309 it first runs script 15 then 73. script 15 switches to the numpad room, script 73 is never called. http://csd.informatik.uni-oldenburg.de/~hoenicke/scummvm/zak/script24.html

Note that the if opcodes are named differently in my script parser, as
I found the original naming confusing.

comment:8 by fingolfin, 21 years ago

Actually, those stopScript's should bnever be reached. ChainScript *replaces* the current script with the script starts. Can you try this alternate implementation and see if it helps any:

void Scumm_v2::o2_chainScript() { int data = getVarOrDirectByte(0x80); stopScript(vm.slot[cur].number); _currentScript = 0xFF; runScript(data, 0, 0, 0); }

comment:9 by fingolfin, 21 years ago

Uhm, make that "vm.slot[_currentScript].number"

comment:10 by SF/hoenicke, 21 years ago

My parse script had the chain/startScript opcodes swapped. I'm sorry for this confusion. I fixed the script now and rebuilt the pages.

So it is startScript, not chainScript in the exit script.

comment:11 by SF/ender, 21 years ago

Evil nasty hack added to CVS. The disassembly does several more checks in it's StopScript opcode than we do, I believe these may be related to this bug...

Removing RC tag, leaving open at a high'ish priority as this suggests a difference between V2's and our stopScript handling...

comment:12 by SF/ender, 21 years ago

Priority: blockerhigh
Summary: 0.5.0 RC Zak: Lotto numbers never pickedZak V2: (hack-in-cvs) Lotto numbers never picked

comment:13 by fingolfin, 21 years ago

Summary: Zak V2: (hack-in-cvs) Lotto numbers never pickedZAK: (hack-in-cvs) Lotto numbers never picked

comment:14 by fingolfin, 21 years ago

StopScript does more? Uh, I thought it does *less*... it's just that they factored some common code into seperate functions in newer Scumm versions, which may be why the opcode looks like "more" in V2... maybe you can show me the disassembly you are basing this on?

by Kirben, 21 years ago

Attachment: zak64.s48 added

V1 zak save, enter buy Lotto and leave.

comment:15 by Kirben, 21 years ago

Owner: set to Kirben
Resolution: fixed
Status: newclosed

comment:16 by Kirben, 21 years ago

I just added stopScript code to match original games. Original stopScript code only kills a script if the value matches 0 or the current running script.

comment:17 by SF/ender, 21 years ago

Please backport to 0.6.0 (we havn't had any confirmed testing for V1/V2 games, so this will be tested as part of that)

comment:18 by fingolfin, 21 years ago

Interesting -- maybe we are looking at different versions of the game, because I am seeing a very different code path in the original, which has several more steps than what you inserted. Kirben, could you send me the disassembly you based this on?

comment:19 by Kirben, 21 years ago

I mucked up one call which I corrected in CVS, so should correct now. The disasm. of o_stopScript is the exact same in v1 maniac, v1 zak and v2 zak. I will send via email.

comment:20 by fingolfin, 21 years ago

The code still wasn't matching the disasm. I fixed it again, so now it does match.

However I wonder if this bug actually is still "fixed". The new code is almost identical to the V5 code stopScript opcode now.

comment:21 by Kirben, 21 years ago

Yes, occurs again.

comment:22 by Kirben, 21 years ago

Resolution: fixed
Status: closednew

comment:23 by Kirben, 20 years ago

Owner: Kirben removed

comment:24 by sev-, 19 years ago

What is the status of this item?

comment:25 by Kirben, 19 years ago

Unchanged, the problem still occurs if the hack is disabled.

comment:26 by Kirben, 18 years ago

Owner: set to Kirben
Resolution: fixed
Status: newclosed

comment:27 by Kirben, 18 years ago

Fixed in ScummVM SVN, the script freezeCount shouldn't be checked by runScriptNested(), when restarting a script in SCUMM 1/2 games.

comment:28 by Kirben, 18 years ago

Summary: ZAK: (hack-in-cvs) Lotto numbers never pickedZAK: Lotto numbers never picked
Note: See TracTickets for help on using tickets.