Skip to content

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

Opcode0x1A (26)
HandlerCRadiScript::Command_1a
SignatureCRadiScript::Command_1a(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run0.cpp
Address— debug build; click for all 3
Handler size0x254 (596 bytes)
Engine namecharacter_equipment
FamilyScript control, flags and values
Command size4 + 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.

FieldRoleMeaning
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.
display_arginputByte 3 of item_control, passed to the display/equip-all calls when display_mode is nonzero.
display_modeinputMode selector for display; the handler branches on it.
iteminputItem operand, resolved through GetAbstractionItemNumber.
item_branchinputBit 1 of the argument byte: takes the inventory/equipment-index branch that uses byte 2 of item_control.
item_high_byteinputByte 2 of item_control, used by the equipment-index branch; 0x100 is ORed in when the character is in the party.
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:

  • 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*) const
  • CRadiApp::IsJoinParty(unsigned int) const
  • CRadiScript::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