0x17 — battle_character_entry
Battle/acquisition character-entry command. It resolves a character id, builds a 0x14-byte record from an optional character selector plus three entry words, and inserts it into the same global buffer used by Command_16.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x17 (23) |
|---|---|
| Handler | CRadiScript::Command_17 |
| Signature | CRadiScript::Command_17(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x258 (600 bytes) |
| Engine name | battle_character_entry |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Battle/acquisition character-entry command. It resolves a character id, builds a 0x14-byte record from an optional character selector plus three entry words, and inserts it into the same global buffer used by Command_16.
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 | 0x17 |
+----------------+----------------+----------------+----------------+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
13 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. |
character_number | derived | Low 16 bits of the character selector: the character/actor id. |
character_type | derived | Byte 2 of the character selector, where the handler treats it as a type selector rather than a variant. |
entry_byte3 | derived | Byte 2 of entry_word1; record +0x0E. |
entry_half0 | derived | Low half of entry_word0; record +0x08. |
entry_half1 | derived | High half of entry_word0; record +0x0A, read back as a signed value. |
entry_half2 | derived | Low half of entry_word1; record +0x0C. |
entry_word0 | input | First payload word of the battle order (RADI_BTL_ORDER): its low half lands at record +0x08 and its high half at +0x0A, which the battle character reads back as a signed value. |
entry_word1 | input | Second payload word: low half to record +0x0C, byte 2 to +0x0E, byte 3 to +0x0F. |
entry_word2_high | input | The upper three bytes of the third payload word, which have no reader specific enough to name yet. |
leader | input | Whether this character leads its team. It is bits 4-7 of record +0x10, which CBtlCharacter::ChangeLeader extracts and tests for non-zero. |
team | input | Which side this character fights on. It is the low nibble of record +0x10, which CBtlCharacter::ChangeTeamID reads with & 0x0F. Shipped battles use 0 and 1. |
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::GetCharacterID(unsigned int&,unsigned int&,unsigned int*,SCR_DATA*,unsigned int)memset
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0001