0xC4 — person_field_update
Character/person field update. It resolves a character/person, can translate through GetAbstractionCharacterNumber, and writes fields on the resolved record including offsets 0x34A, 0x34C, 0x34E, 0x83, and 0x332.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0xC4 (196) |
|---|---|
| Handler | CRadiScript::Command_c4 |
| Signature | CRadiScript::Command_c4(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_runc.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x184 (388 bytes) |
| Engine name | person_field_update |
| Family | Person, battle and effects |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Character/person field update. It resolves a character/person, can translate through GetAbstractionCharacterNumber, and writes fields on the resolved record including offsets 0x34A, 0x34C, 0x34E, 0x83, and 0x332.
Encoding
The command header is one 32-bit word, as described in §3 Instruction encoding:
31 24 23 16 15 8 7 0
+----------------+----------------+----------------+----------------+
| flags | argument byte | extra words | 0xC4 |
+----------------+----------------+----------------+----------------+Bits 8–15 give the number of 32-bit operand words that follow. Bits 16–23 are handed to the handler as a bitfield; on character commands bit 0 normally says whether a character selector word is present. Bit 31 is the keep-going bit.
Operand fields
12 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.
| Field | Role | Meaning |
|---|---|---|
bit332_20 | input | Bit 0x20 of person-record byte +0x332, set or cleared by this line. |
character | input | The packed 32-bit character selector word. Its low half is the character id and byte 2 is a secondary class/variant input; see character_number and character_variant. |
character_number | derived | Low 16 bits of the character selector: the character/actor id. |
character_variant | derived | Byte 2 of the character selector: a secondary character/class input passed alongside the id. |
field34a | derived | Value written to the engine record at offset +0x34a; the field's meaning is not yet named. |
field34c | derived | Value written to the engine record at offset +0x34c; the field's meaning is not yet named. |
field34e | derived | Value written to the engine record at offset +0x34e; the field's meaning is not yet named. |
field83 | derived | Value written to the engine record at offset +0x83; the field's meaning is not yet named. |
field83_raw_high | derived | Upper part of the matching packed value for field83 raw. |
update_word0 | input | Word 0 of the packed update entry. |
update_word1 | input | Word 1 of the packed update entry. |
yield | derived | Pause the script here for one game frame; the next command runs on the following update. Lines without it keep running immediately. |
Engine calls
Engine functions this handler was observed calling:
CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)GetAbstractionCharacterNumber(unsigned int&)
Bit masks
Masks the handler applies to its argument byte or operand words:
0xFFFF 0x0001 0x00FF