0x19 — personal_inventory
Resolves a personal data record and calls CPersonalData inventory methods including SetPossessionItem, GetOneItemNum, GetItemInfo, GetSpecialItemNum, GetNormalItemNum, and DeletePossessionItem. Can write a result to a script event value.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x19 (25) |
|---|---|
| Handler | CRadiScript::Command_19 |
| Signature | CRadiScript::Command_19(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x338 (824 bytes) |
| Engine name | personal_inventory |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Resolves a personal data record and calls CPersonalData inventory methods including SetPossessionItem, GetOneItemNum, GetItemInfo, GetSpecialItemNum, GetNormalItemNum, and DeletePossessionItem. Can write a result to a script event value.
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 | 0x19 |
+----------------+----------------+----------------+----------------+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 |
|---|---|---|
character | input | The packed 32-bit character selector word. Its low half is the character id and byte 2 is a secondary class/variant input; see character_number and character_variant. |
delete_index | derived | Index selecting which delete to act on. |
event40 | derived | Bit 6 of the argument byte: the handler reads a script event value on this path. |
event80 | derived | Bit 7 of the argument byte: the handler writes its result to a script event value. |
flag5 | derived | Boolean option 5 taken from the handler's argument byte. |
item_id | input | Identifier selecting which item to use. |
mode | input | Handler path selector taken from the argument byte. The meaning is specific to each command. |
post_set_flags | input | Boolean options for post set, packed one per bit. |
quantity | input | How many of the item to add or remove. |
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:
CPersonalData::DeletePossessionItem(unsigned int)CPersonalData::GetItemInfo(unsigned int) constCPersonalData::GetNormalItemNum() constCPersonalData::GetOneItemNum(unsigned int)CPersonalData::GetSpecialItemNum() constCPersonalData::SearchItemInfo(unsigned int,unsigned int,int*) constCPersonalData::SetPossessionItem(unsigned int,int)CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CRadiScript::GetAbstractionItemNumber(unsigned int&,const SCR_DATA*)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 0xFFFF 0x0003 0x0020 0x0040 0x0080