• Opcode: 0x01D
  • Short name: SET
  • Long name: Set position

Argument

Walkmesh triangle ID.

Stack

XCoord

YCoord

SET

Description

Place this entity’s model at XCoord, YCoord standing on the given walkmesh triangle. Unlike SET3, this function will place the event on the walkable terrain (the ZCoord is interpolated from the walkmesh). The two stack values are popped (top = YCoord, below = XCoord), each shifted left by 12 into the engine’s fixed-point coordinate space and written to the entity position fields (+400 X, +404 Y); the Argument triangle ID is stored at +506 and the model is re-seated on the walkmesh. Returns 2.

PC handler: SCRIPT_SET.

Function addresses

Function Address Description
SCRIPT_SET 0x51D720 Field script opcode handler (verified IDA function)