Skip to content

0x35 — character_single_manager

Character single-manager helper. It resolves a character, gets a character sub-manager, allocates or clears CSingleManager data, and dispatches several virtual construction/append paths.

proven— handler traced, and exercised by at least one shipped script.

At a glance

Opcode0x35 (53)
HandlerCRadiScript::Command_35
SignatureCRadiScript::Command_35(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run2.cpp
Address— debug build; click for all 3
Handler size0x7B8 (1976 bytes)
Engine namecharacter_single_manager
FamilyCharacters
Command size4 + extra_words * 4 bytes

Handler behaviour

Character single-manager helper. It resolves a character, gets a character sub-manager, allocates or clears CSingleManager data, and dispatches several virtual construction/append paths.

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   |  0x35          |
+----------------+----------------+----------------+----------------+

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

15 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.
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.
entry0inputEntry 0 of the packed record this command builds.
entry1inputEntry 1 of the packed record this command builds.
entry1_manager_typederivedWhich kind of entry1 manager this is; the handler branches on it.
entry3inputEntry 3 of the packed record this command builds.
entry3_manager_typederivedWhich kind of entry3 manager this is; the handler branches on it.
entry4inputEntry 4 of the packed record this command builds.
entry4_manager_typederivedWhich kind of entry4 manager this is; the handler branches on it.
manager_flag14_bit0inputArgument-byte bit 4, stored as bit 0 of the sub-manager's flag byte (CSingleManager+0x14). No mapped code reads that bit back, so the name says where it is written rather than what it does.
manager_modederivedMode selector for manager; the handler branches on it.
maskinputWhich sub-object slots this line sets up: one bit per slot, and each set bit consumes one entry from the stream. Bits 0-4 are the ones scripts use.
mask_bitsderivedNames of the bits set in the matching packed value.
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:

  • CCharacter sub-manager [1]
  • CCharacterManager::GetCharacterClass2(int,unsigned int,const CCharacter*,unsigned int)
  • CCharacterManager::GetCharacterSubManager(int)
  • CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)
  • CRadiScript::GetCharacterID(unsigned int&,unsigned int&,unsigned int*,SCR_DATA*,unsigned int)
  • CSingleManager
  • CSingleManager::CSingleManager()
  • CSingleManager::DeleteAllElements()
  • operator new(unsigned int,int,const char*)

Bit masks

Masks the handler applies to its argument byte or operand words:

0x0001 0xFFFF 0x00FF