Skip to content

0x52 — camera_transform_param

Branches on handler_arg_byte and control bits, calls CCharacterCapture::Capture, CRLHCamera::AddAcceleration, CRLHCamera::SetRotate, and CAutoRateBase::SetParam for camera-related parameters.

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

At a glance

Opcode0x52 (82)
HandlerCRadiScript::Command_52
SignatureCRadiScript::Command_52(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run5.cpp
Address— debug build; click for all 3
Handler size0x5A0 (1440 bytes)
Engine namecamera_transform_param
FamilyBackground, map, landscape and camera
Command size4 + extra_words * 4 bytes

Handler behaviour

Branches on handler_arg_byte and control bits, calls CCharacterCapture::Capture, CRLHCamera::AddAcceleration, CRLHCamera::SetRotate, and CAutoRateBase::SetParam for camera-related parameters.

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

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

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

FieldRoleMeaning
capture_before_rotatederivedControl bit preserved from the command; its exact effect on the transform is untraced.
controlderivedBitmask word choosing which optional payload words follow, in the order the handler tests them. Changing it changes how many words the command carries.
control_flagsderivedBoolean options for control, packed one per bit.
distance_scalederivedControl bit preserved from the command; its exact effect on the transform is untraced.
durationderivedHow long the transform takes. This is the value itself, not a rendering of another field.
field20derivedValue written to the engine record at offset +0x20; the field's meaning is not yet named.
field3cderivedValue written to the engine record at offset +0x3c; the field's meaning is not yet named.
field58_valueinputValue used for field58.
flag2derivedBoolean option 2 taken from the handler's argument byte.
flag3derivedBoolean option 3 taken from the handler's argument byte.
flag4derivedBoolean option 4 taken from the handler's argument byte.
initial_vecinputThree-component vector (x, y, z) for initial.
modederivedHandler path selector taken from the argument byte. The meaning is specific to each command.
post_vecinputThree-component vector (x, y, z) for post.
rotatederivedSet when rotation is included on this line.
rotate_valuederivedValue used for rotate.
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:

  • CAutoRateBase::SetParam(unsigned int,float,float,float)
  • CCharaDispManager::SetInstantMode()
  • CCharacterCapture::Capture()
  • CCharacterManager::GetCharacterSubManager(int)
  • CRLHCamera::AddAcceleration(float,bool)
  • CRLHCamera::SetRotate(float,float)
  • atan2f
  • atan2f / fmodf
  • fmodf

Bit masks

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

0x0001 0x0004 0x0008 0x0010 0x0003 0xFFFF 0x0002