Skip to content

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

Opcode0xC4 (196)
HandlerCRadiScript::Command_c4
SignatureCRadiScript::Command_c4(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_runc.cpp
Address— debug build; click for all 3
Handler size0x184 (388 bytes)
Engine nameperson_field_update
FamilyPerson, battle and effects
Command size4 + 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.

FieldRoleMeaning
bit332_20inputBit 0x20 of person-record byte +0x332, set or cleared by this line.
characterinputThe 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_numberderivedLow 16 bits of the character selector: the character/actor id.
character_variantderivedByte 2 of the character selector: a secondary character/class input passed alongside the id.
field34aderivedValue written to the engine record at offset +0x34a; the field's meaning is not yet named.
field34cderivedValue written to the engine record at offset +0x34c; the field's meaning is not yet named.
field34ederivedValue written to the engine record at offset +0x34e; the field's meaning is not yet named.
field83derivedValue written to the engine record at offset +0x83; the field's meaning is not yet named.
field83_raw_highderivedUpper part of the matching packed value for field83 raw.
update_word0inputWord 0 of the packed update entry.
update_word1inputWord 1 of the packed update entry.
yieldderivedPause 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