Some chores need to stay active even after a call to
StopAllChores(). E.g. the hold chores should stay active
even after changing the set (which calls StopAllChores()).
It looks like that the previously unknown boolean paramter
of StopAllChores() controls that behavior. If set to TRUE,
stop only the non-looping chores.
This patch fixes:
- hold chore was lost when switching sets
- blue painting did not show the ultimate insult when opening
the inventory
The hold chore was always lost after e.g. turning left or right.
Although that chore was still in _playingChores, it was not shown.
The patch uses the following order for drawing the chores:
- wear chores
- rest chores
- walk/turn chores
- other chores (in order of the playChore calls)
When attaching an actor to another one, set its local position
so that its final position (position of the parent actor + the
local position) remains the same as the final position before
it was attached.
Use matrix multiplications to fix the rotation for attached actors:
- calculate the final transformation matrix recursively for attached
actors (instead of using getWorldPos and getWorldRot)
- use a different order for building the quaternions out of the Euler
angles
- changed handling of camera position (just apply the rotation of the
camera, the (inverted) position of the camera and the position of the
actor
- no functional changes for GRIM
- no changes for drawing in overworld
Code simplification for GRIM:
- no need to use _currentPos in calculations for GRIM since it is
always (0, 0, 0)
This fixes:
- the rotation of any items Guybrush is holding in his hands
- the handling of the pole when using the raft in the swamps
- getting the bananas with the banana picker
Two animations (guy_puton_cap, guy_holdstickystuff) contain bone names
which which don't match any joints. To avoid that the holding actor is
drawn with a wrong orientation, ingore the unknown bone names when
running the animations.
Skeleton::getJointNamed() will now return null for unknown names.
The original behaviour for Actor::getWorldPos and
Actor::getRotationQuat is kept.
This patch fixes the problem, that Guybrush is "lying down" once he
holds the bottle of glue.
When drawing attached actors the engine uses the parent's sort order
plus one. This offset can move the attached actor behind a background
plane, for instance the chess board in the Lucre docks or Guybrush when
riding the manatee.
- the costumes are handled on a stack per Actor
- the last costume is considered the current one
- currently, the costumes are never removed from from the stack
- this causes an issue when Guybrush is using its original
costume first, later the monkey robot costume for the final Monkey Kombat
and then again the standard costume (the robot costume will remain the last
on the stack and cosidered the current one - this causes a problem
when attaching the head actor since the robot has different joints
than guybrush with the standard costume)
- if a new wear chore is set and it uses a different costume than the
current one and neither of them is the shadow costume remove the old
costume before setting the new one
- additionally, this patch makes sure, that all active chores of all
costumes on the stack of an actor are stopped
- for solving the Monkey Kombat puzzle it is necessary that a kombat is
triggered when Guybrush runs into one of the monkeys on the map
- implement SetActorCollisionMode and SetActorCollisionScale
- add EMI-specific calculations for retrieving the sphere data for the
actors (and some minor refactoring for better readability)
The following changes may alter the behaviour in GRIM, too:
- in Actor::collisionHandlerCallback(), call the collision handler for
both affected objects (that is necessary since only one actor may have
a collision handler associated in lua but it may happen that the
character with the handler is standing still and the other one is run
into him)
- Actor::handleCollisionTo() did only update a given position to ensure
that there is no collision - so it is necessary to actually check for
collisions and execute the lua callback if necessary (via
Actor::handleCollisionWith())
The path to the Curch of LeChuck has bogus coordinates as out point, so
the game will walk Guybrush to an invalid position when entering that
set. This patch will detect when no path can be found to the destination
position and ignore the walkTo() request in that case.
The behavior for Grim is unchanged in order to avoid the risk of breaking
the game. If the warning is never triggered the distinction can be removed.
Due to a sign error in Actor::walkForward() it is frequently difficult or
impossible to walk on sloped sectors (stairs or ramps), e.g. in Meathook's
place or in front of Pegnose's house.
Time paradox is now playable.
- local _pos and _yaw values seem to be relative
to the actor where the current actor is attached to
- to accomodate this, Lua_V1::GetVisibleThings,
Actor::getYawTo and Actor::getSimplePuckVector should use
world coordinates
When the turn chores are changed while an actor is turning the current
chores will be stopped but the new ones won't be started until the turn
direction changes. This can be seen when hitting the run key while
Guybrush is turning.
In EMI's coordinate system, other than in Grim, actors turn right when
the yaw angle is increasing. Select the correct turn chore for the turn
direction.
EMI uses a different coordinate system than Grim, so we have to switch
dimensions in various places to share common code for walking and turning
actors. This patch fixes several yaw angle sign errors causing actors to
look into wrong directions.
The floor in the Hall of Justice is hidden by a solid gray actor named
"trap plane". This actor is originally positioned far in the background
but moved to the foreground because we can't find a sort plane in the
sector.
This patch stores returns an actor to the original sort order set by
the game script when entering a sector that has no sort information.