- Opcode: 0x051
- Short name: SETPC
- Long name: Set PC
Argument
none
Stack
Party ID
SETPC
Description
Pops one value (party/character ID) and stores it in this entity’s PC field (+597), then flags the entity as player-controlled (sets bit 0x80 in its control flags at +352). Character IDs 3-5 and 7 additionally set the “controllable” bit 0x4000000. The entity is marked as an active party member only if its ID matches one of the three current party slots (SG_PARTY_FIELD1).
PC handler: SCRIPT_SETPC.
Function addresses
| Function | Address | Description |
|---|---|---|
SCRIPT_SETPC | 0x51E0E0 | Field script opcode handler (verified IDA function) |