[ scummvm-Patches-692781 ] CMI: The actor placement bug (don't apply)

SourceForge.net noreply at sourceforge.net
Tue Feb 25 09:28:04 CET 2003


Patches item #692781, was opened at 2003-02-25 09:28
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=692781&group_id=37116

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: CMI: The actor placement bug (don't apply)

Initial Comment:
I'm told my patch doesn't match the original
interpreter at all, so this should not be applied. Not
without a discussion, at least. Still, I thought it'd
be a good idea to write down what's currently known
about the actor placement bug in CMI.

In some rooms Guybrush is positioned incorrectly the
first time he enters, but not on subsequent visits.
This happens in at least two places, but I'll be using
the cannibal village as an example.

The reason it behaves differently the first time is
that the game plays a "mini-cutscene". Guybrush walks
to the center of the village and makes a remark about
it being deserted. The decision is made in
roomobj-53-873.dmp. I haven't verified this, but my
guess is that this is the object representing the
village on the overhead map:

[001A] (65) if (ifClassOfIs(873,[22])) {
[002F] (89)   setClassOf?(873,[150])
[003F] (79)   startScriptEx(0,329,[])
[0053] (66) } else {
[004F] (9E)   loadRoomWithEgo(896,280,455)
[0064] (**) }

The loadRoomWithEgo() opcode provides startScene() with
both an actor and an object number, ensuring that
Guybrush is placed near some object - the entrance
gate, I guess - when the room is loaded. Obviously
script 329 will have to do the same, but it does so in
a different fashion:

[011B] (AC) initActor(1)
[0122] (AC) setActorDirection(135)
[0129] (A2) putActorAtObject(1,896)
[0134] (8D) actorFollowCamera(1)

It's not immediately obvious, but it's actually
actorFollowCamera() that causes startScene() to be
called. Since it provides neither actor nor object
number, it's reasonable to assume that
iputActorAtObject() that's responsible for placing
Guybrush at the right position. Indeed, this function
has access to all the information needed to do so:
actor, room and object number.

However, it will only be able to place Guybrush
correctly if whereIsObject(obj) != WIO_NOT_FOUND. If
not, it will fall back on a default position.

I don't know enough to change the behaviour of
whereIsObject(), but it will work if I ensure that the
room is loaded before the function is called. That's
what this patch does but, as I already said, I'm told
this is not the original behaviour.

Also, I have no idea how this affects V6/V7 games. Even
if we do use this solution, it may be that we need a
new function, o8_putActorAtObject().




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=692781&group_id=37116




More information about the Scummvm-tracker mailing list