Class: game_object
Client object base presentation as script object. Generic in-game entities from items to mutants and stalkers wrapped with luabind export.
Source
C++ class game_object
Custom Constructor
game_object
Remarks
This class is a shared Lua wrapper for many runtime object classes. A method being visible here does not mean it is valid for every object. Check is_actor(), is_stalker(), is_monster(), is_inventory_owner(), is_weapon(), or the matching cast_*() helper before calling methods that belong to a specific object family.
Extends
Constructors
Constructor
protected new game_object(): game_object;Engine-created script object wrapper.
Returns
game_object
Overrides
game_object_callbacks_implementation_base.constructor
Methods
accessible()
Call Signature
accessible(position: vector): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Target position to check. |
Returns
boolean
If target position is accessible by the object.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
Call Signature
accessible(vertex_id: number): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
vertex_id | number | Target vertex ID to check. |
Returns
boolean
If target vertex is accessible by the object.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
accessible_nearest()
accessible_nearest(vertex_position: vector, target_position: vector): LuaMultiReturn<[number, vector]>;Parameters
| Parameter | Type | Description |
|---|---|---|
vertex_position | vector | Position to test from. |
target_position | vector | Desired target position. |
Returns
LuaMultiReturn<[number, vector]>
Level vertex id and accessible position.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
accuracy()
accuracy(): number;Returns
number
Weapon accuracy for this inventory owner.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
action()
action(): Nullable<entity_action>;Get current entity action.
Returns
Nullable<entity_action>
Current action, or null when no action is active.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
action_by_index()
action_by_index(index: number): Nullable<entity_action>;Get queued action by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | Action index. |
Returns
Nullable<entity_action>
Action object, or null.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
action_count()
action_count(): number;Get queued action count.
Returns
number
Number of queued actions.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
activate_slot()
activate_slot(index: number): void;Activate an inventory slot.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | Slot id. |
Returns
void
active_detector()
active_detector(): Nullable<game_object>;Get active detector item.
Returns
Nullable<game_object>
Working detector item, or null.
Source
src/xrGame/script_game_object_inventory_owner.cpp, CScriptGameObject::active_detector.
Remarks
Requires this object to be a CInventoryOwner. The binding reads the detector slot and returns the detector only while it is working. Missing inventory owner, empty detector slot, or inactive detector returns null.
active_item()
active_item(): Nullable<game_object>;Get active inventory item.
Returns
Nullable<game_object>
Active inventory item, or null when no item is active.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::GetActiveItem.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return null.
active_slot()
active_slot<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends number |
Returns
T
Active item slot of game object.
active_sound_count()
Call Signature
active_sound_count(): number;Returns
number
Number of active sounds registered on this object.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
Call Signature
active_sound_count(only_playing: boolean): number;Get number of active sounds registered on this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
only_playing | boolean | Whether to count only sounds currently playing. |
Returns
number
Number of active sounds.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
active_zone_contact()
active_zone_contact(zone_id: number): boolean;Check whether the object contacts an active zone.
Parameters
| Parameter | Type | Description |
|---|---|---|
zone_id | number | Zone object id. |
Returns
boolean
Whether contact is active.
Remarks
Intended for alive objects that track zone contacts. Zone ids are runtime object ids, not story ids.
actor_look_at_point()
actor_look_at_point(position: vector): void;Force actor look direction toward a point.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Point to look at. |
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
add_animation()
Call Signature
add_animation(
animation: string,
hand_usage: boolean,
use_movement_controller: boolean): void;Queue animation by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
hand_usage | boolean | Whether the animation uses hands. |
use_movement_controller | boolean | Whether movement controller should drive the animation. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
add_animation(
animation: string,
hand_usage: boolean,
position: vector,
rotation: vector,
local_animation: boolean): void;Queue animation with local transform data.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
hand_usage | boolean | Whether the animation uses hands. |
position | vector | Animation position. |
rotation | vector | Animation rotation. |
local_animation | boolean | Whether transform is local to the object. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
add_combat_sound()
add_combat_sound(
prefix: string,
max_count: number,
type: TXR_snd_type,
priority: number,
mask: number,
internal_type: number,
bone: string): number;Register a combat sound.
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix | string | Sound prefix. |
max_count | number | Maximum samples in the sound collection. |
type | TXR_snd_type | AI sound category. |
priority | number | Sound priority. |
mask | number | Sound synchronization mask. |
internal_type | number | Internal stalker sound id. |
bone | string | Bone name used for playback placement. |
Returns
number
Registered sound id, or 0 when this object is not a stalker.
Source
src/xrGame/script_game_object4.cpp, CScriptGameObject::add_combat_sound.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return 0.
add_restrictions()
add_restrictions(out_restriction: string, in_restriction: string): void;Add movement restrictions.
Parameters
| Parameter | Type | Description |
|---|---|---|
out_restriction | string | Restrictor name used as outside boundary. |
in_restriction | string | Restrictor name used as inside boundary. |
Returns
void
Remarks
Requires an object with AI path restriction support. Inventory-only objects and static props do not have meaningful in/out restriction lists.
add_sound()
Call Signature
add_sound(
prefix: string,
max_count: number,
type: TXR_snd_type,
priority: number,
mask: number,
internal_type: number): number;Register an NPC sound.
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix | string | Sound prefix. |
max_count | number | Maximum samples in the sound collection. |
type | TXR_snd_type | AI sound category. |
priority | number | Sound priority. |
mask | number | Sound synchronization mask. |
internal_type | number | Internal monster sound id. |
Returns
number
Registered sound id, or 0 when this object is not a custom monster.
Source
src/xrGame/script_game_object4.cpp, CScriptGameObject::add_sound.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
Call Signature
add_sound(
prefix: string,
max_count: number,
type: TXR_snd_type,
priority: number,
mask: number,
internal_type: number,
bone: string): number;Register an NPC sound with a bone name.
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix | string | Sound prefix. |
max_count | number | Maximum samples in the sound collection. |
type | TXR_snd_type | AI sound category. |
priority | number | Sound priority. |
mask | number | Sound synchronization mask. |
internal_type | number | Internal monster sound id. |
bone | string | Bone name used for playback placement. |
Returns
number
Registered sound id, or 0 when this object is not a custom monster.
Source
src/xrGame/script_game_object4.cpp, CScriptGameObject::add_sound.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
add_upgrade()
add_upgrade(upgrade_section: string): boolean;Add an upgrade section.
Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_section | string | Section of upgrade to add. |
Returns
boolean
Whether upgrade is installed successfully or not.
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
aim_bone_id()
Call Signature
aim_bone_id(): string;Get aimed bone id.
Returns
string
Bone name.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
aim_bone_id(bone: string): void;Set aimed bone id.
Parameters
| Parameter | Type | Description |
|---|---|---|
bone | string | Bone name. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
aim_time()
Call Signature
aim_time(object: game_object): number;Get aim time for a target.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Target object. |
Returns
number
Aim time.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
aim_time(object: game_object, time: number): void;Set aim time for a target.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Target object. |
time | number | Aim time. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
alive()
alive(): boolean;Returns
boolean
Whether game object is alive.
allow_break_talk_dialog()
allow_break_talk_dialog(value: boolean): void;Allow or block breaking the current actor talk dialog.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the dialog may be interrupted. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
allow_sprint()
allow_sprint(is_allowed: boolean): void;Enable or disable actor sprint.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_allowed | boolean | Whether sprint is allowed. |
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
ammo_box_size()
ammo_box_size(): number;Get configured ammo box size for this ammo item.
Returns
number
Configured ammo box size.
Since
OpenXRay 2022-12-25, 3afded2f, PR #1190
Remarks
Requires this object to be a CWeaponAmmo item. Other object types log a script error and return 0.
ammo_get_count()
ammo_get_count(): number;Get current ammo count in this ammo box.
Returns
number
Ammo count in this ammo box.
Since
OpenXRay 2022-12-25, 3afded2f, PR #1190
Remarks
Requires this object to be a CWeaponAmmo item. Other object types log a script error and return 0.
ammo_set_count()
ammo_set_count(count: number): void;Set ammo count for this ammo box.
Parameters
| Parameter | Type | Description |
|---|---|---|
count | number | Ammo count. |
Returns
void
Since
OpenXRay 2022-12-25, 3afded2f, PR #1190
Remarks
Requires this object to be a CWeaponAmmo item. Other object types log a script error and do nothing.
animation_count()
animation_count(): number;Get animation count.
Returns
number
Animation count.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
animation_slot()
animation_slot(): number;Get current animation slot.
Returns
number
Animation slot id.
Remarks
Meaningful for animated alive objects. For objects without animation controller state, the engine can return a default value.
apply_loophole_direction_distance()
Call Signature
apply_loophole_direction_distance(): number;Returns
number
Distance used when applying smart-cover loophole direction.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
apply_loophole_direction_distance(distance: number): void;Set the distance used when applying smart-cover loophole direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
distance | number | Loophole direction distance. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
attach_vehicle()
attach_vehicle(vehicle: game_object, force: boolean): void;Attach actor to a vehicle or holder.
Parameters
| Parameter | Type | Description |
|---|---|---|
vehicle | game_object | Vehicle object. |
force | boolean | Whether attach should be forced. |
Returns
void
Since
OpenXRay 2015-06-16, 0fe21c14
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
attachable_item_enabled()
attachable_item_enabled(): boolean;Returns
boolean
Whether this attachable item is enabled.
Remarks
Requires this object to be an attachable item. Other object types log a script error and return a default value or do nothing.
attachable_item_load_attach()
attachable_item_load_attach(section: string): void;Reload attach position for this attachable item from a section.
Parameters
| Parameter | Type | Description |
|---|---|---|
section | string | Config section with attach data. |
Returns
void
Remarks
Requires this object to be an attachable item. Other object types log a script error and return a default value or do nothing.
base_in_restrictions()
base_in_restrictions(): string;Returns
string
Base incoming restriction list.
base_out_restrictions()
base_out_restrictions(): string;Get base outside restrictions.
Returns
string
Restriction list.
Remarks
Requires an object with AI path restriction support.
belt_count()
belt_count(): number;Get actor belt slot count.
Returns
number
Number of items on the belt.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
berserk()
berserk(): void;Switch monster into berserk state.
Returns
void
Remarks
Requires a custom monster. It is not a generic combat command for stalkers or the actor.
best_cover()
best_cover(
position: vector,
enemy_position: vector,
min_distance: number,
max_distance: number,
deviation: number): cover_point;Find the best cover from one position against another.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Search origin. |
enemy_position | vector | Threat position. |
min_distance | number | Minimum distance. |
max_distance | number | Maximum distance. |
deviation | number | Allowed direction deviation. |
Returns
Cover point.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
best_danger()
best_danger(): Nullable<danger_object>;Get most relevant danger object.
Returns
Nullable<danger_object>
Danger object, or null.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
best_enemy()
best_enemy(): Nullable<game_object>;Get best enemy selected by monster memory.
Returns
Nullable<game_object>
Selected enemy object, or null.
Source
src/xrGame/script_game_object2.cpp, CScriptGameObject::GetBestEnemy.
Remarks
Requires this object to be a CCustomMonster. The binding reads the selected enemy from monster memory and returns null when the object is not a monster or no enemy is selected.
best_item()
best_item(): Nullable<game_object>;Get best remembered item for this object.
Returns
Nullable<game_object>
Best remembered item, or null.
Source
src/xrGame/script_game_object2.cpp, CScriptGameObject::GetBestItem.
Remarks
Requires this object to be a CCustomMonster. This is the selected item from monster memory, not the best item in the object's inventory. Non-monster objects or monsters without a selected item return null.
best_weapon()
best_weapon(): Nullable<game_object>;Get best available weapon for this object.
Returns
Nullable<game_object>
Best weapon candidate, or null.
Source
src/xrGame/script_game_object2.cpp, CScriptGameObject::best_weapon.
Remarks
Requires this object to be a CAI_Stalker. The binding reads the stalker object handler's best weapon candidate and returns it only when the item still belongs to this object. Non-stalker objects, missing candidates, and candidates owned by another object return null.
bind_object()
bind_object(binder: object_binder): void;Attach a Lua binder to this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
binder | object_binder | Binder instance adopted by the engine. |
Returns
void
binded_object()
binded_object(): object_binder;Get attached Lua binder.
Returns
Bound object binder.
body_state()
body_state(): TXR_body_state;Returns
Current stalker body state.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
bone_position()
bone_position(bone: string): vector;Get model bone world position.
Parameters
| Parameter | Type | Description |
|---|---|---|
bone | string | Bone name. |
Returns
Bone position.
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
bone_visible()
bone_visible(bone: string): boolean;Check whether a bone is visible.
Parameters
| Parameter | Type | Description |
|---|---|---|
bone | string | Bone name. |
Returns
boolean
Whether bone is visible.
Since
OpenXRay 2015-07-07, 6e703b4c
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
burer_get_force_gravi_attack()
burer_get_force_gravi_attack(): boolean;Returns
boolean
Whether this burer is forced to use a gravity attack.
Remarks
Requires this object to be a burer. Other object types log a script error and return a default value or do nothing.
burer_set_force_gravi_attack()
burer_set_force_gravi_attack(value: boolean): void;Toggle burer gravity attack override.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether forced gravity attack is enabled. |
Returns
void
Remarks
Requires this object to be a burer. Other object types log a script error and return a default value or do nothing.
buy_condition()
Call Signature
buy_condition(ini_file: ini_file, section: string): void;Set trade buy conditions from an ini section.
Parameters
| Parameter | Type | Description |
|---|---|---|
ini_file | ini_file | Trade config. |
section | string | Condition section. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
Call Signature
buy_condition(friend_factor: number, enemy_factor: number): void;Set default trade buy factors.
Parameters
| Parameter | Type | Description |
|---|---|---|
friend_factor | number | Factor used for friendly relations. |
enemy_factor | number | Factor used for hostile relations. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
buy_item_condition_factor()
buy_item_condition_factor(factor: number): void;Set item condition factor used by buying logic.
Parameters
| Parameter | Type | Description |
|---|---|---|
factor | number | Condition factor. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
buy_supplies()
buy_supplies(ini: ini_file, section: string): void;Buy supplies described by a config section.
Parameters
| Parameter | Type | Description |
|---|---|---|
ini | ini_file | Trade config. |
section | string | Supply section. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
can_add_upgrade()
can_add_upgrade(upgrade_section: string): boolean;Check whether an upgrade can be added.
Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_section | string | Section of upgrade to check. |
Returns
boolean
Whether upgrade can be added.
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
can_install_upgrade()
can_install_upgrade(upgrade_section: string): boolean;Check whether an upgrade can be installed.
Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_section | string | Section of upgrade to check. |
Returns
boolean
Whether upgrade can be installed.
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
can_script_capture()
can_script_capture(): boolean;Check whether scripts can capture this object.
Returns
boolean
Whether script capture is allowed.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
can_select_weapon()
Call Signature
can_select_weapon(): boolean;Check whether this object can select a weapon.
Returns
boolean
Whether weapon selection is enabled.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
can_select_weapon(is_enabled: boolean): void;Enable or disable weapon selection.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether weapon selection is enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
can_throw_grenades()
Call Signature
can_throw_grenades(): boolean;Check whether this object can throw grenades.
Returns
boolean
Whether grenade throwing is enabled.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
can_throw_grenades(is_enabled: boolean): void;Enable or disable grenade throwing.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether grenade throwing is enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
cast_Actor()
cast_Actor(): Nullable<CActor>;Cast this object to an actor wrapper.
Returns
Nullable<CActor>
Actor wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Ammo()
cast_Ammo(): Nullable<CWeaponAmmo>;Cast this object to an ammo wrapper.
Returns
Nullable<CWeaponAmmo>
Ammo wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Artefact()
cast_Artefact(): Nullable<CArtefact>;Cast this object to an artefact wrapper.
Returns
Nullable<CArtefact>
Artefact wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Car()
cast_Car(): Nullable<CCar>;Cast this object to a car wrapper.
Returns
Nullable<CCar>
Car wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_CustomZone()
cast_CustomZone(): Nullable<CCustomZone>;Cast this object to a custom zone wrapper.
Returns
Nullable<CCustomZone>
Custom zone wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_EntityAlive()
cast_EntityAlive(): Nullable<CEntityAlive>;Cast this object to an alive entity wrapper.
Returns
Nullable<CEntityAlive>
Alive entity wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Explosive()
cast_Explosive(): Nullable<explosive>;Cast this object to an explosive wrapper.
Returns
Nullable<explosive>
Explosive wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_GameObject()
cast_GameObject(): Nullable<CGameObject>;Cast this object to a base game object wrapper.
Returns
Nullable<CGameObject>
Game object wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Heli()
cast_Heli(): Nullable<CHelicopter>;Cast this object to a helicopter wrapper.
Returns
Nullable<CHelicopter>
Helicopter wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_HolderCustom()
cast_HolderCustom(): Nullable<holder>;Cast this object to a holder wrapper.
Returns
Nullable<holder>
Holder wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_InventoryItem()
cast_InventoryItem(): Nullable<CInventoryItem>;Cast this object to an inventory item wrapper.
Returns
Nullable<CInventoryItem>
Inventory item wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_InventoryOwner()
cast_InventoryOwner(): Nullable<CInventoryOwner>;Cast this object to an inventory owner wrapper.
Returns
Nullable<CInventoryOwner>
Inventory owner wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Monster()
cast_Monster(): Nullable<CCustomMonster>;Cast this object to a custom monster wrapper.
Returns
Nullable<CCustomMonster>
Custom monster wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_PhysicsShellHolder()
cast_PhysicsShellHolder(): Nullable<CPhysicsShellHolder>;Cast this object to a physics shell holder wrapper.
Returns
Nullable<CPhysicsShellHolder>
Physics shell holder wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_ScriptZone()
cast_ScriptZone(): Nullable<ce_script_zone>;Cast this object to a script zone wrapper.
Returns
Nullable<ce_script_zone>
Script zone wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_SpaceRestrictor()
cast_SpaceRestrictor(): Nullable<CSpaceRestrictor>;Cast this object to a space restrictor wrapper.
Returns
Nullable<CSpaceRestrictor>
Space restrictor wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Stalker()
cast_Stalker(): Nullable<CAI_Stalker>;Cast this object to a stalker wrapper.
Returns
Nullable<CAI_Stalker>
Stalker wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_Weapon()
cast_Weapon(): Nullable<CWeapon>;Cast this object to a weapon wrapper.
Returns
Nullable<CWeapon>
Weapon wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
cast_WeaponMagazined()
cast_WeaponMagazined(): Nullable<CWeaponMagazined>;Cast this object to a magazined weapon wrapper.
Returns
Nullable<CWeaponMagazined>
Magazined weapon wrapper, or null.
Remarks
Returns the requested wrapper only when the runtime object has that engine type; otherwise the cast result may be null at runtime.
center()
center(): vector;Get object center position.
Returns
Center position.
change_character_rank()
change_character_rank(delta: number): void;Add a delta to character rank.
Parameters
| Parameter | Type | Description |
|---|---|---|
delta | number | Rank delta. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
change_character_reputation()
change_character_reputation(delta: number): void;Add a delta to character reputation.
Parameters
| Parameter | Type | Description |
|---|---|---|
delta | number | Reputation delta. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
change_goodwill()
change_goodwill(delta_goodwill: number, to_object: game_object): void;Add a delta to goodwill toward another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
delta_goodwill | number | Goodwill delta. |
to_object | game_object | Target object. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
change_team()
change_team(
team_id: number,
squad_id: number,
group_id: number): void;Change team, squad, and group ids.
Parameters
| Parameter | Type | Description |
|---|---|---|
team_id | number | Team id. |
squad_id | number | Squad id. |
group_id | number | Group id. |
Returns
void
Remarks
Intended for alive AI objects. It changes runtime relation grouping, not smart-terrain squad membership.
character_community()
character_community<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Object community like monolith, stalker or zombied.
character_icon()
character_icon<T>(): T;Get character icon id.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Icon id.
character_name()
character_name<T>(): T;Get localized character name.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Character display name.
character_rank()
character_rank(): number;Get character rank value.
Returns
number
Rank value.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
character_reputation()
character_reputation(): number;Get character reputation.
Returns
number
Reputation value.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
clear_animations()
clear_animations(): void;Remove queued animations.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
clear_callbacks()
clear_callbacks(): void;Clear all callbacks registered on this object.
Returns
void
Inherited from
game_object_callbacks_implementation_base.clear_callbacks
clear_game_news()
clear_game_news(): void;Clear queued game news for this inventory owner.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
clear_override_animation()
clear_override_animation(): void;Clear override animation.
Returns
void
clsid()
clsid(): TXR_class_id;Get engine class id.
Returns
Class id constant.
command()
command(entity_action: entity_action, is_high_priority: boolean): void;Add action for game object entity. Depending on priority pushes it to back or front of actions list.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity_action | entity_action | Action to perform. |
is_high_priority | boolean | Whether it is high priority action. |
Returns
void
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
community_goodwill()
community_goodwill(from_community: string): number;Get goodwill toward a community.
Parameters
| Parameter | Type | Description |
|---|---|---|
from_community | string | Community id. |
Returns
number
Goodwill value.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
condition()
condition(): number;Get item condition.
Returns
number
Condition value.
Remarks
Requires an inventory item or another object with condition/durability data.
cost()
cost(): number;Get object cost.
Returns
number
Cost.
Remarks
Requires an inventory item or tradeable object. Non-item objects can report an engine default.
critically_wounded()
critically_wounded(): boolean;Check whether NPC is critically wounded.
Returns
boolean
Whether object is critically wounded.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
deadbody_can_take()
deadbody_can_take(value: boolean): void;Allow or block taking items from this dead body.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether taking items is allowed. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
deadbody_can_take_status()
deadbody_can_take_status(): boolean;Returns
boolean
Whether items can be taken from this dead body.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
deadbody_closed()
deadbody_closed(value: boolean): void;Mark this dead body inventory as opened or closed.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the dead body is closed. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
deadbody_closed_status()
deadbody_closed_status(): boolean;Check whether dead body inventory is closed.
Returns
boolean
Whether looting is closed.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
death_sound_enabled()
Call Signature
death_sound_enabled(): boolean;Returns
boolean
Whether death sounds are enabled.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
death_sound_enabled(value: boolean): void;Enable or disable death sounds.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether death sounds are enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
death_time()
death_time(): number;Get object death time.
Returns
number
Death time.
debug_planner()
debug_planner(planner: action_planner): void;Sets provided planner as debugged for stalker object. As result, when console command ai_dbg_stalker on is toggled, GOAP state of planner is displayed. Requires mixed build engine.
Parameters
| Parameter | Type | Description |
|---|---|---|
planner | action_planner | Action planner to show in stalker stats when debugging is enabled. |
Returns
void
detach_vehicle()
detach_vehicle(force: boolean): void;Detach actor from the current vehicle or holder.
Parameters
| Parameter | Type | Description |
|---|---|---|
force | boolean | Whether detach should be forced. |
Returns
void
Since
OpenXRay 2015-06-16, 0fe21c14
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
detail_path_type()
detail_path_type(): TXR_detail_path_type;Get current detail path type used by the object's movement manager.
Returns
Detail path type id.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::detail_path_type.
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects log an engine script error and return move.line. In the verified xray source, the wrapper also returns move.line for stalkers instead of reading the current movement manager value.
direction()
direction(): vector;Get object facing direction.
Returns
Direction vector.
Remarks
Returns the current engine transform direction. For AI-facing goals, prefer sight or movement APIs.
disable_anomaly()
disable_anomaly(): void;Disable this anomaly object.
Returns
void
Remarks
Requires this object to be a custom zone. Other object types log a script error and return a default value or do nothing.
disable_hit_marks()
Call Signature
disable_hit_marks(): boolean;Returns
boolean
Whether hit marks are disabled.
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
Call Signature
disable_hit_marks(value: boolean): void;Enable or disable hit mark suppression.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether hit marks should be disabled. |
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
disable_info_portion()
disable_info_portion(info_portion: string): boolean;Remove an info portion from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
info_portion | string | Info portion id. |
Returns
boolean
Whether the info portion was removed.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
disable_inv_upgrade()
disable_inv_upgrade(): void;Disable inventory upgrades for this object.
Returns
void
disable_show_hide_sounds()
disable_show_hide_sounds(value: boolean): void;Enable or disable weapon show, hide and reload sounds for this inventory owner.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether those sounds should play. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
disable_talk()
disable_talk(): void;Disable actor dialog with this object.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
disable_trade()
disable_trade(): void;Disable trade with this object.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
dont_has_info()
dont_has_info(info_portion: string): boolean;Check that this object does not have an info portion.
Parameters
| Parameter | Type | Description |
|---|---|---|
info_portion | string | Info portion id. |
Returns
boolean
Whether the info portion is absent.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
drop_item()
drop_item(item: game_object): void;Drop item from inventory.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | game_object | Game object to drop. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
drop_item_and_teleport()
drop_item_and_teleport(item: game_object, position: vector): void;Drop an item and teleport it to a position.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | game_object | Item to drop. |
position | vector | Target position. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
eat()
eat(item: game_object): void;Consume an inventory item.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | game_object | Item to eat or use. |
Returns
void
Remarks
Requires this object to be an eatable inventory item. Other object types log a script error and return a default value or do nothing.
enable_anomaly()
enable_anomaly(): void;Enable this anomaly zone.
Returns
void
Remarks
Requires this object to be a custom zone. Other object types log a script error and return a default value or do nothing.
enable_attachable_item()
enable_attachable_item(is_enabled: boolean): void;Method for inventory items to set them enabled / disabled for stalkers. As result, medkit or detector can be activated by stalker.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether item should be enabled for usage by owning object. |
Returns
void
Remarks
Requires this object to be an attachable item. Other object types log a script error and return a default value or do nothing.
enable_inv_upgrade()
enable_inv_upgrade(): void;Enable inventory upgrades for this object.
Returns
void
enable_level_changer()
enable_level_changer(is_enabled: boolean): void;Switch client level changed enabled state.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether level changer should be enabled. |
Returns
void
Remarks
Requires this object to be a level changer. Other object types do nothing.
enable_memory_object()
enable_memory_object(object: game_object, is_enabled: boolean): void;Enable or disable memory tracking for an object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Object to update. |
is_enabled | boolean | Whether memory object is enabled. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
enable_night_vision()
enable_night_vision(is_enabled: boolean): void;Enable or disable night vision on actor equipment.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether night vision is enabled. |
Returns
void
Remarks
Requires this object to be a torch item. Other object types log a script error and return a default value or do nothing.
enable_talk()
enable_talk(): void;Enable actor talk interaction with this inventory owner.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
enable_torch()
enable_torch(is_enabled: boolean): void;Enable or disable torch.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether torch is enabled. |
Returns
void
Remarks
Requires this object to be a torch item. Other object types log a script error and return a default value or do nothing.
enable_trade()
enable_trade(): void;Enable actor trade interaction with this inventory owner.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
enable_vision()
enable_vision(value: boolean): void;Enable or disable visual memory for this monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether vision is enabled. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
explode()
explode(id: number): void;Trigger object explosion.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Explosion id or initiator id. |
Returns
void
Remarks
Requires an explosive object or object with an explosive component. The id is passed to native explosion logic and is not validated by TypeScript.
external_sound_start()
external_sound_start(sound: string): void;Start an external object sound.
Parameters
| Parameter | Type | Description |
|---|---|---|
sound | string | Sound name. |
Returns
void
Remarks
Requires this object to be a trader-capable inventory owner. Other object types log a script error and return a default value or do nothing.
external_sound_stop()
external_sound_stop(): void;Stop the current external trader sound.
Returns
void
Remarks
Requires this object to be a trader-capable inventory owner. Other object types log a script error and return a default value or do nothing.
extrapolate_length()
Call Signature
extrapolate_length(): number;Returns
number
Movement path extrapolation length.
Call Signature
extrapolate_length(value: number): void;Set movement path extrapolation length.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Extrapolation length. |
Returns
void
fake_death_fall_down()
fake_death_fall_down(): boolean;Returns
boolean
Whether this zombie should fall down in fake-death state.
Remarks
Requires this object to be a zombie. Other object types log a script error and return a default value or do nothing.
fake_death_stand_up()
fake_death_stand_up(): void;Force a fake-dead monster to stand up.
Returns
void
Remarks
Requires this object to be a zombie. Other object types log a script error and return a default value or do nothing.
find_best_cover()
find_best_cover(position: vector): cover_point;Find the best cover from a threat position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Threat position. |
Returns
Cover point.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
force_set_goodwill()
force_set_goodwill(goodwill: number, to_object: game_object): void;Set goodwill toward another object without applying a delta.
Parameters
| Parameter | Type | Description |
|---|---|---|
goodwill | number | Goodwill value. |
to_object | game_object | Target object. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
force_set_position()
force_set_position(position: vector, activate: boolean): void;Move object with a physics shell to a position immediately.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Target position. |
activate | boolean | Whether to activate the physics shell before moving it. |
Returns
void
Since
OpenXRay 2015-07-07, 6e703b4c
Remarks
Requires this object to be a physics-shell holder. Objects without a shell return or log a script error. When activate is true, the engine activates the physics shell before forcing the transform.
force_stand_sleep_animation()
force_stand_sleep_animation(index: number): void;Force a bloodsucker stand/sleep animation variant.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | Animation index. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
force_visibility_state()
force_visibility_state(state: TXR_bloodsucker_visibility_state): void;For bloodsuckers specifically set current visibility state.
Parameters
| Parameter | Type |
|---|---|
state | TXR_bloodsucker_visibility_state |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
fov()
fov(): number;Returns
number
Current object field of view.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
game_vertex_id()
game_vertex_id(): number;Get current game graph vertex id.
Returns
number
Game vertex id.
general_goodwill()
general_goodwill(target: game_object): number;Return formula: personal_goodwill + reputation_goodwill + rank_goodwill + community_goodwill + community_to_community.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | game_object | Target client object. |
Returns
number
Goodwill level from object to target.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_actor_jump_speed()
get_actor_jump_speed(): number;Get actor jump speed.
Returns
number
Actor jump speed.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_actor_max_walk_weight()
get_actor_max_walk_weight(): number;Get actor maximum walk weight.
Returns
number
Actor maximum walk weight.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_actor_max_weight()
get_actor_max_weight(): number;Get actor maximum carry weight.
Returns
number
Actor maximum carry weight.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_actor_relation_flags()
get_actor_relation_flags(): flags32;Returns
Actor relation flags stored for this character.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_actor_run_coef()
get_actor_run_coef(): number;Get actor run speed coefficient.
Returns
number
Actor run speed coefficient.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_actor_runback_coef()
get_actor_runback_coef(): number;Get actor backward run speed coefficient.
Returns
number
Actor backward run speed coefficient.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_actor_sprint_koef()
get_actor_sprint_koef(): number;Get actor sprint speed coefficient.
Returns
number
Actor sprint speed coefficient.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_additional_max_walk_weight()
get_additional_max_walk_weight(): number;Get additional maximum walk weight.
Returns
number
Additional maximum walk weight.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_additional_max_weight()
get_additional_max_weight(): number;Get additional maximum carry weight.
Returns
number
Additional maximum carry weight.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_ammo_count_for_type()
get_ammo_count_for_type(type: number): number;Get inventory ammo count for a weapon ammo type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | number | Ammo type index. |
Returns
number
Matching ammo count.
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_ammo_in_magazine()
get_ammo_in_magazine(): number;Returns
number
Ammo count currently loaded in this weapon magazine.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
get_ammo_total()
get_ammo_total(): number;Get total suitable ammo count.
Returns
number
Ammo count.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_ammo_type()
get_ammo_type(): number;Get active ammo type.
Returns
number
Ammo type id.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
get_anomaly_power()
get_anomaly_power(): number;Returns
number
Current anomaly power.
Remarks
Requires this object to be a custom zone. Other object types log a script error and return a default value or do nothing.
get_artefact()
get_artefact(): Nullable<CArtefact>;Cast this object to an artefact.
Returns
Nullable<CArtefact>
Artefact object, or null when this object is not an artefact.
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
get_artefact_bleeding()
get_artefact_bleeding(): number;Returns
number
Artefact bleeding restore rate.
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
get_artefact_health()
get_artefact_health(): number;Returns
number
Artefact health restore rate.
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
get_artefact_power()
get_artefact_power(): number;Returns
number
Artefact power restore rate.
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
get_artefact_radiation()
get_artefact_radiation(): number;Returns
number
Artefact radiation restore rate.
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
get_artefact_satiety()
get_artefact_satiety(): number;Returns
number
Artefact satiety restore rate.
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
get_attached_vehicle()
get_attached_vehicle(): Nullable<game_object>;Get vehicle currently attached to the actor.
Returns
Nullable<game_object>
Vehicle currently attached to the actor, or null.
Since
OpenXRay 2015-07-07, 6e703b4c
Remarks
Requires this object to be the actor. Other object types log a script error or return null.
get_bone_id()
get_bone_id(bone: string): number;Get model bone id by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
bone | string | Bone name. |
Returns
number
Bone id.
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
get_campfire()
get_campfire(): Nullable<CZoneCampfire>;Cast this object to a campfire.
Returns
Nullable<CZoneCampfire>
Campfire object, or null when this object is not a campfire.
Remarks
Requires this object to be a campfire zone. Other object types log a script error.
get_car()
get_car(): CCar;Returns
This object as a car.
Remarks
Requires this object to be a car. Other object types log a script error.
get_corpse()
get_corpse(): Nullable<game_object>;Get current corpse selected by this monster.
Returns
Nullable<game_object>
Corpse selected by this monster, or null.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::GetCorpse.
Remarks
Requires this object to be a CCustomMonster. The binding ignores destroyed corpse objects and returns null when no usable corpse is selected.
get_current_direction()
get_current_direction(): vector;Get current movement direction.
Returns
Direction vector.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
get_current_holder()
get_current_holder(): Nullable<holder>;Returns
Nullable<holder>
Current holder used by the actor, or null.
get_current_outfit()
get_current_outfit(): Nullable<game_object>;Get currently equipped outfit.
Returns
Nullable<game_object>
Currently equipped outfit, or null when none is equipped.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::GetCurrentOutfit.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return null.
get_current_outfit_protection()
get_current_outfit_protection(hit_type: number): number;Get protection value from the currently equipped outfit.
Parameters
| Parameter | Type | Description |
|---|---|---|
hit_type | number | Hit type id. |
Returns
number
Protection value.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_current_point_index()
get_current_point_index(): number;Returns
number
Current patrol path point index.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
get_dest_smart_cover()
get_dest_smart_cover(): cover_point;Get destination smart cover.
Returns
Cover point.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
get_dest_smart_cover_name()
get_dest_smart_cover_name(): Nullable<string>;Get destination smart cover name.
Returns
Nullable<string>
Cover name, or null.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
get_enemy()
get_enemy(): Nullable<game_object>;Get current enemy selected by this monster.
Returns
Nullable<game_object>
Current enemy object, or null.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::GetEnemy.
Remarks
Requires this object to be an alive CCustomMonster. The binding ignores destroyed enemy objects and returns null when the monster is dead, has no current enemy, or is not a monster.
get_enemy_strength()
get_enemy_strength(): number;Returns
number
Current enemy strength estimate.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
get_force_anti_aim()
get_force_anti_aim(): boolean;Returns
boolean
Whether this monster is forced to use anti-aim behavior.
Remarks
Requires this object to be a base monster. Other object types log a script error and return a default value or do nothing.
get_hanging_lamp()
get_hanging_lamp(): hanging_lamp;Cast this object to a hanging lamp.
Returns
Hanging lamp object.
Remarks
Requires this object to be a hanging lamp. Other object types log a script error.
get_helicopter()
get_helicopter(): CHelicopter;Returns
This object as a helicopter.
Remarks
Requires this object to be a helicopter. Other object types log a script error.
get_holder_class()
get_holder_class(): holder;Cast this object to a holder.
Returns
Holder object.
Remarks
Requires this object to be a holder object. Other object types log a script error or return null.
get_info_time()
get_info_time(info: string): CTime;Get time when an info portion was received.
Parameters
| Parameter | Type | Description |
|---|---|---|
info | string | Info portion id. |
Returns
Game time.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_luminocity()
get_luminocity(): number;Get object luminocity.
Returns
number
Object luminocity.
Since
OpenXRay 2015-07-07, 6e703b4c
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
get_luminocity_hemi()
get_luminocity_hemi(): number;Get object hemisphere luminocity.
Returns
number
Hemispheric luminocity for this object.
Since
OpenXRay 2015-07-07, 6e703b4c
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
get_main_weapon_type()
get_main_weapon_type(): number;Get weapon main type.
Returns
number
Main weapon type id.
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
get_max_uses()
get_max_uses(): number;Get maximum item uses.
Returns
number
Maximum uses.
Since
OpenXRay 2015-08-27, 7840b0fe
Remarks
Requires this object to be an eatable inventory item. Other object types log a script error and return a default value or do nothing.
get_monster_hit_info()
get_monster_hit_info(): MonsterHitInfo;Get latest monster hit information.
Returns
Monster hit info.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
get_movement_speed()
get_movement_speed(): vector;Returns
Current movement speed vector.
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
get_physics_object()
get_physics_object(): Nullable<CPhysicObject>;Get physics object wrapper.
Returns
Nullable<CPhysicObject>
Physics object, or null when this object is not a physics object.
Remarks
Requires this object to own a physics shell or physics holder. Other object types return null or do nothing.
get_physics_shell()
get_physics_shell(): Nullable<physics_shell>;Returns
Nullable<physics_shell>
Physics shell for this object, or null.
Remarks
Requires this object to own a physics shell or physics holder. Other object types return null or do nothing.
get_remaining_uses()
get_remaining_uses(): number;Get remaining item uses.
Returns
number
Remaining uses.
Since
OpenXRay 2015-08-27, 7840b0fe
Remarks
Requires this object to be an eatable inventory item. Other object types log a script error and return a default value or do nothing.
get_restrictor_type()
get_restrictor_type(): 255 | TXR_restrictor_type;Returns
255 | TXR_restrictor_type
Space-restrictor category, or 255 when this object is not a space restrictor.
Remarks
Requires this object to be a space restrictor. Other object types return 255.
get_script()
get_script(): boolean;Returns
boolean
Whether object is controlled by lua script.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
get_script_name()
get_script_name(): string;Returns
string
Name of lua script controlling monster object.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
get_smart_cover_description()
get_smart_cover_description(): string;Get current smart cover description.
Returns
string
Smart cover description.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
get_sound_info()
get_sound_info(): SoundInfo;Returns
Last known monster sound info.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
get_spatial_type()
get_spatial_type(): number;Get object spatial type flags.
Returns
number
Spatial registration type mask.
Since
OpenXRay 2016-05-31, 15edbfd9
Remarks
Requires this object to be registered in spatial object logic. Other object types can log an engine error or return a default value.
get_start_dialog()
get_start_dialog(): void;Get current start dialog id.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_state()
get_state(): number;Returns
number
Current HUD item state.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
get_task()
get_task(task_id: string, only_in_process: boolean): Nullable<CGameTask>;Get task by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
task_id | string | Task id. |
only_in_process | boolean | Whether to return only active tasks. |
Returns
Nullable<CGameTask>
Task object, or null.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_task_state()
get_task_state(task_id: string): TXR_TaskState;Get task state by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
task_id | string | Task id. |
Returns
Task state id, or task.task_dummy when this object is not an inventory owner or the task is missing.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_total_weight()
get_total_weight(): number;Get actor total carried weight.
Returns
number
Total inventory weight for this inventory owner.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
get_visibility_state()
get_visibility_state(): number;Returns
number
Current bloodsucker visibility state.
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
get_visual_name()
get_visual_name<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Visual name assigned to this object.
get_weapon_substate()
get_weapon_substate(): number;Get weapon substate.
Returns
number
Current weapon substate.
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
get_weapon_type()
get_weapon_type(): number;Get weapon type.
Returns
number
Weapon type id.
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
give_game_news()
give_game_news(
title: string,
text: string,
icon_texture: string,
delay: number,
show_time: number,
type?: Nillable<number>): void;Display in-game UI notification.
Parameters
| Parameter | Type | Description |
|---|---|---|
title | string | Notification title. |
text | string | Notification text. |
icon_texture | string | Notification icon texture. |
delay | number | Delay before show notification. |
show_time | number | Time to show notification before hiding it. |
type? | Nillable<number> | Type of the notification (eNews = 0, eTalk = 1). |
Returns
void
Since
OpenXRay 2023-04-17, a9d0a11a, PR #392
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
give_info_portion()
give_info_portion(info_portion: string): boolean;Add an info portion to this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
info_portion | string | Info portion id. |
Returns
boolean
Whether the info portion was added.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
give_money()
give_money(amount: number): void;Add money to this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | number | Money amount. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
give_talk_message()
give_talk_message(
title: string,
text: string,
icon: string): void;Show a talk message.
Parameters
| Parameter | Type | Description |
|---|---|---|
title | string | Message title. |
text | string | Message text. |
icon | string | Message icon. |
Returns
void
Since
OpenXRay 2019-06-27, 1ea203d0, PR #392
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
give_talk_message2()
give_talk_message2(
title: string,
text: string,
icon_texture_name: string,
selector: string): void;Show talk dialog message with icon.
Parameters
| Parameter | Type | Description |
|---|---|---|
title | string | Title of the message. |
text | string | Text of the message. |
icon_texture_name | string | Icon to display in message image. |
selector | string | Path in form XML to message template. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
give_task()
give_task(
task: CGameTask,
time_to_complete: number,
check_existing: boolean,
timer_ttl: number): void;Give game task for an object, usually it is actor object.
Parameters
| Parameter | Type | Description |
|---|---|---|
task | CGameTask | Task object to give. |
time_to_complete | number | Time allowed to complete the task. |
check_existing | boolean | Whether an existing task should be reused. |
timer_ttl | number | Timer lifetime. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
goodwill()
goodwill(target: game_object): number;Returns level of goodwill stored for an object. No strict formulas, just get actual value.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | game_object | Target client object. |
Returns
number
Goodwill level to target object.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
group()
group(): number;Get object group id.
Returns
number
Group id.
group_throw_time_interval()
Call Signature
group_throw_time_interval(): number;Returns
number
Current delay between group grenade throws.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
group_throw_time_interval(interval: number): void;Set delay between group grenade throws.
Parameters
| Parameter | Type | Description |
|---|---|---|
interval | number | Throw interval. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
has_ammo_type()
has_ammo_type(type: string): boolean;Check whether weapon supports an ammo type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Ammo section. |
Returns
boolean
Whether ammo type is supported.
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
has_info()
has_info(info_portion: string): boolean;Check whether this object has an info portion.
Parameters
| Parameter | Type | Description |
|---|---|---|
info_portion | string | Info portion id. |
Returns
boolean
Whether the info portion is present.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
has_upgrade()
has_upgrade(upgrade_section: string): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_section | string | Section of upgrade to check. |
Returns
boolean
Whether upgrade is installed.
has_upgrade_group()
has_upgrade_group(upgrade_group_section: string): boolean;Check whether an upgrade group is installed.
Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_group_section | string | Section of upgrade group to check. |
Returns
boolean
Whether upgrade group is installed.
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
has_upgrade_group_by_upgrade_id()
has_upgrade_group_by_upgrade_id(upgrade_section: string): boolean;Check whether an upgrade's parent group is installed.
Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_section | string | Section of upgrade to check parent group. |
Returns
boolean
Whether upgrade parent group is installed.
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
head_orientation()
head_orientation(): vector;Returns
Current head orientation for this creature.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
hide_weapon()
hide_weapon(): void;Hide the actor weapon model.
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
hit()
hit(hit: hit): void;Apply a hit descriptor to this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
hit | hit | Hit descriptor. |
Returns
void
id()
id(): number;Get engine object id.
Returns
number
Runtime object id.
idle_max_time()
Call Signature
idle_max_time(): number;Get maximum idle time.
Returns
number
Idle time in milliseconds.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
idle_max_time(time: number): void;Set maximum idle time.
Parameters
| Parameter | Type | Description |
|---|---|---|
time | number | Idle time in milliseconds. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
idle_min_time()
Call Signature
idle_min_time(): number;Returns
number
Minimum idle time for smart-cover animation.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
idle_min_time(value: number): void;Set minimum idle time for smart-cover animation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Idle time in seconds. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
ignore_monster_threshold()
Call Signature
ignore_monster_threshold(): number;Returns
number
Monster ignore threshold used by this stalker's enemy memory.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
ignore_monster_threshold(threshold: number): void;Set monster ignore threshold used by this stalker's enemy memory.
Parameters
| Parameter | Type | Description |
|---|---|---|
threshold | number | Ignore threshold, clamped by the engine. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
in_current_loophole_fov()
in_current_loophole_fov(position: vector): boolean;Check whether a position is inside the current loophole field of view.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Position to test. |
Returns
boolean
Whether position is inside field of view.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
in_current_loophole_range()
in_current_loophole_range(position: vector): boolean;Check whether a point is in range of the current smart-cover loophole.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Point to test. |
Returns
boolean
Whether the point is in current loophole range.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
in_loophole_fov()
in_loophole_fov(
cover_name: string,
loophole_name: string,
position: vector): boolean;Check whether a position is inside a named loophole field of view.
Parameters
| Parameter | Type | Description |
|---|---|---|
cover_name | string | Smart cover name. |
loophole_name | string | Loophole name. |
position | vector | Position to test. |
Returns
boolean
Whether position is inside field of view.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
in_loophole_range()
in_loophole_range(
cover_id: string,
loophole_id: string,
position: vector): boolean;Check whether a point is in range of a smart-cover loophole.
Parameters
| Parameter | Type | Description |
|---|---|---|
cover_id | string | Smart-cover id. |
loophole_id | string | Loophole id. |
position | vector | Point to test. |
Returns
boolean
Whether the point is in loophole range.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
in_restrictions()
in_restrictions(): string;Returns
string
Active input restriction names.
Remarks
Requires an object with AI path restriction support.
in_smart_cover()
in_smart_cover(): boolean;Returns
boolean
Whether this stalker is currently in a smart cover.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
inactualize_game_path()
inactualize_game_path(): void;Mark game path cache as outdated.
Returns
void
inactualize_level_path()
inactualize_level_path(): void;Mark level path cache as outdated.
Returns
void
inactualize_patrol_path()
inactualize_patrol_path(): void;Mark patrol path cache as outdated.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
info_add()
info_add(text: string): void;Available only in debug mode. Sets information for game object for debug.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
void
Remarks
Intended for engine/debug overlays. Release builds may ignore it or compile out the visible effect.
info_clear()
info_clear(): void;Reset debugging information about object. Available only for debug builds.
Returns
void
inside()
Call Signature
inside(position: vector): boolean;Check whether a position is inside this space restrictor.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Position to test. |
Returns
boolean
Whether the position is inside.
Call Signature
inside(position: vector, epsilon: number): boolean;Check whether a position is inside this space restrictor.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Position to test. |
epsilon | number | Extra tolerance. |
Returns
boolean
Whether the position is inside.
install_upgrade()
install_upgrade(upgrade_section: string): boolean;Install an upgrade section.
Parameters
| Parameter | Type | Description |
|---|---|---|
upgrade_section | string | Section of upgrade to install. |
Returns
boolean
Whether upgrade is installed successfully or not.
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
inv_box_can_take()
inv_box_can_take(value: boolean): boolean;Set whether items can be taken from this inventory box.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether taking items is allowed. |
Returns
boolean
New take permission state.
Remarks
Requires this object to be an inventory box. Other object types log a script error and return a default value or do nothing.
inv_box_can_take_status()
inv_box_can_take_status(): boolean;Returns
boolean
Whether items can be taken from this inventory box.
Remarks
Requires this object to be an inventory box. Other object types log a script error and return a default value or do nothing.
inv_box_closed()
inv_box_closed(is_closed: boolean, reason: string): boolean;Close or open this inventory box.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_closed | boolean | Whether the box is closed. |
reason | string | Script reason stored for the close state. |
Returns
boolean
Whether the close state was applied.
Remarks
Requires this object to be an inventory box. Other object types log a script error and return a default value or do nothing.
inv_box_closed_status()
inv_box_closed_status(): boolean;Returns
boolean
Whether this inventory box is closed.
Remarks
Requires this object to be an inventory box. Other object types log a script error and return a default value or do nothing.
inventory_for_each()
inventory_for_each(cb: (this: void) => void): void;Iterate inventory items.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (this: void) => void | Callback called for each item. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
invulnerable()
Call Signature
invulnerable(): boolean;Returns
boolean
Whether this monster ignores damage.
Call Signature
invulnerable(value: boolean): void;Enable or disable monster damage immunity.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the monster should be invulnerable. |
Returns
void
is_active_task()
is_active_task(task: CGameTask): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
task | CGameTask | Task object to check. |
Returns
boolean
Whether this task is active.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
is_actor()
is_actor(): boolean;Check whether this object is the actor.
Returns
boolean
Whether this object is the actor.
Since
OpenXRay 2017-08-15, 565b39e5
is_ammo()
is_ammo(): boolean;Check whether this object is ammo.
Returns
boolean
Whether this object is ammo.
Since
OpenXRay 2017-08-15, 565b39e5
is_anomaly()
is_anomaly(): boolean;Check whether this object is an anomaly.
Returns
boolean
Whether this object is an anomaly zone.
Since
OpenXRay 2017-08-15, 565b39e5
is_artefact()
is_artefact(): boolean;Check whether this object is an artefact.
Returns
boolean
Whether this object is an artefact.
Since
OpenXRay 2017-08-15, 565b39e5
is_body_turning()
is_body_turning(): boolean;Returns
boolean
Whether the object is currently turning its body.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
is_custom_monster()
is_custom_monster(): boolean;Check whether this object is a custom monster.
Returns
boolean
Whether this object is a custom monster.
Since
OpenXRay 2017-08-15, 565b39e5
is_door_blocked_by_npc()
is_door_blocked_by_npc(): boolean;Check whether a door is blocked by an NPC.
Returns
boolean
Whether a door is blocked.
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
is_door_locked_for_npc()
is_door_locked_for_npc(): boolean;Returns
boolean
Whether this door is locked for NPC navigation.
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
is_entity_alive()
is_entity_alive(): boolean;Check whether this object is an alive entity.
Returns
boolean
Whether this object is an alive entity.
Since
OpenXRay 2017-08-15, 565b39e5
is_grenade_launcher()
is_grenade_launcher(): boolean;Check whether this object is a grenade launcher addon.
Returns
boolean
Whether this object is a grenade launcher addon.
Since
OpenXRay 2017-08-15, 565b39e5
is_hud_item()
is_hud_item(): boolean;Check whether this object is a HUD item.
Returns
boolean
Whether this object is a HUD item.
Since
OpenXRay 2017-08-15, 565b39e5
is_inv_box_empty()
is_inv_box_empty(): boolean;Returns
boolean
Whether this inventory box has no items.
Remarks
Requires this object to be an inventory box. Other object types log a script error and return a default value or do nothing.
is_inv_upgrade_enabled()
is_inv_upgrade_enabled(): boolean;Returns
boolean
Whether inventory upgrade interaction is enabled.
is_inventory_box()
is_inventory_box(): boolean;Check whether this object is an inventory box.
Returns
boolean
Whether this object is an inventory box.
Since
OpenXRay 2017-08-15, 565b39e5
is_inventory_item()
is_inventory_item(): boolean;Check whether this object is an inventory item.
Returns
boolean
Whether this object is an inventory item.
Since
OpenXRay 2017-08-15, 565b39e5
is_inventory_owner()
is_inventory_owner(): boolean;Check whether this object is an inventory owner.
Returns
boolean
Whether this object is an inventory owner.
Since
OpenXRay 2017-08-15, 565b39e5
is_level_changer_enabled()
is_level_changer_enabled(): boolean;Returns
boolean
Whether this level changer is enabled.
Remarks
Requires this object to be a level changer. Other object types do nothing.
is_monster()
is_monster(): boolean;Check whether this object is a monster.
Returns
boolean
Whether this object is a monster.
Since
OpenXRay 2017-08-15, 565b39e5
is_on_belt()
is_on_belt(object: game_object): boolean;Check whether an item is on belt.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Item object. |
Returns
boolean
Whether item is on belt.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
is_outfit()
is_outfit(): boolean;Check whether this object is an outfit.
Returns
boolean
Whether this object is an outfit.
Since
OpenXRay 2017-08-15, 565b39e5
is_scope()
is_scope(): boolean;Check whether this object is a scope addon.
Returns
boolean
Whether this object is a scope addon.
Since
OpenXRay 2017-08-15, 565b39e5
is_silencer()
is_silencer(): boolean;Check whether this object is a silencer addon.
Returns
boolean
Whether this object is a silencer addon.
Since
OpenXRay 2017-08-15, 565b39e5
is_space_restrictor()
is_space_restrictor(): boolean;Check whether this object is a space restrictor.
Returns
boolean
Whether this object is a space restrictor.
Since
OpenXRay 2017-08-15, 565b39e5
is_stalker()
is_stalker(): boolean;Check whether this object is a stalker.
Returns
boolean
Whether this object is a stalker.
Since
OpenXRay 2017-08-15, 565b39e5
is_talk_enabled()
is_talk_enabled(): boolean;Check whether actor dialog is enabled.
Returns
boolean
Whether talking is enabled.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
is_talking()
is_talking(): boolean;Returns
boolean
Whether object is currently talking with actor and talk dialog is active.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
is_there_items_to_pickup()
is_there_items_to_pickup(): boolean;Returns
boolean
Whether nearby items are available for pickup.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
is_trade_enabled()
is_trade_enabled(): boolean;Returns
boolean
Whether trade interaction is enabled.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
is_trader()
is_trader(): boolean;Check whether this object is a trader.
Returns
boolean
Whether this object is a trader.
Since
OpenXRay 2017-08-15, 565b39e5
is_weapon()
is_weapon(): boolean;Check whether this object is a weapon.
Returns
boolean
Whether this object is a weapon.
Since
OpenXRay 2017-08-15, 565b39e5
is_weapon_gl()
is_weapon_gl(): boolean;Check whether this object is a grenade-launcher weapon.
Returns
boolean
Whether this object is a weapon with grenade launcher support.
Since
OpenXRay 2017-08-15, 565b39e5
is_weapon_going_to_be_strapped()
is_weapon_going_to_be_strapped(weapon: Nillable<game_object>): boolean;Check whether a weapon is being strapped.
Parameters
| Parameter | Type | Description |
|---|---|---|
weapon | Nillable<game_object> | Weapon to check. |
Returns
boolean
Whether weapon is being strapped.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
is_weapon_magazined()
is_weapon_magazined(): boolean;Check whether this object is a magazined weapon.
Returns
boolean
Whether this object is a magazined weapon.
Since
OpenXRay 2017-08-15, 565b39e5
item_in_slot()
item_in_slot(slot: number): Nullable<game_object>;Get item in inventory slot.
Parameters
| Parameter | Type | Description |
|---|---|---|
slot | number | Inventory slot id. |
Returns
Nullable<game_object>
Item in slot, or null.
Source
src/xrGame/script_game_object_inventory_owner.cpp, CScriptGameObject::item_in_slot.
Remarks
Requires this object to be a CInventoryOwner. Compatibility mode can shift slot ids by one for legacy minus-one slot ordering. Empty slots and non-inventory owners return null.
item_on_belt()
item_on_belt(slot: number): Nullable<game_object>;Get item on belt by belt container index.
Parameters
| Parameter | Type | Description |
|---|---|---|
slot | number | Belt container index. |
Returns
Nullable<game_object>
Item on belt, or null.
Since
OpenXRay 2015-10-07, 658f68a2
Source
src/xrGame/script_game_object_inventory_owner.cpp, CScriptGameObject::ItemOnBelt.
Remarks
Requires this object to be a CInventoryOwner. Empty belt cells, non-inventory owners, and invalid belt indices return null after logging a script error where applicable.
iterate_feel_touch()
iterate_feel_touch(callback: (this: void, object_id: number) => void): void;Iterate object ids from this object's Feel::Touch contact list.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (this: void, object_id: number) => void | Callback invoked for each touched object id. |
Returns
void
Since
OpenXRay 2016-05-31, 15edbfd9
Remarks
Requires this object to implement Feel::Touch. Objects without touch sensing do nothing. The callback receives each touched object's server id, not a game_object wrapper.
iterate_installed_upgrades()
iterate_installed_upgrades(callback: (upgrade_section: string, object: game_object) => void): void;Iterate over all item upgrades.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (upgrade_section: string, object: game_object) => void | Callback to call on each iteration to check installed upgrades. |
Returns
void
Since
OpenXRay 2023-10-19, a6016f10, PR #1463
iterate_inventory()
iterate_inventory(cb: (this: void, owner: game_object, item: game_object) => boolean | void, object: game_object): void;Iterate over game object inventory. Runs supplied callback for each item in inventory of the object. If callback returns true, the cycle breaks.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (this: void, owner: game_object, item: game_object) => boolean | void | Callback to run for each item. |
object | game_object | Target object to run callback for (actually unused by the engine). |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
iterate_inventory_box()
iterate_inventory_box(cb: (this: void, box: game_object, item: game_object) => void, object: game_object): void;Iterate items inside an inventory box.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (this: void, box: game_object, item: game_object) => void | Callback called for each box item. |
object | game_object | Inventory box object. |
Returns
void
Remarks
Requires this object to be an inventory box. Other object types log a script error and return a default value or do nothing.
jump()
jump(target: vector, factor: number): void;Force this monster to jump toward a point.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | vector | Jump target. |
factor | number | Jump tuning factor used by the monster controller. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
kill()
kill(object: game_object): void;Kill a target object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Target object. |
Returns
void
Remarks
Requires this object to be an alive entity. The argument is recorded as the target affected by the kill call.
level_vertex_id()
level_vertex_id(): number;Get current level vertex id.
Returns
number
Level vertex id.
location_on_path()
location_on_path(distance: number, position: vector): number;Sample a future position on the current movement path.
Parameters
| Parameter | Type | Description |
|---|---|---|
distance | number | Distance along the path. |
position | vector | Output position. |
Returns
number
Level vertex id for the sampled position.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
lock_door_for_npc()
lock_door_for_npc(): void;Lock this door for NPC navigation.
Returns
void
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
lookout_max_time()
Call Signature
lookout_max_time(): number;Get maximum lookout time.
Returns
number
Lookout time in milliseconds.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
lookout_max_time(value: number): void;Set maximum lookout time.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Lookout time in milliseconds. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
lookout_min_time()
Call Signature
lookout_min_time(): number;Returns
number
Minimum time spent looking out from smart cover.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
lookout_min_time(time: number): void;Set minimum time spent looking out from smart cover.
Parameters
| Parameter | Type | Description |
|---|---|---|
time | number | Lookout time in seconds. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
make_item_active()
make_item_active(item: game_object): void;Make an inventory item active.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | game_object | Item to activate. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
make_object_visible_somewhen()
make_object_visible_somewhen(object: game_object): void;Make another object temporarily visible to this object's memory.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Object to reveal. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
mark_item_dropped()
mark_item_dropped(object: game_object): void;Mark an inventory item as dropped.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Item object. |
Returns
void
marked_dropped()
marked_dropped(object: game_object): boolean;Check whether an item was marked as dropped by this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Item object. |
Returns
boolean
Whether the item is marked as dropped.
mass()
mass(): number;Returns
number
Physics mass of this object.
max_health()
max_health(): number;Returns
number
Maximum health for this entity.
max_ignore_monster_distance()
Call Signature
max_ignore_monster_distance(): number;Get maximum distance at which monsters can be ignored.
Returns
number
Distance.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
max_ignore_monster_distance(value: number): void;Set maximum distance at which monsters can be ignored.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Distance. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
memory_hit_objects()
memory_hit_objects(): LuaIterable<hit_memory_object>;Iterate native hit-memory records for this monster.
Returns
LuaIterable<hit_memory_object>
Iterable hit-memory records.
Source
src/xrGame/script_game_object_script3.cpp, memory_hit_objects binding with return_stl_iterator().
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. The binding returns a Lua iterator over the native xr_vector<MemorySpace::CHitObject> collection.
memory_position()
memory_position(object: game_object): vector;Get remembered position of another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Remembered object. |
Returns
Last remembered position.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
memory_sound_objects()
memory_sound_objects(): LuaIterable<sound_memory_object>;Iterate sound-memory records for this monster.
Returns
LuaIterable<sound_memory_object>
Iterable sound-memory records.
Source
src/xrGame/script_game_object_script3.cpp, memory_sound_objects binding with return_stl_iterator().
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. The binding returns a Lua iterator over the native xr_vector<MemorySpace::CSoundObject> collection.
memory_time()
memory_time(another: game_object): number;Get time since this object remembered another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
another | game_object | Object to query. |
Returns
number
Memory time.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
memory_visible_objects()
memory_visible_objects(): LuaIterable<visible_memory_object>;Get visible objects from memory.
Returns
LuaIterable<visible_memory_object>
Iterable visible memory objects.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
mental_state()
mental_state(): TXR_mental_state;Get current stalker mental state.
Returns
Current mental state.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::mental_state.
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects log an engine script error and return anim.danger.
money()
money(): number;Returns
number
Money owned by this inventory owner.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
motivation_action_manager()
motivation_action_manager(): action_planner;Returns
Motivation action planner for this object.
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
movement_enabled()
Call Signature
movement_enabled(): boolean;Returns
boolean
Whether movement is enabled for this inventory owner.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
Call Signature
movement_enabled(value: boolean): void;Enable or disable movement for this inventory owner.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether movement is enabled. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
movement_target_reached()
movement_target_reached(): boolean;Check whether current movement target is reached.
Returns
boolean
Whether movement target is reached.
movement_type()
movement_type(): TXR_movement_type;Get current stalker movement type.
Returns
Current movement type.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::movement_type.
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects log an engine script error and return move.stand.
name()
name(): string;Get runtime object name.
Returns
string
Object name.
night_vision_enabled()
night_vision_enabled(): boolean;Returns
boolean
Whether night vision is enabled on this torch item.
Remarks
Requires this object to be a torch item. Other object types log a script error and return a default value or do nothing.
not_yet_visible_objects()
not_yet_visible_objects(): LuaIterable<not_yet_visible_object>;Iterate visual-memory candidates that are being detected but are not visible yet.
Returns
LuaIterable<not_yet_visible_object>
Iterable pending-visibility records.
Source
src/xrGame/script_game_object_script3.cpp, not_yet_visible_objects binding with return_stl_iterator().
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. The binding returns a Lua iterator over the native visual memory manager collection. Use memory_visible_objects() for fully visible remembered objects.
object()
object(value: string | number): Nullable<game_object>;Get inventory object by index or name.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | number | Inventory index or item name. |
Returns
Nullable<game_object>
Matching inventory item, or null.
Source
src/xrGame/script_game_object_script2.cpp, object bindings.
Remarks
Requires this object to be a CInventoryOwner. Numeric lookup uses the engine inventory index, not a runtime object id. String lookup searches inventory item names. Both overloads return null when the item is missing or the inventory entry cannot be cast back to a game object.
object_count()
object_count(): number;Get inventory object count.
Returns
number
Inventory item count.
on_door_is_closed()
on_door_is_closed(): void;Notify this door that it has closed.
Returns
void
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
on_door_is_open()
on_door_is_open(): void;Notify this door that it has opened.
Returns
void
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
out_restrictions()
out_restrictions(): string;Returns
string
Current outgoing restriction list.
parent()
parent(): Nullable<game_object>;Get parent object.
Returns
Nullable<game_object>
Parent object, or null when no parent exists.
Source
src/xrGame/script_game_object_use.cpp, CScriptGameObject::Parent.
Remarks
Returns null when the object has no parent game object.
path_completed()
path_completed(): boolean;Check whether current path is complete.
Returns
boolean
Whether path was completed.
path_type()
path_type(): TXR_game_object_path;Get current movement path type.
Returns
Current movement path type.
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::path_type.
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects log an engine script error and return game_object.no_path.
patrol()
patrol(): Nullable<string>;Returns
Nullable<string>
Current patrol path name, or null when no patrol path is active.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
patrol_path_make_inactual()
patrol_path_make_inactual(): void;Mark the current patrol path as needing recalculation.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
phantom_set_enemy()
phantom_set_enemy(object: game_object): void;Set enemy target for this phantom.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Enemy object. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be a phantom. Other object types log a script error or do nothing.
play_cycle()
Call Signature
play_cycle(animation: string, mix_in: boolean): void;Play a model animation cycle.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
mix_in | boolean | Whether to blend with current animation. |
Returns
void
Call Signature
play_cycle(animation: string): void;Play a model animation cycle with default blending.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
Returns
void
play_hud_motion()
play_hud_motion(
motion: string,
mix_in: boolean,
state: number): number;Play a HUD animation if it exists.
Parameters
| Parameter | Type | Description |
|---|---|---|
motion | string | HUD motion name. |
mix_in | boolean | Whether to blend with the current animation. |
state | number | State to use for playback. |
Returns
number
Playback motion id, or 0 when no matching motion exists.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
play_sound()
play_sound(
sound_type: number,
max_start_time?: number,
min_start_time?: number,
max_stop_time?: number,
min_stop_time?: number,
id?: number): void;Play an NPC sound by internal sound type.
Parameters
| Parameter | Type | Description |
|---|---|---|
sound_type | number | Internal sound type. |
max_start_time? | number | Optional maximum start delay. |
min_start_time? | number | Optional minimum start delay. |
max_stop_time? | number | Optional maximum stop time. |
min_stop_time? | number | Optional minimum stop time. |
id? | number | Optional sound id. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
poltergeist_get_actor_ignore()
poltergeist_get_actor_ignore(): boolean;Returns
boolean
Whether this poltergeist ignores the actor.
Remarks
Requires this object to be a poltergeist. Other object types log a script error and return a default value or do nothing.
poltergeist_set_actor_ignore()
poltergeist_set_actor_ignore(value: boolean): void;Set whether this poltergeist ignores the actor.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether actor should be ignored. |
Returns
void
Remarks
Requires this object to be a poltergeist. Other object types log a script error and return a default value or do nothing.
position()
position(): vector;Get current world position.
Returns
Position vector.
profile_name()
profile_name(): string;Returns
string
Specific character profile name.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
range()
range(): number;Returns
number
Current vision or weapon range for this object.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
rank()
rank(): number;Returns
number
Character rank.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
register_door_for_npc()
register_door_for_npc(): void;Register this door as usable by NPC navigation.
Returns
void
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
register_in_combat()
register_in_combat(): void;Register this stalker in its squad combat registry.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
relation()
relation(object: game_object): TXR_relation;Get relation to another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Target object. |
Returns
Relation id.
release_stand_sleep_animation()
release_stand_sleep_animation(): void;Release forced standing sleep animation.
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
remove_all_restrictions()
remove_all_restrictions(): void;Clear all space restrictions from this object.
Returns
void
remove_danger()
remove_danger(object: danger_object): void;Remove a danger event from this stalker's danger memory.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | danger_object | Danger event to remove. |
Returns
void
Since
OpenXRay 2022-12-02, 48a5ff60, PR #1015
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects return without changing memory. Pass a danger object previously obtained from best_danger() or another engine danger-memory lookup.
remove_home()
remove_home(): void;Clear the monster home restriction.
Returns
void
Remarks
Requires a custom monster with home movement state. It does not remove smart-terrain ownership.
remove_memory_hit_object()
remove_memory_hit_object(object: hit_memory_object): void;Remove a hit-memory record from this stalker's memory manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | hit_memory_object | Hit-memory record to remove. |
Returns
void
Since
OpenXRay 2022-12-02, 48a5ff60, PR #1015
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects return without changing memory. Pass a record previously obtained from memory_hit_objects() or compatible engine memory lookup.
remove_memory_sound_object()
remove_memory_sound_object(object: sound_memory_object): void;Remove a sound-memory record from this stalker's memory manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | sound_memory_object | Sound-memory record to remove. |
Returns
void
Since
OpenXRay 2022-12-02, 48a5ff60, PR #1015
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects return without changing memory. Pass a record previously obtained from memory_sound_objects() or compatible engine memory lookup.
remove_memory_visible_object()
remove_memory_visible_object(object: visible_memory_object): void;Remove a visual-memory record from this stalker's memory manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | visible_memory_object | Visual-memory record to remove. |
Returns
void
Since
OpenXRay 2022-12-02, 48a5ff60, PR #1015
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects return without changing memory. Pass a record previously obtained from memory_visible_objects() or compatible engine memory lookup.
remove_restrictions()
remove_restrictions(out_restrictions: string, in_restrictions: string): void;Remove movement restrictions from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
out_restrictions | string | Out restriction names. |
in_restrictions | string | In restriction names. |
Returns
void
Remarks
Requires an object with AI path restriction support. Names must match restrictions previously added or configured for the object.
remove_sound()
remove_sound(sound_type: number): void;Stop and remove an NPC sound by internal sound type.
Parameters
| Parameter | Type | Description |
|---|---|---|
sound_type | number | Internal sound type. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
reset_action_queue()
reset_action_queue(): void;Clear queued entity actions.
Returns
void
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
reset_bone_protections()
reset_bone_protections(immunity_section: string, bones_section: string): void;Reset stalker bone protections from immunity and bones sections.
Parameters
| Parameter | Type | Description |
|---|---|---|
immunity_section | string | Immunity section name, or an empty string to use the model default. |
bones_section | string | Bones protection section name. |
Returns
void
Since
OpenXRay 2022-12-02, 5ba7bd86, PR #1016
Remarks
Requires this object to be a CAI_Stalker. Non-stalker objects log a script error and do nothing. The engine reads the provided config sections and updates the stalker's per-bone protections from the model user data.
restore_default_start_dialog()
restore_default_start_dialog(): void;Restore the default start dialog for this object.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
restore_ignore_monster_threshold()
restore_ignore_monster_threshold(): void;Restore default monster ignore threshold.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
restore_max_ignore_monster_distance()
restore_max_ignore_monster_distance(): void;Restore default monster-ignore distance.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
restore_sound_threshold()
restore_sound_threshold(): void;Restore default sound threshold.
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
restore_weapon()
restore_weapon(): void;Let the actor draw weapons again after a forced hide.
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
run_talk_dialog()
run_talk_dialog(object: game_object, disable_break: boolean): void;Start actor talk dialog with another inventory owner.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Dialog partner. |
disable_break | boolean | Whether the dialog cannot be interrupted. |
Returns
void
Since
OpenXRay 2023-04-17, 2b71746f
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
Throws
The engine asserts if the dialog partner is not an inventory owner.
safe_cover()
safe_cover(
position: vector,
radius: number,
min_distance: number): cover_point;Find a safe cover near a position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Search position. |
radius | number | Search radius. |
min_distance | number | Minimum distance from position. |
Returns
Cover point.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
script()
script(script_control: boolean, script_name: string): void;Enable or disable script control.
Parameters
| Parameter | Type | Description |
|---|---|---|
script_control | boolean | Whether script control is enabled. |
script_name | string | Script control name. |
Returns
void
Remarks
Requires this object to be a scripted entity. Other object types log a script error and return a default value or do nothing.
section()
section<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Config section name of this object.
see()
Call Signature
see(object: game_object): boolean;Check whether this object can see another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Object to test. |
Returns
boolean
Whether the object is visible.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
Call Signature
see(value: string): boolean;Check whether this object can see a named point or object.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | Name to test. |
Returns
boolean
Whether the target is visible.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
sell_condition()
Call Signature
sell_condition(ini_file: ini_file, section: string): void;Load sell condition factors from an ini section.
Parameters
| Parameter | Type | Description |
|---|---|---|
ini_file | ini_file | Source ini file. |
section | string | Section name. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
Call Signature
sell_condition(friend_factor: number, enemy_factor: number): void;Set sell condition factors directly.
Parameters
| Parameter | Type | Description |
|---|---|---|
friend_factor | number | Condition factor for friendly buyers. |
enemy_factor | number | Condition factor for hostile buyers. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set__force()
set__force(
force: vector,
magnitude: number,
impulse: number): void;Apply a physics force to this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
force | vector | Force vector. |
magnitude | number | Force magnitude. |
impulse | number | Impulse factor. |
Returns
void
Remarks
Requires this object to own a physics shell or physics holder. Other object types return null or do nothing.
set_active_task()
set_active_task(task: CGameTask): void;Mark a task as active.
Parameters
| Parameter | Type | Description |
|---|---|---|
task | CGameTask | Task to activate. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_actor_direction()
set_actor_direction(direction: number): void;Set actor yaw direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | number | Direction angle. |
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_jump_speed()
set_actor_jump_speed(speed: number): void;Set actor jump speed.
Parameters
| Parameter | Type | Description |
|---|---|---|
speed | number | Jump speed. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_max_walk_weight()
set_actor_max_walk_weight(weight: number): void;Set actor maximum walk weight.
Parameters
| Parameter | Type | Description |
|---|---|---|
weight | number | Maximum walk weight. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_max_weight()
set_actor_max_weight(weight: number): void;Set actor maximum carry weight.
Parameters
| Parameter | Type | Description |
|---|---|---|
weight | number | Maximum carry weight. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_position()
set_actor_position(position: vector): void;Move the actor to a position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | New actor position. |
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_relation_flags()
set_actor_relation_flags(value: flags32): void;Set actor relation flags for this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | flags32 | Relation flags. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_actor_run_coef()
set_actor_run_coef(coef: number): void;Set actor run speed coefficient.
Parameters
| Parameter | Type | Description |
|---|---|---|
coef | number | Run coefficient. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_runback_coef()
set_actor_runback_coef(coef: number): void;Set actor backward run speed coefficient.
Parameters
| Parameter | Type | Description |
|---|---|---|
coef | number | Backward run coefficient. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_actor_sprint_koef()
set_actor_sprint_koef(coef: number): void;Set actor sprint speed coefficient.
Parameters
| Parameter | Type | Description |
|---|---|---|
coef | number | Sprint coefficient. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_additional_max_walk_weight()
set_additional_max_walk_weight(weight: number): void;Set additional maximum walk weight.
Parameters
| Parameter | Type | Description |
|---|---|---|
weight | number | Additional walk weight. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_additional_max_weight()
set_additional_max_weight(weight: number): void;Set additional maximum carry weight.
Parameters
| Parameter | Type | Description |
|---|---|---|
weight | number | Additional carry weight. |
Returns
void
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
set_alien_control()
set_alien_control(is_enabled: boolean): void;Enable or disable bloodsucker alien control.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether alien control is active. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
set_ammo_elapsed()
set_ammo_elapsed(count: number): void;Set ammo count in current magazine.
Parameters
| Parameter | Type | Description |
|---|---|---|
count | number | Ammo count. |
Returns
void
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
set_ammo_type()
set_ammo_type(type: number): void;Set active ammo type for this weapon.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | number | Ammo type index. |
Returns
void
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
set_anomaly_power()
set_anomaly_power(power: number): void;Set anomaly power.
Parameters
| Parameter | Type | Description |
|---|---|---|
power | number | New anomaly power. |
Returns
void
Remarks
Requires this object to be a custom zone. Other object types log a script error and return a default value or do nothing.
set_artefact_bleeding()
set_artefact_bleeding(rate: number): void;Set artefact bleeding restore rate.
Parameters
| Parameter | Type | Description |
|---|---|---|
rate | number | Restore rate. |
Returns
void
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
set_artefact_health()
set_artefact_health(rate: number): void;Set artefact health restore rate.
Parameters
| Parameter | Type | Description |
|---|---|---|
rate | number | Restore rate. |
Returns
void
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
set_artefact_power()
set_artefact_power(rate: number): void;Set artefact power restore rate.
Parameters
| Parameter | Type | Description |
|---|---|---|
rate | number | Restore rate. |
Returns
void
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
set_artefact_radiation()
set_artefact_radiation(rate: number): void;Set artefact radiation restore rate.
Parameters
| Parameter | Type | Description |
|---|---|---|
rate | number | Restore rate. |
Returns
void
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
set_artefact_satiety()
set_artefact_satiety(rate: number): void;Set artefact satiety restore rate.
Parameters
| Parameter | Type | Description |
|---|---|---|
rate | number | Restore rate. |
Returns
void
Remarks
Requires this object to be an artefact. Other object types log a script error and return a default value or do nothing.
set_body_state()
set_body_state(state: TXR_body_state): void;Set target body state for stalker movement.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | TXR_body_state | Body state. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_bone_visible()
set_bone_visible(
name: string,
visible: boolean,
recursive: boolean): void;Set bone visibility on this object visual.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Bone name. |
visible | boolean | Whether the bone is visible. |
recursive | boolean | Whether child bones are affected. |
Returns
void
Since
OpenXRay 2015-07-07, 6e703b4c
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
set_callback()
Call Signature
set_callback(type: TXR_callback, cb: Nillable<never>): void;Clear one callback registration.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_callback | Callback type to clear. |
cb | Nillable<never> | Nullish value used to select the clear overload. |
Returns
void
Remarks
Uses the no-functor CScriptGameObject::SetCallback(type) overload, which clears the callback slot.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 0,
cb?: Nillable<(this: void) => void>,
object?: Nillable<T>): void;Fired when a trader starts a trade session.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 0 |
cb? | Nillable<(this: void) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ai/trader/ai_trader.cpp, CAI_Trader::OnStartTrade.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 1,
cb?: Nillable<(this: void) => void>,
object?: Nillable<T>): void;Fired when a trader stops a trade session.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 1 |
cb? | Nillable<(this: void) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ai/trader/ai_trader.cpp, CAI_Trader::OnStopTrade.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 2,
cb?: Nillable<(this: void, item: game_object, money_direction: boolean, money: number, partner: game_object) => void>,
object?: Nillable<T>): void;Fired when an actor-involved trade transfers an item and money.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 2 |
cb? | Nillable<(this: void, item: game_object, money_direction: boolean, money: number, partner: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/trade2.cpp, CTrade::TransferItem.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 3,
cb?: Nillable<(this: void, money_get: number, money_put: number) => void>,
object?: Nillable<T>): void;Fired when a trader performs the money part of a trade operation.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 3 |
cb? | Nillable<(this: void, money_get: number, money_put: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/trade.cpp, CTrade::OnPerformTrade.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 4,
cb?: Nillable<(this: void, zone: game_object, object: game_object) => void>,
object?: Nillable<T>): void;Fired by a script zone when a game object enters it.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 4 |
cb? | Nillable<(this: void, zone: game_object, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_zone.cpp, CScriptZone::feel_touch_new.
Remarks
The first callback argument is the zone object; the second is the entering object.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 5,
cb?: Nillable<(this: void, zone: game_object, object: game_object) => void>,
object?: Nillable<T>): void;Fired by a script zone when a game object leaves it or is released while touching it.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 5 |
cb? | Nillable<(this: void, zone: game_object, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_zone.cpp, CScriptZone::feel_touch_delete and CScriptZone::net_Relcase.
Remarks
The first callback argument is the zone object; the second is the leaving object.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 6,
cb?: Nillable<(this: void, object: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor leaves the playable level border.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 6 |
cb? | Nillable<(this: void, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Actor.cpp, CActor::SwitchOutBorder.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 7,
cb?: Nillable<(this: void, object: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor re-enters the playable level border.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 7 |
cb? | Nillable<(this: void, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Actor.cpp, CActor::SwitchOutBorder.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 8,
cb?: (this: void, target: game_object, killer: game_object) => void,
object?: Nillable<T>): void;Fired when the object dies or a destroyable physics object is destroyed.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 8 |
cb? | (this: void, target: game_object, killer: game_object) => void |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/entity_alive.cpp, src/xrGame/DestroyablePhysicsObject.cpp, and src/xrGame/ai/crow/ai_crow.cpp.
Remarks
The engine passes the victim and, when available, the killer object.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 9,
cb?: Nillable<(this: void, object: game_object, action_type: number, point_index: number) => void>,
object?: Nillable<T>): void;Fired when an object reaches a patrol path point.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 9 |
cb? | Nillable<(this: void, object: game_object, action_type: number, point_index: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/patrol_path_manager.cpp, CPatrolPathManager::select_point.
Remarks
The action type is ScriptEntity::eActionTypeMovement; point_index is the reached patrol vertex index.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 11,
cb?: Nillable<(this: void, npc: game_object, info_id: string) => void>,
object?: Nillable<T>): void;Fired when the actor receives an info portion.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 11 |
cb? | Nillable<(this: void, npc: game_object, info_id: string) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/actor_communication.cpp, CActor::OnReceiveInfo.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 12,
cb?: Nillable<(this: void, actor: game_object, group: string, name: string, article_type: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives an encyclopedia article from an info portion.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 12 |
cb? | Nillable<(this: void, actor: game_object, group: string, name: string, article_type: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/actor_communication.cpp, CActor::AddEncyclopediaArticle.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 13,
cb?: Nillable<(this: void, task: CGameTask, state: TXR_TaskState) => void>,
object?: Nillable<T>): void;Fired when an actor task state changes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 13 |
cb? | Nillable<(this: void, task: CGameTask, state: TXR_TaskState) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/GameTask.cpp, CGameTask::ChangeStateCallback and SGameTaskObjective::ChangeStateCallback.
Remarks
Root task callbacks pass task and state. Objective callbacks are fired from the engine with parent task, objective, and state.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 13,
cb?: Nillable<(this: void, task: CGameTask, objective: SGameTaskObjective, state: TXR_TaskState) => void>,
object?: Nillable<T>): void;Fired when a task objective state changes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 13 |
cb? | Nillable<(this: void, task: CGameTask, objective: SGameTaskObjective, state: TXR_TaskState) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/GameTask.cpp, SGameTaskObjective::ChangeStateCallback.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 14,
cb?: Nillable<(this: void, spot_type: string, id: number) => void>,
object?: Nillable<T>): void;Fired when the single-player map manager adds an actor map location.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 14 |
cb? | Nillable<(this: void, spot_type: string, id: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/map_manager.cpp, CMapManager::AddMapLocation.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 15,
cb?: Nillable<(this: void, object: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor uses an inventory item.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 15 |
cb? | Nillable<(this: void, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Inventory.cpp, inventory item use path.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 15,
cb?: Nillable<(this: void, object: game_object, who: game_object) => void>,
object?: Nillable<T>): void;Fired when an object is used by another object.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 15 |
cb? | Nillable<(this: void, object: game_object, who: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/GameObject.cpp and src/xrGame/doors_door.cpp.
Remarks
Door use callbacks pass the used object and the initiator when the initiator is available.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 16,
cb?: Nillable<(this: void, object: game_object, damage: number, direction: vector, who: game_object, bone_id: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives a hit processed by the script hit path.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 16 |
cb? | Nillable<(this: void, object: game_object, damage: number, direction: vector, who: game_object, bone_id: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Actor.cpp, CActor::Hit.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 17,
cb?: Nillable<(this: void, object: game_object, source_id: number, sound_type: TXR_snd_type, position: vector, sound_power: number) => void>,
object?: Nillable<T>): void;Fired when a script entity processes a saved sound notification.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 17 |
cb? | Nillable<(this: void, object: game_object, source_id: number, sound_type: TXR_snd_type, position: vector, sound_power: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::process_sound_callbacks.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 18,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type, target_point_index: -1) => void>,
object?: Nillable<T>): void;Fired when a script entity movement action completes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 18 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type, target_point_index: -1) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::ProcessScripts.
Remarks
The engine passes ScriptEntity::eActionTypeMovement as the action type and -1 as the target point index for this callback path.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 19,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void>,
object?: Nillable<T>): void;Fired when a script entity watch action completes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 19 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::ProcessScripts.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 20,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void>,
object?: Nillable<T>): void;Fired when a script entity action is removed from its queue.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 20 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::ProcessScripts.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 21,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void>,
object?: Nillable<T>): void;Fired when a script entity animation action completes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 21 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, ScriptCallBack.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 22,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void>,
object?: Nillable<T>): void;Fired when a script entity sound action completes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 22 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::ProcessScripts.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 23,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void>,
object?: Nillable<T>): void;Fired when a script entity particle action completes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 23 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::ProcessScripts.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 24,
cb?: Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void>,
object?: Nillable<T>): void;Fired when a script entity object action completes.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 24 |
cb? | Nillable<(this: void, object: game_object, action_type: TXR_action_type) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/script_entity.cpp, CScriptEntity::ProcessScripts.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 26,
cb?: Nillable<(this: void, distance: number, current_position: vector, vertex_id: number) => void>,
object?: Nillable<T>): void;Fired when a helicopter reaches its current patrol path point or move target.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 26 |
cb? | Nillable<(this: void, distance: number, current_position: vector, vertex_id: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/HelicopterMovementManager.cpp.
Remarks
Patrol-path movement passes the patrol vertex id. Direct movement passes -1.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 27,
cb?: Nillable<(this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void>,
object?: Nillable<T>): void;Fired when a helicopter is hit by the actor, stalker, or custom zone.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 27 |
cb? | Nillable<(this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Helicopter2.cpp, CHelicopter::Hit.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 28,
cb?: Nillable<(this: void, object: game_object, item: game_object) => void>,
object?: Nillable<T>): void;Fired when an inventory owner takes an item.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 28 |
cb? | Nillable<(this: void, object: game_object, item: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/InventoryOwner.cpp, CInventoryOwner::OnItemTake.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 29,
cb?: Nillable<(this: void, object: game_object, item: game_object) => void>,
object?: Nillable<T>): void;Fired when an inventory owner drops an item.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 29 |
cb? | Nillable<(this: void, object: game_object, item: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/InventoryOwner.cpp, CInventoryOwner::OnItemDrop.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 30,
cb?: Nillable<(this: void, skip_multi_anim_check?: boolean) => void>,
object?: Nillable<object>): void;Fired by script animation callback processing.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 30 |
cb? | Nillable<(this: void, skip_multi_anim_check?: boolean) => void> |
object? | Nillable<object> |
Returns
void
Source
src/xrGame/stalker_animation_manager_update.cpp and src/xrGame/animation_script_callback.cpp.
Remarks
Stalker animation manager callbacks can call this with no arguments; animation script callbacks pass whether the ended phase is being reported.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 31,
cb?: Nillable<(this: void) => void>,
object?: Nillable<T>): void;Fired when a trader needs a new global animation motion.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 31 |
cb? | Nillable<(this: void) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ai/trader/trader_animation.cpp, CTraderAnimation::update_frame.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 32,
cb?: Nillable<(this: void) => void>,
object?: Nillable<T>): void;Fired when a trader needs a new head animation motion while sound is playing.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 32 |
cb? | Nillable<(this: void) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ai/trader/trader_animation.cpp, CTraderAnimation::update_frame.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 33,
cb?: Nillable<(this: void) => void>,
object?: Nillable<T>): void;Fired when a trader sound finishes playing.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 33 |
cb? | Nillable<(this: void) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ai/trader/trader_animation.cpp, CTraderAnimation::update_frame.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 34,
cb?: Nillable<(this: void, object: game_object, box: game_object, item: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor takes an item from an inventory box while the box is open.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 34 |
cb? | Nillable<(this: void, object: game_object, box: game_object, item: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/InventoryBox.cpp, CInventoryBox::TakeItem.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 35,
cb?: Nillable<(this: void, object: game_object, suitable_ammo_total: number) => void>,
object?: Nillable<T>): void;Fired when an actor-owned weapon tries to reload and no suitable ammo is available.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 35 |
cb? | Nillable<(this: void, object: game_object, suitable_ammo_total: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/WeaponMagazined.cpp, CWeaponMagazined::TryReload.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 36,
cb?: Nillable<(this: void, object: game_object, hud_section: string, current_motion: string, state: number, animation_slot: number) => void>,
object?: Nillable<T>): void;Fired when a HUD item animation ends.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 36 |
cb? | Nillable<(this: void, object: game_object, hud_section: string, current_motion: string, state: number, animation_slot: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/HudItem.cpp, CHudItem::OnAnimationEnd.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 123,
cb?: Nillable<(this: void, key: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives a keyboard press before UI and game input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 123 |
cb? | Nillable<(this: void, key: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnKeyboardPress.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 124,
cb?: Nillable<(this: void, key: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives a keyboard release before UI and game input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 124 |
cb? | Nillable<(this: void, key: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnKeyboardRelease.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 125,
cb?: Nillable<(this: void, key: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives a keyboard hold before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 125 |
cb? | Nillable<(this: void, key: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnKeyboardHold.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 127,
cb?: Nillable<(this: void, dx: number, dy: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives a mouse movement event before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 127 |
cb? | Nillable<(this: void, dx: number, dy: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnMouseMove.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 126,
cb?: Nillable<(this: void, y: number, x: number) => void>,
object?: Nillable<T>): void;Fired when the actor receives a mouse wheel event before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 126 |
cb? | Nillable<(this: void, y: number, x: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnMouseWheel.
Remarks
The engine passes wheel deltas as (y, x).
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 48,
cb?: Nillable<(this: void, key: number, state: AnyObject) => void>,
object?: Nillable<T>): void;Fired when the actor receives a controller press event before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 48 |
cb? | Nillable<(this: void, key: number, state: AnyObject) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnControllerPress.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 49,
cb?: Nillable<(this: void, key: number, state: AnyObject) => void>,
object?: Nillable<T>): void;Fired when the actor receives a controller release event before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 49 |
cb? | Nillable<(this: void, key: number, state: AnyObject) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnControllerRelease.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 50,
cb?: Nillable<(this: void, key: number, state: AnyObject) => void>,
object?: Nillable<T>): void;Fired when the actor receives a controller hold event before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 50 |
cb? | Nillable<(this: void, key: number, state: AnyObject) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnControllerHold.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 51,
cb?: Nillable<(this: void, change: vector) => void>,
object?: Nillable<T>): void;Fired when the actor receives a controller attitude change event before normal input handling.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 51 |
cb? | Nillable<(this: void, change: vector) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Level_input.cpp, CLevel::IR_OnControllerAttitudeChange.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 37,
cb?: Nillable<(this: void, object: game_object) => void>,
object?: Nillable<T>): void;Fired when an inventory owner moves an item to the belt.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 37 |
cb? | Nillable<(this: void, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/InventoryOwner.cpp, CInventoryOwner::OnItemBelt.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 38,
cb?: Nillable<(this: void, object: game_object) => void>,
object?: Nillable<T>): void;Fired when an inventory owner moves an item to a slot.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 38 |
cb? | Nillable<(this: void, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/InventoryOwner.cpp, CInventoryOwner::OnItemSlot.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 39,
cb?: Nillable<(this: void, object: game_object) => void>,
object?: Nillable<T>): void;Fired when an inventory owner moves an item to the rucksack.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 39 |
cb? | Nillable<(this: void, object: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/InventoryOwner.cpp, CInventoryOwner::OnItemRuck.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 40,
cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
object?: Nillable<T>): void;Fired when a weapon owner zooms in with a magazined weapon.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 40 |
cb? | Nillable<(this: void, owner: game_object, weapon: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/WeaponMagazined.cpp, CWeaponMagazined::OnZoomIn.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 41,
cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
object?: Nillable<T>): void;Fired when a weapon owner zooms out with a magazined weapon.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 41 |
cb? | Nillable<(this: void, owner: game_object, weapon: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/WeaponMagazined.cpp, CWeaponMagazined::OnZoomOut.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 42,
cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
object?: Nillable<T>): void;Fired when a magazined weapon misfires.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 42 |
cb? | Nillable<(this: void, owner: game_object, weapon: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/WeaponMagazined.cpp, CWeaponMagazined::OnShot misfire path.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 43,
cb?: Nillable<(this: void, object: game_object, suitable_ammo_total: number) => void>,
object?: Nillable<T>): void;Fired when an actor-owned magazined weapon becomes empty or unloads its magazine.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 43 |
cb? | Nillable<(this: void, object: game_object, suitable_ammo_total: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/WeaponMagazined.cpp, CWeaponMagazined::OnMagazineEmpty and CWeaponMagazined::UnloadMagazine.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 44,
cb?: Nillable<(this: void, killer_id: number) => void>,
object?: Nillable<T>): void;Fired before actor death handling when the engine callback gate is enabled.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 44 |
cb? | Nillable<(this: void, killer_id: number) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/Entity.cpp, CEntity::KillEntity under ACTOR_BEFORE_DEATH_CALLBACK.
Remarks
The callback receives the id of the object that caused the actor death path.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 45,
cb?: Nillable<(this: void, vehicle: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor attaches to a vehicle or mounted weapon.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 45 |
cb? | Nillable<(this: void, vehicle: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ActorVehicle.cpp and src/xrGame/ActorMountedWeapon.cpp.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 46,
cb?: Nillable<(this: void, vehicle: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor detaches from a vehicle or mounted weapon.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 46 |
cb? | Nillable<(this: void, vehicle: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ActorVehicle.cpp and src/xrGame/ActorMountedWeapon.cpp.
Inherited from
game_object_callbacks_implementation_base.set_callback
Call Signature
set_callback<T>(
type: 47,
cb?: Nillable<(this: void, vehicle: game_object) => void>,
object?: Nillable<T>): void;Fired when the actor uses a vehicle without attaching to it.
Type Parameters
| Type Parameter |
|---|
T extends AnyObject |
Parameters
| Parameter | Type |
|---|---|
type | 47 |
cb? | Nillable<(this: void, vehicle: game_object) => void> |
object? | Nillable<T> |
Returns
void
Source
src/xrGame/ActorVehicle.cpp, CActor::use_Vehicle.
Inherited from
game_object_callbacks_implementation_base.set_callback
set_capture_anim()
set_capture_anim(
object: game_object,
animation: string,
position: vector,
factor: number): void;Configure bloodsucker capture animation jump.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Target object. |
animation | string | Capture animation name. |
position | vector | Jump position. |
factor | number | Jump force factor. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
set_character_community()
set_character_community(
community: string,
rank: number,
goodwill: number): void;Set character community.
Parameters
| Parameter | Type | Description |
|---|---|---|
community | string | Community id. |
rank | number | Rank value used by relation logic. |
goodwill | number | Goodwill value. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_character_icon()
set_character_icon(icon: string): void;Set character icon texture id.
Parameters
| Parameter | Type | Description |
|---|---|---|
icon | string | Icon id. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_character_rank()
set_character_rank(rank: number): void;Set character rank.
Parameters
| Parameter | Type | Description |
|---|---|---|
rank | number | Rank value. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_character_reputation()
set_character_reputation(reputation: number): void;Set character reputation.
Parameters
| Parameter | Type | Description |
|---|---|---|
reputation | number | Reputation value. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_collision_off()
set_collision_off(value: boolean): void;Enable or disable bloodsucker collision override.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether collision is disabled. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
set_community_goodwill()
set_community_goodwill(community: string, goodwill: number): void;Set goodwill toward a community.
Parameters
| Parameter | Type | Description |
|---|---|---|
community | string | Community id. |
goodwill | number | Goodwill value. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_condition()
set_condition(condition: number): void;Set item condition.
Parameters
| Parameter | Type | Description |
|---|---|---|
condition | number | New condition value. |
Returns
void
set_const_force()
set_const_force(
direction: vector,
power: number,
time_interval: number): void;Apply constant force for a time interval.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | vector | Force direction. |
power | number | Force power. |
time_interval | number | Duration in milliseconds. |
Returns
void
Remarks
Requires this object to own a physics shell or physics holder. Other object types return null or do nothing.
set_custom_panic_threshold()
set_custom_panic_threshold(threshold: number): void;Set custom panic threshold for this base monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
threshold | number | Panic threshold. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_default_panic_threshold()
set_default_panic_threshold(): void;Restore the default panic threshold.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_desired_direction()
Call Signature
set_desired_direction(): void;Clear desired movement direction for this stalker.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
set_desired_direction(direction: vector): void;Set desired movement direction for this stalker.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | vector | Desired direction. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_desired_position()
Call Signature
set_desired_position(): void;Clear desired movement position for this stalker.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
set_desired_position(position: vector): void;Set desired movement position for this stalker.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | Desired position. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Throws
The engine asserts if the provided position is not accessible for this stalker.
set_dest_game_vertex_id()
set_dest_game_vertex_id(value: number): void;Set destination game graph vertex.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Game vertex id. |
Returns
void
Remarks
Requires an AI object with movement path state. The vertex id must be valid in the game graph.
set_dest_level_vertex_id()
set_dest_level_vertex_id(vertex_id: number): void;Set destination level vertex.
Parameters
| Parameter | Type | Description |
|---|---|---|
vertex_id | number | Target level vertex id. |
Returns
void
Remarks
Requires an AI object with movement path state. The vertex id must be valid in the current level graph.
set_dest_loophole()
Call Signature
set_dest_loophole(): void;Clear desired smart-cover loophole.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
set_dest_loophole(loophole_id: string): void;Set desired smart-cover loophole by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
loophole_id | string | Loophole id. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_dest_smart_cover()
Call Signature
set_dest_smart_cover(): void;Clear destination smart cover.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
set_dest_smart_cover(smart_cover: string): void;Set destination smart cover by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
smart_cover | string | Smart cover name. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_detail_path_type()
set_detail_path_type(type: TXR_detail_path_type): void;Set detail path type used by movement.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_detail_path_type | Detail path type id. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_enemy()
set_enemy(object: game_object): void;Set current enemy object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Enemy object. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_enemy_callback()
Call Signature
set_enemy_callback(cb: null): void;Clear the custom enemy selector callback.
Parameters
| Parameter | Type |
|---|---|
cb | null |
Returns
void
Inherited from
game_object_callbacks_implementation_base.set_enemy_callback
Call Signature
set_enemy_callback<T>(cb: (this: T, object: game_object, enemy: game_object) => boolean, object: T): void;Set a custom enemy selector callback.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (this: T, object: game_object, enemy: game_object) => boolean | Callback that receives this object and a candidate enemy. |
object | T | Lua context used as callback this. |
Returns
void
Inherited from
game_object_callbacks_implementation_base.set_enemy_callback
set_fastcall()
set_fastcall<T>(cb: (this: T) => boolean, context: T): void;Set a fast update callback for this object.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (this: T) => boolean | Callback called from the object's fast update path. |
context | T | Lua context used as callback this. |
Returns
void
Inherited from
game_object_callbacks_implementation_base.set_fastcall
set_force_anti_aim()
set_force_anti_aim(value: boolean): void;Force or release anti-aim behavior for this base monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether anti-aim is forced. |
Returns
void
Remarks
Requires this object to be a base monster. Other object types log a script error and return a default value or do nothing.
set_fov()
set_fov(fov: number): void;Set field of view.
Parameters
| Parameter | Type | Description |
|---|---|---|
fov | number | Field of view angle. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
set_goodwill()
set_goodwill(goodwill: number, object: game_object): void;Set goodwill toward another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
goodwill | number | Goodwill value. |
object | game_object | Target object. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_health_ex()
set_health_ex(value: number): void;Directly set entity health instead of applying a health property delta.
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
void
Since
OpenXRay 2015-02-01, a91ff26a
Remarks
This binding exists because the normal health property setter routes through conditions().ChangeHealth.
set_home()
Call Signature
set_home(
name: Nillable<string>,
min_radius: number,
max_radius?: number,
is_aggressive?: boolean,
mid_radius?: number): void;Set monster home by patrol path name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | Nillable<string> | Patrol path name, or null to clear home. |
min_radius | number | Minimum home radius. |
max_radius? | number | Maximum home radius. |
is_aggressive? | boolean | Whether home is aggressive. |
mid_radius? | number | Middle home radius. |
Returns
void
Call Signature
set_home(
lvid: Nillable<number>,
min_radius: number,
max_radius?: number,
is_aggressive?: boolean,
mid_radius?: number): void;Set monster home by level vertex id.
Parameters
| Parameter | Type | Description |
|---|---|---|
lvid | Nillable<number> | Level vertex id, or null to clear home. |
min_radius | number | Minimum home radius. |
max_radius? | number | Maximum home radius. |
is_aggressive? | boolean | Whether home is aggressive. |
mid_radius? | number | Middle home radius. |
Returns
void
set_invisible()
set_invisible(is_invisible: boolean): void;Force bloodsucker invisibility state.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_invisible | boolean | Whether the object should be invisible. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
set_item()
set_item(
action_id: number,
object: Nillable<game_object>,
min_queue_size?: number,
max_queue_size?: number): void;Set item used by an action.
Parameters
| Parameter | Type | Description |
|---|---|---|
action_id | number | Action id. |
object | Nillable<game_object> | Item object, or null. |
min_queue_size? | number | Optional minimum queue size. |
max_queue_size? | number | Optional maximum queue size. |
Returns
void
set_level_changer_invitation()
set_level_changer_invitation(hint: string): void;Set level changer invitation hint text.
Parameters
| Parameter | Type | Description |
|---|---|---|
hint | string | Text to show when trying to change level. |
Returns
void
Remarks
Requires this object to be a level changer. Other object types do nothing.
set_main_weapon_type()
set_main_weapon_type(type: number): void;Set main weapon type id.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | number | Main weapon type id. |
Returns
void
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
set_manual_invisibility()
set_manual_invisibility(value: boolean): void;Enable or disable manual bloodsucker invisibility control.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether manual invisibility control is enabled. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
set_mental_state()
set_mental_state(state: TXR_mental_state): void;Set mental animation state.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | TXR_mental_state | Target mental state. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_movement_selection_type()
set_movement_selection_type(type: TXR_movement_selection_type): void;Set movement target selection type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_movement_selection_type | Selection type id. |
Returns
void
Source
src/xrGame/script_game_object3.cpp, CScriptGameObject::set_movement_selection_type.
Remarks
Requires this object to be a CAI_Stalker. The native wrapper logs an error for non-stalker objects but then still dereferences the missing stalker pointer, so this should only be called after the runtime type is known.
set_movement_type()
set_movement_type(movement_type: TXR_movement_type): void;Set target movement type for this stalker.
Parameters
| Parameter | Type | Description |
|---|---|---|
movement_type | TXR_movement_type | Movement type. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_nonscript_usable()
set_nonscript_usable(is_usable: boolean): void;Set whether this usable object may be used by non-script logic.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_usable | boolean | Whether non-script usage is allowed. |
Returns
void
set_npc_position()
set_npc_position(position: vector): void;Move an NPC to a position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vector | New NPC position. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_override_animation()
set_override_animation(animation: string): void;Force an override animation.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
Returns
void
set_path_type()
set_path_type(type: TXR_game_object_path): void;Set path planning type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_game_object_path | Path type. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_patrol_extrapolate_callback()
set_patrol_extrapolate_callback(cb?: Nillable<(cur_pt: number) => boolean>, object?: object): void;Set or clear the patrol extrapolation callback.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb? | Nillable<(cur_pt: number) => boolean> | Callback called with current patrol point index. |
object? | object | Optional Lua context. |
Returns
void
Inherited from
game_object_callbacks_implementation_base.set_patrol_extrapolate_callback
set_patrol_path()
set_patrol_path(
path_name: string,
start_type: TXR_patrol_start_type,
route_type: TXR_patrol_route_type,
random: boolean): void;Set movement patrol path.
Parameters
| Parameter | Type | Description |
|---|---|---|
path_name | string | Patrol path name. |
start_type | TXR_patrol_start_type | Patrol start type. |
route_type | TXR_patrol_route_type | Patrol route type. |
random | boolean | Whether path point selection is random. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_previous_point()
set_previous_point(point: number): void;Set previous patrol point index.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | number | Point index. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_queue_size()
set_queue_size(size: number): void;Set weapon fire queue size.
Parameters
| Parameter | Type | Description |
|---|---|---|
size | number | Queue size. |
Returns
void
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
set_range()
set_range(range: number): void;Set monster vision range.
Parameters
| Parameter | Type | Description |
|---|---|---|
range | number | New range. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
set_relation()
set_relation(relation: TXR_relation, object: game_object): void;Set relation to another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
relation | TXR_relation | Relation id. |
object | game_object | Target object. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_remaining_uses()
set_remaining_uses(remaining: number): void;Set remaining item uses count.
Parameters
| Parameter | Type | Description |
|---|---|---|
remaining | number | Count of remaining uses for item before destroy. |
Returns
void
Since
OpenXRay 2015-08-27, 7840b0fe
Remarks
Requires this object to be an eatable inventory item. Other object types log a script error and return a default value or do nothing.
set_restrictor_type()
set_restrictor_type(type: TXR_restrictor_type): void;Set space-restrictor category.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_restrictor_type | Restrictor type. |
Returns
void
Remarks
Requires this object to be a space restrictor. Other object types silently do nothing.
set_sight()
Call Signature
set_sight(
type: TXR_SightType,
torso_look: boolean,
path: boolean): void;Set the NPC sight mode from a sight type and movement-facing options.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_SightType | Sight mode. |
torso_look | boolean | Whether the torso should turn toward the sight target. |
path | boolean | Whether to use the current path direction. |
Returns
void
Call Signature
set_sight(
type: TXR_SightType,
target: Nillable<vector>,
look_over_delay: number): void;Set the NPC sight mode toward a point, with a look-over delay.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_SightType | Sight mode. |
target | Nillable<vector> | Point to look at, or null to clear the explicit point. |
look_over_delay | number | Delay before looking over. |
Returns
void
Call Signature
set_sight(
type: TXR_SightType,
target: vector,
torso_look: boolean,
fire_object: boolean): void;Set the NPC sight mode toward a point and optionally fire at it.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_SightType | Sight mode. |
target | vector | Point to look at. |
torso_look | boolean | Whether the torso should turn toward the target. |
fire_object | boolean | Whether the object should fire while aiming. |
Returns
void
Call Signature
set_sight(
type: TXR_SightType,
target: vector,
torso_look: boolean): void;Set the NPC sight mode toward a point.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_SightType | Sight mode. |
target | vector | Point to look at. |
torso_look | boolean | Whether the torso should turn toward the target. |
Returns
void
Call Signature
set_sight(type: TXR_SightType, target: vector): void;Set the NPC sight mode toward a point.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | TXR_SightType | Sight mode. |
target | vector | Point to look at. |
Returns
void
Call Signature
set_sight(
object: game_object,
torso_look?: boolean,
fire_object?: boolean,
no_pitch?: boolean): void;Set the NPC sight target to another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Object to look at. |
torso_look? | boolean | Whether the torso should turn toward the target. |
fire_object? | boolean | Whether the object should fire while aiming. |
no_pitch? | boolean | Whether to ignore pitch while aiming. |
Returns
void
set_smart_cover_target()
Call Signature
set_smart_cover_target(): void;Clear smart cover target.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
set_smart_cover_target(game_object: game_object): void;Set smart cover target object.
Parameters
| Parameter | Type | Description |
|---|---|---|
game_object | game_object | Target object. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
Call Signature
set_smart_cover_target(vector: vector): void;Set smart cover target position.
Parameters
| Parameter | Type | Description |
|---|---|---|
vector | vector | Target position. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_smart_cover_target_default()
set_smart_cover_target_default(is_enabled: boolean): void;Enable or disable default smart cover target.
Parameters
| Parameter | Type | Description |
|---|---|---|
is_enabled | boolean | Whether default target is enabled. |
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_smart_cover_target_fire()
set_smart_cover_target_fire(): void;Use smart cover fire target.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_smart_cover_target_fire_no_lookout()
set_smart_cover_target_fire_no_lookout(): void;Make the smart-cover target mode fire without lookout.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_smart_cover_target_idle()
set_smart_cover_target_idle(): void;Make smart-cover target selection prefer idle positions.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_smart_cover_target_lookout()
set_smart_cover_target_lookout(): void;Use smart cover lookout target.
Returns
void
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
set_smart_cover_target_selector()
set_smart_cover_target_selector(cb?: Nillable<(object: game_object) => void>, object?: Nillable<object>): void;Set or clear smart-cover target selection callback.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb? | Nillable<(object: game_object) => void> | Callback that receives this object when a smart-cover target is selected. |
object? | Nillable<object> | Optional Lua context. |
Returns
void
Inherited from
game_object_callbacks_implementation_base.set_smart_cover_target_selector
set_sound_mask()
set_sound_mask(mask: number): void;Set active sound mask for this monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Sound mask. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
set_sound_threshold()
set_sound_threshold(threshold: number): void;Set sound memory threshold for this monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
threshold | number | Sound threshold. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
set_spatial_type()
set_spatial_type(type: number): void;Set spatial registration type for this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | number | Spatial type mask. |
Returns
void
Since
OpenXRay 2016-05-31, 15edbfd9
Remarks
Requires this object to be registered in spatial object logic. Other object types can log an engine error or return a default value.
set_start_dialog()
set_start_dialog(dialog_id: string): void;Set start dialog id for this phrase dialog manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
dialog_id | string | Dialog id. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_start_point()
set_start_point(point: number): void;Set start patrol point index.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | number | Point index. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
set_sympathy()
set_sympathy(value: number): void;Set sympathy value used by relation logic.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Sympathy value. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_task_state()
set_task_state(state: TXR_TaskState, task_id: string): void;Set the state of a task by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | TXR_TaskState | New task state. |
task_id | string | Task id. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
set_tip_text()
set_tip_text(text: string): void;Set tip text when actor is near and hovering aim over target. As example, talk, loot and other kind of labels is possible when using this method.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Text to set as tip. |
Returns
void
set_tip_text_default()
set_tip_text_default(): void;Restore default usable-object tip text.
Returns
void
set_trader_global_anim()
set_trader_global_anim(animation: string): void;Set trader global animation.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
Returns
void
Remarks
Requires this object to be a trader-capable inventory owner. Other object types log a script error and return a default value or do nothing.
set_trader_head_anim()
set_trader_head_anim(animation: string): void;Set trader head animation.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Animation name. |
Returns
void
Remarks
Requires this object to be a trader-capable inventory owner. Other object types log a script error and return a default value or do nothing.
set_trader_sound()
set_trader_sound(animation: string, sound: string): void;Set trader sound for an animation state.
Parameters
| Parameter | Type | Description |
|---|---|---|
animation | string | Trader animation name. |
sound | string | Sound name. |
Returns
void
Remarks
Requires this object to be a trader-capable inventory owner. Other object types log a script error and return a default value or do nothing.
set_vis_state()
set_vis_state(state: number): void;Set bloodsucker visibility state as a raw engine value.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | number | Visibility state. |
Returns
void
Remarks
Requires this object to be a bloodsucker. Other object types log a script error and return a default value or do nothing.
set_visual_memory_enabled()
set_visual_memory_enabled(enabled: boolean): void;Enable or disable visual memory for this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Whether visual memory is enabled. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
set_visual_name()
set_visual_name(name: string): void;Set visual name for this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Visual name. |
Returns
void
Remarks
Requires this object to have a renderable visual. Objects without a visual can log an engine error or return a default value.
set_weapon_type()
set_weapon_type(type: number): void;Set weapon type id.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | number | Weapon type id. |
Returns
void
Since
OpenXRay 2016-02-25, 46c1c78c
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
set_weight()
set_weight(weight: number): void;Set carried object weight.
Parameters
| Parameter | Type | Description |
|---|---|---|
weight | number | New weight. |
Returns
void
Since
OpenXRay 2016-04-12, 1a206d71
show_condition()
show_condition(ini_file: ini_file, section: string): void;Set trade show condition.
Parameters
| Parameter | Type | Description |
|---|---|---|
ini_file | ini_file | Trade config. |
section | string | Condition section. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
sight_params()
sight_params(): CSightParams;Returns
Current sight parameters.
Remarks
Requires a stalker or another AI object with a sight manager.
skip_transfer_enemy()
skip_transfer_enemy(value: boolean): void;Enable or disable enemy transfer skipping.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether enemy transfer should be skipped. |
Returns
void
Remarks
Requires a custom monster. It controls whether the monster shares enemy information through monster feel logic.
sniper_fire_mode()
Call Signature
sniper_fire_mode(): boolean;Returns
boolean
Whether stalker sniper fire mode is enabled.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
sniper_fire_mode(value: boolean): void;Enable or disable stalker sniper fire mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether sniper fire mode is enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
sniper_update_rate()
Call Signature
sniper_update_rate(): boolean;Returns
boolean
Whether sniper update rate is enabled.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
sniper_update_rate(value: boolean): void;Enable or disable sniper update rate.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether sniper update rate is enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
sound_prefix()
Call Signature
sound_prefix(): string;Returns
string
Current sound voice prefix used by the object sound player.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
Call Signature
sound_prefix(prefix: string): void;Set the sound voice prefix used by the object sound player.
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix | string | Sound voice prefix. |
Returns
void
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
sound_voice_prefix()
sound_voice_prefix(): string;Get voice sound prefix.
Returns
string
Voice sound prefix.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
spawn_ini()
spawn_ini(): Nullable<ini_file>;Returns
Nullable<ini_file>
Spawn ini attached to this object, or null.
special_danger_move()
Call Signature
special_danger_move(): boolean;Returns
boolean
Whether special danger movement is enabled.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
special_danger_move(value: boolean): void;Enable or disable special danger movement.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether special danger movement is enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
squad()
squad(): number;Returns
number
Game object squad id.
start_particles()
start_particles(name: string, bone: string): void;Start particles attached to a bone.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Particle effect name. |
bone | string | Bone name. |
Returns
void
Remarks
Requires the bone to exist on this object's visual. Use stop_particles() with the same effect and bone when the script owns the effect lifetime.
start_trade()
start_trade(object: game_object): void;Start trade with another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Trade partner. |
Returns
void
Since
OpenXRay 2016-04-12, 1a206d71
Remarks
Requires this object to be the actor and the argument to be an inventory owner. Invalid object types do nothing or log an engine script error.
start_upgrade()
start_upgrade(object: game_object): void;Start upgrade interaction with another object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Upgrade partner. |
Returns
void
Since
OpenXRay 2016-04-12, 1a206d71
Remarks
Requires this object to be the actor and the argument to be an inventory owner. Invalid object types do nothing or log an engine script error.
stop_particles()
stop_particles(name: string, bone: string): void;Stop particles attached to a bone.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Particle effect name. |
bone | string | Bone name. |
Returns
void
Remarks
Requires the effect to have been started on this object and the bone to exist on its visual.
stop_talk()
stop_talk(): void;Stop the current actor talk dialog.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
story_id()
story_id(): number;Get story id assigned to this object.
Returns
number
Story id, or engine default when no story id is assigned.
suitable_smart_cover()
suitable_smart_cover(object: game_object): boolean;Check whether a smart-cover object is suitable for this stalker.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Smart-cover object. |
Returns
boolean
Whether the cover is suitable.
Remarks
Requires this object to be a stalker using smart-cover movement. Other object types log a script error and return a default value or do nothing.
switch_state()
switch_state(state: number): void;Switch HUD item state.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | number | New HUD item state. |
Returns
void
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
switch_to_talk()
switch_to_talk(): void;Open talk dialog with this object.
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
switch_to_trade()
switch_to_trade(): void;Open trade dialog with this object.
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
switch_to_upgrade()
switch_to_upgrade(): void;Switch the opened talk menu to upgrade mode.
Returns
void
Remarks
Requires this object to be the actor. Other object types log a script error or do nothing.
sympathy()
sympathy(): number;Returns
number
Sympathy value used by relation logic.
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
take_items_enabled()
Call Signature
take_items_enabled(): boolean;Returns
boolean
Whether this NPC may take items.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
take_items_enabled(value: boolean): void;Enable or disable item taking for this NPC.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether item taking is enabled. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
target_body_state()
target_body_state(): TXR_body_state;Returns
Target body state requested by the movement manager.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
target_mental_state()
target_mental_state(): TXR_mental_state;Returns
Target mental state requested by the movement manager.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
target_movement_type()
target_movement_type(): TXR_movement_type;Returns
Target movement type requested by the movement manager.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
team()
team(): number;Returns
number
Object team id.
torch_enabled()
torch_enabled(): boolean;Returns
boolean
Whether actor torch is enabled.
Remarks
Requires this object to be a torch item. Other object types log a script error and return a default value or do nothing.
transfer_item()
transfer_item(item: game_object, to: game_object): void;Transfer an item to another inventory owner.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | game_object | Item to transfer. |
to | game_object | Recipient object. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
transfer_money()
transfer_money(amount: number, from: game_object): void;Transfer money from another object to this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | number | Money amount. |
from | game_object | Source object. |
Returns
void
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
unload_magazine()
unload_magazine(): void;Unload the active weapon magazine into inventory.
Returns
void
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
unlock_door_for_npc()
unlock_door_for_npc(): void;Unlock this door for NPC navigation.
Returns
void
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
unregister_door_for_npc()
unregister_door_for_npc(): void;Unregister this door from NPC door management.
Returns
void
Remarks
Requires this object to be a door object managed by NPC door logic. Other object types do nothing or report an engine script error.
unregister_in_combat()
unregister_in_combat(): void;Remove this stalker from its squad combat registry.
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
use()
use(object: game_object): void;Use an object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Object to use. |
Returns
void
Since
OpenXRay 2016-04-12, 1a206d71
Remarks
Requires this object to support the requested use interaction. Unsupported object pairs do nothing or report an engine script error.
use_smart_covers_only()
Call Signature
use_smart_covers_only(): boolean;Returns
boolean
Whether smart-cover selection is restricted to smart covers only.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
use_smart_covers_only(value: boolean): void;Restrict or allow regular cover selection.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether only smart covers may be selected. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
vertex_in_direction()
vertex_in_direction(
level_vertex_id: number,
direction: vector,
max_distance: number): number;Find the farthest accessible level vertex in a direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
level_vertex_id | number | Starting level vertex id. |
direction | vector | Direction to search in. |
max_distance | number | Maximum search distance. |
Returns
number
Found level vertex id, or the start vertex if none is valid.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
visibility_threshold()
visibility_threshold(): number;Returns
number
Visibility threshold used by this object.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
vision_enabled()
vision_enabled(): boolean;Returns
boolean
Whether visual memory is enabled for this monster.
Remarks
Requires this object to be a CCustomMonster or one of its subclasses. Items, actors, and other objects log a script error and return a default value or do nothing.
weapon_addon_attach()
weapon_addon_attach(object: game_object): void;Attach a weapon addon from an inventory object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | game_object | Addon object. |
Returns
void
Since
OpenXRay 2015-01-06, 8f694c78
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_addon_detach()
weapon_addon_detach(addon: string): void;Detach a weapon addon by section name.
Parameters
| Parameter | Type | Description |
|---|---|---|
addon | string | Addon section name. |
Returns
void
Since
OpenXRay 2015-01-06, 8f694c78
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_grenadelauncher_status()
weapon_grenadelauncher_status(): number;Returns
number
Grenade launcher attachment status for the active weapon.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_in_grenade_mode()
weapon_in_grenade_mode(): boolean;Check whether weapon is in grenade launcher fire mode.
Returns
boolean
Whether this weapon is in grenade launcher fire mode.
Since
OpenXRay 2016-09-14, 4f312ea6
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_is_grenadelauncher()
weapon_is_grenadelauncher(): boolean;Returns
boolean
Whether the active weapon has an attached grenade launcher.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_is_scope()
weapon_is_scope(): boolean;Returns
boolean
Whether the active weapon has a scope attached.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_is_silencer()
weapon_is_silencer(): boolean;Returns
boolean
Whether the active weapon has an attached silencer.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_scope_status()
weapon_scope_status(): number;Returns
number
Scope attachment status for the active weapon.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_silencer_status()
weapon_silencer_status(): number;Returns
number
Active weapon silencer status.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_strapped()
weapon_strapped(): boolean;Returns
boolean
Whether the active weapon is strapped.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weapon_unstrapped()
weapon_unstrapped(): boolean;Returns
boolean
Whether the active weapon is unstrapped.
Remarks
Requires this object to be a weapon. Other object types log a script error and return a default value or do nothing.
weight()
weight(): number;Get object weight.
Returns
number
Inventory weight for this object.
Since
OpenXRay 2015-10-07, 658f68a2
Remarks
Requires this object to be a CInventoryOwner. Other object types log a script error and return a default value or do nothing.
who_hit_name()
who_hit_name(): string;Returns
string
Name of the object that last hit this object.
who_hit_section_name()
who_hit_section_name(): string;Returns
string
Section name of the object that last hit this object.
wounded()
Call Signature
wounded(): boolean;Returns
boolean
Whether this stalker is marked as wounded.
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Call Signature
wounded(value: boolean): void;Mark this stalker as wounded or recovered.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the stalker is wounded. |
Returns
void
Remarks
Requires this object to be a CAI_Stalker. Other object types log a script error and return a default value or do nothing.
Properties
bleeding
bleeding: number;Intensity of actor bleeding. 0 - no bleeding.
Remarks
Assignment applies a delta through CScriptGameObject::SetBleeding, not an absolute value.
health
health: number;Object health value from 0 to 1.
Remarks
Assignment applies a delta through CScriptGameObject::SetHealth, not an absolute value. Use set_health_ex when the script must set exact health.
morale
morale: number;Creature morale value.
Remarks
Assignment applies a delta through CScriptGameObject::SetMorale, not an absolute value.
power
power: number;Actor stamina/power value.
Remarks
Assignment applies a delta through CScriptGameObject::SetPower, not an absolute value.
psy_health
psy_health: number;Psy health value.
Remarks
Assignment applies a delta through CScriptGameObject::SetPsyHealth, not an absolute value.
radiation
radiation: number;Actor radiation value.
Remarks
Assignment applies a delta through CScriptGameObject::SetRadiation, not an absolute value.
satiety
satiety: number;Actor satiety value.
Remarks
Assignment applies a delta through CScriptGameObject::ChangeSatiety, not an absolute value.
action_type_count
readonly static action_type_count: 6;Engine enum value for game_object.action_type_count.
alifeMovementTypeMask
readonly static alifeMovementTypeMask: 0;Engine enum value for game_object.alifeMovementTypeMask.
alifeMovementTypeRandom
readonly static alifeMovementTypeRandom: 1;Engine enum value for game_object.alifeMovementTypeRandom.
animation
readonly static animation: 2;Engine enum value for game_object.animation.
dialog_pda_msg
readonly static dialog_pda_msg: 0;Engine enum value for game_object.dialog_pda_msg.
dummy
readonly static dummy: -1;Engine enum value for game_object.dummy.
enemy
readonly static enemy: 2;Engine enum value for game_object.enemy.
friend
readonly static friend: 0;Engine enum value for game_object.friend.
game_path
readonly static game_path: 0;Engine enum value for game_object.game_path.
info_pda_msg
readonly static info_pda_msg: 1;Engine enum value for game_object.info_pda_msg.
level_path
readonly static level_path: 1;Engine enum value for game_object.level_path.
movement
readonly static movement: 0;Engine enum value for game_object.movement.
neutral
readonly static neutral: 1;Engine enum value for game_object.neutral.
no_path
readonly static no_path: 3;Engine enum value for game_object.no_path.
no_pda_msg
readonly static no_pda_msg: 2;Engine enum value for game_object.no_pda_msg.
object
readonly static object: 5;Engine enum value for game_object.object.
particle
readonly static particle: 4;Engine enum value for game_object.particle.
patrol_path
readonly static patrol_path: 2;Engine enum value for game_object.patrol_path.
relation_attack
readonly static relation_attack: 1;Engine enum value for game_object.relation_attack.
relation_fight_help_human
readonly static relation_fight_help_human: 2;Engine enum value for game_object.relation_fight_help_human.
relation_fight_help_monster
readonly static relation_fight_help_monster: 4;Engine enum value for game_object.relation_fight_help_monster.
relation_kill
readonly static relation_kill: 0;Engine enum value for game_object.relation_kill.
sound
readonly static sound: 3;Engine enum value for game_object.sound.
watch
readonly static watch: 1;Engine enum value for game_object.watch.