0x1A — character_equipment
Resolves character and item abstractions, then calls CPersonalData::SearchItemInfo and CCharaEquipmentManager methods for equipping, displaying, and reflecting equipment.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x1A (26) |
|---|---|
| Handler | CRadiScript::Command_1a |
| Signature | CRadiScript::Command_1a(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x254 (596 bytes) |
| Engine name | character_equipment |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Resolves character and item abstractions, then calls CPersonalData::SearchItemInfo and CCharaEquipmentManager methods for equipping, displaying, and reflecting equipment.
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 | 0x1A |
+----------------+----------------+----------------+----------------+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
7 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 |
|---|---|---|
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. |
display_arg | input | Byte 3 of item_control, passed to the display/equip-all calls when display_mode is nonzero. |
display_mode | input | Mode selector for display; the handler branches on it. |
item | input | Item operand, resolved through GetAbstractionItemNumber. |
item_branch | input | Bit 1 of the argument byte: takes the inventory/equipment-index branch that uses byte 2 of item_control. |
item_high_byte | input | Byte 2 of item_control, used by the equipment-index branch; 0x100 is ORed in when the character is in the party. |
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:
CCharaEquipmentManager::DispEpuipment(CCharacter*,int,int,unsigned int)CCharaEquipmentManager::EquipAllType(CCharacter*,int,unsigned int)CCharaEquipmentManager::ReflectArmorModelingType(unsigned int,unsigned int)CCharaEquipmentManager::SetEquipedItemByIndex(unsigned int,unsigned int,int)CCharacterManager::GetCharacterClass2(int,unsigned int,const CCharacter*,unsigned int)CPersonalData::SearchItemInfo(unsigned int,unsigned int,int*) constCRadiApp::IsJoinParty(unsigned int) constCRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CRadiScript::GetAbstractionItemNumber(unsigned int&,const SCR_DATA*)GetAbstractionCharacterNumber(unsigned int&)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x00FF 0xFFFF 0x0001 0x0002