0x12 — time_schedule_value
Time/schedule/event-value helper. It can call CRadiApp::SetRadiataTime, SetEventValueForScript, GetEventValueForScript, GetAbstractionCharacterNumber, and CCharacterPerson::TraverseScheduleList.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x12 (18) |
|---|---|
| Handler | CRadiScript::Command_12 |
| Signature | CRadiScript::Command_12(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x488 (1160 bytes) |
| Engine name | time_schedule_value |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Time/schedule/event-value helper. It can call CRadiApp::SetRadiataTime, SetEventValueForScript, GetEventValueForScript, GetAbstractionCharacterNumber, and CCharacterPerson::TraverseScheduleList.
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 | 0x12 |
+----------------+----------------+----------------+----------------+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
11 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 |
|---|---|---|
mode | input | Handler path selector taken from the argument byte. The meaning is specific to each command. |
operation | derived | Argument bits 2-3, choosing what the command does: 0 sets the time from packed_time, 1 writes the selected script time value out to an event value, 2 reads an event value into the selected script time slot. |
packed_time | input | A packed time/calendar tuple, not a duration: five components of 6, 6, 6, 5 and 9 bits from the low end up, each forwarded to CRadiApp::SetRadiataTime. A component of all ones is the leave-unchanged sentinel and reaches the call as -1. |
part0 | derived | Bits 0-5 of packed_time; 0x3F leaves that component unchanged. |
part1 | derived | Bits 6-11 of packed_time; 0x3F leaves that component unchanged. |
part2 | derived | Bits 12-17 of packed_time; 0x3F leaves that component unchanged. |
part3 | derived | Bits 18-22 of packed_time; 0x1F leaves that component unchanged. |
part4 | derived | Bits 23-31 of packed_time; 0x1FF leaves that component unchanged. |
range_check | derived | Argument bit 4. When set and part4 is not its sentinel, the handler raises a script error and forces that component to -1. It gates a range check on the top component; it is not a duration. |
slot_select | derived | Slot selector; -1 means the current/default slot. |
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:
CCharacterPerson::TraverseScheduleList()CRadiApp::SetRadiataTime(int,int,int,int,int,int)CRadiScript::GetEventValueForScript(int,const SCR_DATA*)CRadiScript::SetEventValueForScript(int,int,SCR_DATA*)GetAbstractionCharacterNumber(unsigned int&)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0001 0x003F 0x0003 0x001F