Opened 18 years ago

Closed 18 years ago

Last modified 21 months ago

#8165 closed patch

CMI: Hack for "I can't reach that" (experimental)

Reported by: eriktorbjorn Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Monkey Island 3

Description

This patch will need more testing than I've done, but it's an attempt to fix the problem where Guybrush can't reach the cannon after Wally stops using it.

What seems to be happening is that a number of walkboxes have their kBoxInvisible flag set and cleared. I guess the purpose of it is to modify Guybrush's walking behaviour (restrict/unrestrict where he may go, perhaps?) depending on whether or not Wally is at the cannon. But it doesn't do anything to change which walkbox Guybrush is in, so he remains trapped inside walkbox 4.

This is done by the script script room-9-2000 (which is invoked from at least from the scripts room-9-2009 and entry-9). This is what it looks like when descummed:

Script# 2000 [0000] (65) if (0== bitvar167) { [000B] (A7) setBoxFlags([5,6,7,8,9,13],128) [0034] (A7) setBoxFlags([1,2,3,4],0) [0053] (A8) createBoxMatrix() [0058] (66) } else { [0054] (A7) setBoxFlags([1,2,3,4],128) [0078] (A7) setBoxFlags([5,6,7,8,9,13],0) [00A1] (A8) createBoxMatrix() [00A2] (**) } [00A2] (A7) setBoxFlags([10,11,12],128) [00BC] (7B) stopObjectCode() END Stack count: 0

What the patch does is to modify the createBoxMatrix() opcode for V8 games so that it adjusts the position of the ego actor. This will move Guybrush from the invisible walkbox to the equivalent visible walkbox.

I have no idea if this is the right thing to do, but it does seem to fix the problem so it may be a good place to start further investigation.

Ticket imported from: #672313. Ticket imported from: patches/270.

Attachments (1)

cmi-untrap.diff (2.0 KB ) - added by eriktorbjorn 18 years ago.
Patch against a January 21 CVS snapshot

Download all attachments as: .zip

Change History (8)

by eriktorbjorn, 18 years ago

Attachment: cmi-untrap.diff added

Patch against a January 21 CVS snapshot

comment:1 by fingolfin, 18 years ago

Owner: set to SF/ender

comment:2 by fingolfin, 18 years ago

The basic idea seems good to me. Only question that remains, though: shouldn't maybe all actors be "reset" this way? Mind you, I don't know, the answer may very well be "no". Maybe Endy can shed some light into this question using his IDB? I'd recommend to wait a bit with checking this in until we have answered that question.

comment:3 by eriktorbjorn, 18 years ago

Yeah, I was wondering about what to do about the other actors too, but I forgot to mention it in the patch description. Thanks for bringing that up.

I agree about the waiting bit. The patch is mainly intended to demonstrate the probable cause of the bug and one possible solution, but it's all just guesswork. I don't even know what the box matrix is used for.

comment:4 by fingolfin, 18 years ago

The boxmatrix describes which boxes you can reach from which. E.g. it contains information like "to get from box 2 to box 7, go to box 3 and then ask again", "to get from 3 to 7, go to 4 then ask again" etc. Or "there is no way to get from 2 to 7". Of course encoded etc., but that should explain its purpose.

comment:5 by SF/ender, 18 years ago

Status: newclosed

comment:6 by SF/ender, 18 years ago

Pretty much right, although the disassembly recomputes ALL actors. Commited with this change.

comment:7 by digitall, 21 months ago

Component: Engine: SCUMM
Game: Monkey Island 3
Note: See TracTickets for help on using tickets.