- Opcode: 0x092
- Short name: PCTURN
- Long name: Turn to face PC
Argument
none
Stack
Party position (0 = leader, 1, 2)
Speed
PCTURN
Description
Make this entity turn to face a party member. The handler pops the duration/speed first (stored at entity+578) and a party-position index second; it maps that index to the corresponding field party entity (via the savemap party-slot-to-entity table) and computes the angle from this entity toward that character. It stores the target facing (entity+478) and start facing (entity+476), and if not already aligned marks the turn active (entity+580 = 2) and rotates the shortest way around (wrapping the target by ±256 past half the 256-unit circle). Speed is the number of frames (larger = slower turn). Returns 2 when already facing / finished, 1 while turning.
PC handler: SCRIPT_PCTURN at 0x5278A0.