Skip to main content

Moving the party

The world · Blocks, directions and positions · SCRIPT_MOVE_PARTY_OR_OBJECT

In brief​

The party steps forward, back, left or right, or turns on the spot. A step reads only the wall of the block ahead that faces the party: if that wall lets the party pass and no monster stands in the block, the party moves. Walking into a temporary wall removes it. An accepted step sends a leave event to the old block and an enter event to the new one, lets monsters notice the party and counts one step.

Positions are written [XX:YY], column then row, both counted from 00; the block index is YY × 32 + XX.

What happens when the party steps in a direction. The game looks at the block ahead in that direction. If its face toward the party is a temporary wall, the wall is removed. Then, if that face lets the party pass and no monster is in the block, the party moves: monsters may notice it, the leave and enter events run and the step counter goes up by one. Otherwise the game prints "Can't go that way" and plays sound 29.
A temporary wall gives way; any other closed face or a monster stops the party.

The step test​

The party can step forward, back, left (facing − 1) or right (facing + 1), or turn on the spot, left or right. Turning only changes the facing and redraws the view. A step looks at the neighboring block in the chosen direction:1

target = next_block(party_block, direction)
wall = target.wall_references[opposite(direction)] # the side facing the party
if wall == WALL_REFERENCE_TEMPORARY_WALL:
for each of the five temporary-wall slots holding target:
remove that temporary wall
wall = 0
if not (wall_flags[wall] & WALL_RUNTIME_PASSAGE) # party passage
or target.state & LEVEL_BLOCK_OCCUPANCY_MASK: # a monster is there
show the "can't go that way" message and play sound 29
else:
move_party(target)

Only the target block's wall is read: the wall of the party's own block on that side is not checked. Walking into a temporary wall made by Wall of Force therefore removes it and lets the party through. A face that holds the same reference without a temporary-wall slot, one written by the map or by a script, keeps the properties of that reference, which no original level makes passable, so it stops the party. A monster in the block always stops the party; see WallRuntimeFlags, SpecialWallReference and LevelBlockStateFlags.

What a step does​

An accepted step goes through the same party-move routine that scripts use: monsters may notice the party, the old block receives BLOCK_EVENT_PARTY_LEAVE and the new one BLOCK_EVENT_PARTY_ENTER, and the step counter advances. The order of these steps is given under moving the party; a scripted move skips the checks above. When the new block's north side holds WALL_REFERENCE_CLEARED_ON_ENTRY (SpecialWallReference), the move also sets the block's four walls to 0.1

Every move of the party counts one step of the game's counter, and every fourth move prints a line end in the message window, so that old messages scroll away as the party walks. Any move counts, a step as well as a script's (move the party).

Placing a monster in a block, likewise, updates the block's occupancy and can start the block's script; see monster movement events.

What the party sees​

The view always shows the same 18 blocks, fixed relative to the party's block and facing: seven three steps ahead, five two steps ahead, three one step ahead, and the party's own row. Each visible face of these blocks has a fixed place on the screen, and walls are drawn from the farthest to the nearest. The dungeon view shows where each block and each face goes.2

Sources​

Locations refer to the game executable reference; comparative sources are listed in the technical references.

Footnotes​

  1. The six movement buttons, the step test, the refused step and move the party; temporary walls are described in timed updates. Comparative source: REF-SCUMM-013, calcNewBlockPositionAndTestPassability. ↩ ↩2

  2. The view setup and the visible blocks. ↩