Wall interaction types
InfWallSpecialType · 1 byte, special_type of a wall mapping in INF
Wall mapping flags · Activating walls · The engine in ten minutes
A wall can react when the player clicks it, when a flying object hits it or when the party activates it from the keyboard. This byte chooses the reaction: a door switch, a lever, a niche, a door to force, or a script call. It selects a handler through a table indexed by the wall reference.1
typedef enum InfWallSpecialType {
INF_WALL_SPECIAL_NONE = 0, /* No interaction handler. */
INF_WALL_SPECIAL_DOOR_SWITCH = 1, /* Check and operate a door switch. */
INF_WALL_SPECIAL_DECORATION_SCRIPT = 2, /* Check the decoration, then send an event to the block's script. */
INF_WALL_SPECIAL_LEVER_INCREMENT = 3, /* Check the decoration, advance the wall, then send an event. */
INF_WALL_SPECIAL_LEVER_DECREMENT = 4, /* Check the decoration, move the wall back, then send an event. */
INF_WALL_SPECIAL_FORCE_DOOR = 5, /* Attempt to force a door. */
INF_WALL_SPECIAL_DOOR_NO_FORCE = 6, /* Handle a door that cannot be forced. */
INF_WALL_SPECIAL_SCRIPT = 7, /* Send the interaction event to the block's script. */
INF_WALL_SPECIAL_DECORATION_SCRIPT_ALT = 8, /* Same handler as value 2. */
INF_WALL_SPECIAL_SCRIPT_ALT = 9, /* Same handler as value 7. */
INF_WALL_SPECIAL_NICHE = 10 /* Put an item into, or take one out of, a niche. */
} InfWallSpecialType;
This selector is separate from the wall mapping flags.
The original files use the values 0, 2 to 5 and 7 to 10, and once 255: reference 59
of the second record of LEVEL1.INF, which therefore has no reaction.
ANOMALY-136. The game checks only the lower bound of the selector. A value
of 11 to 127 is not rejected: the game calls through words that lie beyond
its ten handlers, which are not code (inferred: a crash). A value of 128
or more is read as negative and calls nothing, like 0, as for the one 255 of
the original files. No original file uses 11 to 127. A faithful
reimplementation treats 128 to 255 as 0; it cannot
reproduce 11 to 127 meaningfully.1
How a handler runs
The game calls a handler only when the selector is nonzero and the event gate
matches. For the decoration-script handler, the decoration drawn on the wall
defines the click region. When the check succeeds, the handler sends
BLOCK_EVENT_WALL_DECORATION to the block's script, and
the script decides what happens: the selector alone does not mean that a wall
opens or that a button is hidden.2
INF_WALL_SPECIAL_FORCE_DOOR runs no script: the
strongest character tries the door.
The click region is tested only when the wall is clicked. When a flying object or the keyboard reaches the wall, the hit test succeeds without it. See activating walls.2
Sources
Locations refer to the game executable reference.