Opened 10 years ago

Closed 10 years ago

#6774 closed defect (fixed)

ZVISION: Spell book broken after getting "glorf" spell

Reported by: eriktorbjorn Owned by: eriktorbjorn
Priority: normal Component: Engine: ZVision
Version: Keywords:
Cc: Game: Zork Grand Inquisitor

Description

Current Git snapshot of ScummVM. English DVD version of the game.

After getting the "glorf" spell in Hades, I can no longer turn pages or leave the spell book screen using the arrow cursor (though I can still right-click). Also, the "glorf" spell doesn't show up in the spell book, though it does show up in the spell menu bar.

I've attached two savegames. One right before, and one right after the spell book broke.

Ticket imported from: bugs/6774.

Attachments (2)

zgi-win.019 (20.5 KB ) - added by eriktorbjorn 10 years ago.
zgi-win.020 (19.7 KB ) - added by eriktorbjorn 10 years ago.

Download all attachments as: .zip

Change History (5)

by eriktorbjorn, 10 years ago

Attachment: zgi-win.019 added

comment:1 by eriktorbjorn, 10 years ago

Apparently what's keeping me from turning a page is that state value 7439 is 1. But that's probably just a side-effect. The impression I got was that this is always set while adding a new spell to the spell book, and since "glorf" doesn't appear to have been quite properly added, I'm guessing something went wrong in that process, and that's why state value 7439 isn't 0.

But that's just speculation.

comment:2 by eriktorbjorn, 10 years ago

For the spell to appear in the spell book, state value 202 (SPELL_12_IN_BOOK) has to be set to 1. In the second savegame, it's set to 2. I don't know what all the values mean, but my tentative guess is that 0 means you don't have the spell, and 1 that it's been fully copied to your spell book. Perhaps 2 means that it's in the process of copying it?

comment:3 by eriktorbjorn, 10 years ago

I think I figured it out. It seems that this script is supposed to run when getting the spell:

puzzle:07507 {  # gjm2_anim_12_end_puz
    criteria {
        [07506] = 2     # gjm2_spell_12_anim
                [00202] !3  # SPELL_12_IN_BOOK
    }
    results {
        action:assign(00202, 1) # SPELL_12_IN_BOOK    &&&&&&&&
        action:assign(07506, 0) # gjm2_spell_12_anim
        action:enable_control(07508)    # gjm2_magic_spell_12_click
        action:add(07381, 1)    # gjmb_spell_counter
        action:set_partial_screen(320 230 gs0zveb1.tga 0 -1)
        action:timer:07372(30)  # gjmb_leave_in_three_seconds
        action:assign(07439, 0) # gjm2_cant_go
    }

So the second part of the criteria only has two tokens, once you stip out the comments. But our ScriptManager::parseCriteria() assumes there are three.

I've made a change so that if the second token is more than one character, it uses the rest of that token as the third token.

comment:4 by eriktorbjorn, 10 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.