0x1B — window_message
Large window/message dispatcher. It resolves character, item, and event-value abstractions, may call AttachMessageData, constructs battle parameter objects in some branches, and repeatedly calls CRadiWindowManager::SendMessage.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x1B (27) |
|---|---|
| Handler | CRadiScript::Command_1b |
| Signature | CRadiScript::Command_1b(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0xA20 (2592 bytes) |
| Engine name | window_message |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Large window/message dispatcher. It resolves character, item, and event-value abstractions, may call AttachMessageData, constructs battle parameter objects in some branches, and repeatedly calls CRadiWindowManager::SendMessage.
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 | 0x1B |
+----------------+----------------+----------------+----------------+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
6 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 |
|---|---|---|
message | input | What the window is being told to do; the second SendMessage argument. 7 is the only value the handler intercepts: it builds a parameter block from the words that follow and sends its own sequence instead. |
mode | input | Handler path selector taken from the argument byte. The meaning is specific to each command. |
params | input | The remaining operand words for this message, kept in order. |
subdispatch | derived | Argument bit 0. It must be set for the message=7 parameter-block path; without it the line forwards window and message straight through. |
window | input | Which window this line talks to. It becomes the first argument of CRadiWindowManager::SendMessage(window_id, message, param), so it names a window such as the message box, the character-name display, the obi, the field-map name, or a battle window — not a piece of text. |
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::AttachMessageData(int,unsigned int,unsigned int,const SCR_DATA*)CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CRadiScript::GetAbstractionItemNumber(unsigned int&,const SCR_DATA*)CRadiScript::GetEventValueForScript(int,const SCR_DATA*)CRadiWindowManager::SendMessage(unsigned int,int,CRadiWindowParamBase*)CbtlAnalysisParameter::CbtlAnalysisParameter()CbtlVoltyDmgParameter::CbtlVoltyDmgParameter()
Bit masks
Masks the handler applies to its argument byte or operand words:
0xFFFF 0x0001 0x00FF 0x0002 0x0007 0x000F