0xD5 — special_effect
Builds special-effect parameters, resolves up to two character abstractions, and calls CSpecialEffectManager::ExecuteSpecialEffect_Main or CSpecialEffectManager::AbortSpecialEffect.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0xD5 (213) |
|---|---|
| Handler | CRadiScript::Command_d5 |
| Signature | CRadiScript::Command_d5(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_rund.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x1CC (460 bytes) |
| Engine name | special_effect |
| Family | Person, battle and effects |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Builds special-effect parameters, resolves up to two character abstractions, and calls CSpecialEffectManager::ExecuteSpecialEffect_Main or CSpecialEffectManager::AbortSpecialEffect.
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 | 0xD5 |
+----------------+----------------+----------------+----------------+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
10 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 |
|---|---|---|
abort | derived | Set when the command calls AbortSpecialEffect instead of ExecuteSpecialEffect_Main. |
character0 | input | First character selector word, present when explicit_char0 is set. |
character1 | input | Second character selector word, present when explicit_char1 is set. |
effect | input | Packed effect word: low half is effect_id, high half is effect_flags. |
effect_flags | derived | Boolean options for effect, packed one per bit. |
effect_id | derived | Identifier selecting which effect to use. |
execute | input | Final word passed to ExecuteSpecialEffect_Main. |
explicit_char0 | derived | Whether the first character selector word is present. |
explicit_char1 | derived | Whether the second character selector word is present. |
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::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CSpecialEffectManager::AbortSpecialEffect(unsigned int,unsigned int,unsigned int,unsigned int,long)CSpecialEffectManager::ExecuteSpecialEffect_Main(CSEParameter_Base*)SetDefaultMemoryManager(CMemoryManager*)
Bit masks
Masks the handler applies to its argument byte or operand words:
0xFFFF 0x00FF 0x0001 0x0002 0x0080