Skip to content

0xC5 — set_radiata_time

Reads time fields from the command stream and calls CRadiApp::SetRadiataTime.

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

At a glance

Opcode0xC5 (197)
HandlerCRadiScript::Command_c5
SignatureCRadiScript::Command_c5(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_runc.cpp
Address— debug build; click for all 3
Handler size0x254 (596 bytes)
Engine nameset_radiata_time
FamilyPerson, battle and effects
Command size4 + extra_words * 4 bytes

Handler behaviour

Reads time fields from the command stream and calls CRadiApp::SetRadiataTime.

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

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

5 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.

FieldRoleMeaning
arginputRaw handler argument byte from the command header. It is printed only when it differs from the value the named fields already imply, so seeing it means the command uses an unusual argument encoding.
day_1basedinputDay to set, counted from 1: the handler passes value - 1 to CRadiApp::SetRadiataTime. Two values are sentinels -- 0 makes no day call at all, and 0xFFFF (printed resync) derives the day from accumulated game time.
hourinputHour to set. Command_c5 normalises it modulo 24 and stores it in the app clock at +0x848; it is not passed to CRadiApp::SetRadiataTime, which only the day path calls. 0xFF derives the current hour from game time first.
minuteinputMinute to set. Command_c5 normalises it modulo 60 and stores it in the app clock at +0x849; it is not passed to CRadiApp::SetRadiataTime, which only the day path calls. 0xFF derives the current minute from game time first.
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:

  • CRadiApp::SetRadiataTime(int,int,int,int,int,int)
  • Division ops
  • script slot allocation

Bit masks

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

0x0003