Skip to content

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

ts
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

ts
accessible(position: vector): boolean;
Parameters
ParameterTypeDescription
positionvectorTarget 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

ts
accessible(vertex_id: number): boolean;
Parameters
ParameterTypeDescription
vertex_idnumberTarget 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()

ts
accessible_nearest(vertex_position: vector, target_position: vector): LuaMultiReturn<[number, vector]>;

Parameters

ParameterTypeDescription
vertex_positionvectorPosition to test from.
target_positionvectorDesired 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()

ts
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()

ts
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()

ts
action_by_index(index: number): Nullable<entity_action>;

Get queued action by index.

Parameters

ParameterTypeDescription
indexnumberAction 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()

ts
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()

ts
activate_slot(index: number): void;

Activate an inventory slot.

Parameters

ParameterTypeDescription
indexnumberSlot id.

Returns

void


active_detector()

ts
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()

ts
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()

ts
active_slot<T>(): T;

Type Parameters

Type Parameter
T extends number

Returns

T

Active item slot of game object.


active_sound_count()

Call Signature

ts
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

ts
active_sound_count(only_playing: boolean): number;

Get number of active sounds registered on this object.

Parameters
ParameterTypeDescription
only_playingbooleanWhether 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()

ts
active_zone_contact(zone_id: number): boolean;

Check whether the object contacts an active zone.

Parameters

ParameterTypeDescription
zone_idnumberZone 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()

ts
actor_look_at_point(position: vector): void;

Force actor look direction toward a point.

Parameters

ParameterTypeDescription
positionvectorPoint 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

ts
add_animation(
   animation: string, 
   hand_usage: boolean, 
   use_movement_controller: boolean): void;

Queue animation by name.

Parameters
ParameterTypeDescription
animationstringAnimation name.
hand_usagebooleanWhether the animation uses hands.
use_movement_controllerbooleanWhether 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

ts
add_animation(
   animation: string, 
   hand_usage: boolean, 
   position: vector, 
   rotation: vector, 
   local_animation: boolean): void;

Queue animation with local transform data.

Parameters
ParameterTypeDescription
animationstringAnimation name.
hand_usagebooleanWhether the animation uses hands.
positionvectorAnimation position.
rotationvectorAnimation rotation.
local_animationbooleanWhether 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()

ts
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

ParameterTypeDescription
prefixstringSound prefix.
max_countnumberMaximum samples in the sound collection.
typeTXR_snd_typeAI sound category.
prioritynumberSound priority.
masknumberSound synchronization mask.
internal_typenumberInternal stalker sound id.
bonestringBone 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()

ts
add_restrictions(out_restriction: string, in_restriction: string): void;

Add movement restrictions.

Parameters

ParameterTypeDescription
out_restrictionstringRestrictor name used as outside boundary.
in_restrictionstringRestrictor 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

ts
add_sound(
   prefix: string, 
   max_count: number, 
   type: TXR_snd_type, 
   priority: number, 
   mask: number, 
   internal_type: number): number;

Register an NPC sound.

Parameters
ParameterTypeDescription
prefixstringSound prefix.
max_countnumberMaximum samples in the sound collection.
typeTXR_snd_typeAI sound category.
prioritynumberSound priority.
masknumberSound synchronization mask.
internal_typenumberInternal 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

ts
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
ParameterTypeDescription
prefixstringSound prefix.
max_countnumberMaximum samples in the sound collection.
typeTXR_snd_typeAI sound category.
prioritynumberSound priority.
masknumberSound synchronization mask.
internal_typenumberInternal monster sound id.
bonestringBone 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()

ts
add_upgrade(upgrade_section: string): boolean;

Add an upgrade section.

Parameters

ParameterTypeDescription
upgrade_sectionstringSection 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

ts
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

ts
aim_bone_id(bone: string): void;

Set aimed bone id.

Parameters
ParameterTypeDescription
bonestringBone 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

ts
aim_time(object: game_object): number;

Get aim time for a target.

Parameters
ParameterTypeDescription
objectgame_objectTarget 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

ts
aim_time(object: game_object, time: number): void;

Set aim time for a target.

Parameters
ParameterTypeDescription
objectgame_objectTarget object.
timenumberAim 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()

ts
alive(): boolean;

Returns

boolean

Whether game object is alive.


allow_break_talk_dialog()

ts
allow_break_talk_dialog(value: boolean): void;

Allow or block breaking the current actor talk dialog.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
allow_sprint(is_allowed: boolean): void;

Enable or disable actor sprint.

Parameters

ParameterTypeDescription
is_allowedbooleanWhether 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()

ts
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()

ts
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()

ts
ammo_set_count(count: number): void;

Set ammo count for this ammo box.

Parameters

ParameterTypeDescription
countnumberAmmo 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()

ts
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()

ts
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

ts
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

ts
apply_loophole_direction_distance(distance: number): void;

Set the distance used when applying smart-cover loophole direction.

Parameters
ParameterTypeDescription
distancenumberLoophole 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()

ts
attach_vehicle(vehicle: game_object, force: boolean): void;

Attach actor to a vehicle or holder.

Parameters

ParameterTypeDescription
vehiclegame_objectVehicle object.
forcebooleanWhether 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()

ts
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()

ts
attachable_item_load_attach(section: string): void;

Reload attach position for this attachable item from a section.

Parameters

ParameterTypeDescription
sectionstringConfig 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()

ts
base_in_restrictions(): string;

Returns

string

Base incoming restriction list.


base_out_restrictions()

ts
base_out_restrictions(): string;

Get base outside restrictions.

Returns

string

Restriction list.

Remarks

Requires an object with AI path restriction support.


belt_count()

ts
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()

ts
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()

ts
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

ParameterTypeDescription
positionvectorSearch origin.
enemy_positionvectorThreat position.
min_distancenumberMinimum distance.
max_distancenumberMaximum distance.
deviationnumberAllowed direction deviation.

Returns

cover_point

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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
bind_object(binder: object_binder): void;

Attach a Lua binder to this object.

Parameters

ParameterTypeDescription
binderobject_binderBinder instance adopted by the engine.

Returns

void


binded_object()

ts
binded_object(): object_binder;

Get attached Lua binder.

Returns

object_binder

Bound object binder.


body_state()

ts
body_state(): TXR_body_state;

Returns

TXR_body_state

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()

ts
bone_position(bone: string): vector;

Get model bone world position.

Parameters

ParameterTypeDescription
bonestringBone name.

Returns

vector

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()

ts
bone_visible(bone: string): boolean;

Check whether a bone is visible.

Parameters

ParameterTypeDescription
bonestringBone 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()

ts
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()

ts
burer_set_force_gravi_attack(value: boolean): void;

Toggle burer gravity attack override.

Parameters

ParameterTypeDescription
valuebooleanWhether 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

ts
buy_condition(ini_file: ini_file, section: string): void;

Set trade buy conditions from an ini section.

Parameters
ParameterTypeDescription
ini_fileini_fileTrade config.
sectionstringCondition 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

ts
buy_condition(friend_factor: number, enemy_factor: number): void;

Set default trade buy factors.

Parameters
ParameterTypeDescription
friend_factornumberFactor used for friendly relations.
enemy_factornumberFactor 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()

ts
buy_item_condition_factor(factor: number): void;

Set item condition factor used by buying logic.

Parameters

ParameterTypeDescription
factornumberCondition 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()

ts
buy_supplies(ini: ini_file, section: string): void;

Buy supplies described by a config section.

Parameters

ParameterTypeDescription
iniini_fileTrade config.
sectionstringSupply 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()

ts
can_add_upgrade(upgrade_section: string): boolean;

Check whether an upgrade can be added.

Parameters

ParameterTypeDescription
upgrade_sectionstringSection of upgrade to check.

Returns

boolean

Whether upgrade can be added.

Since

OpenXRay 2023-10-19, a6016f10, PR #1463


can_install_upgrade()

ts
can_install_upgrade(upgrade_section: string): boolean;

Check whether an upgrade can be installed.

Parameters

ParameterTypeDescription
upgrade_sectionstringSection of upgrade to check.

Returns

boolean

Whether upgrade can be installed.

Since

OpenXRay 2023-10-19, a6016f10, PR #1463


can_script_capture()

ts
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

ts
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

ts
can_select_weapon(is_enabled: boolean): void;

Enable or disable weapon selection.

Parameters
ParameterTypeDescription
is_enabledbooleanWhether 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

ts
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

ts
can_throw_grenades(is_enabled: boolean): void;

Enable or disable grenade throwing.

Parameters
ParameterTypeDescription
is_enabledbooleanWhether 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
center(): vector;

Get object center position.

Returns

vector

Center position.


change_character_rank()

ts
change_character_rank(delta: number): void;

Add a delta to character rank.

Parameters

ParameterTypeDescription
deltanumberRank 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()

ts
change_character_reputation(delta: number): void;

Add a delta to character reputation.

Parameters

ParameterTypeDescription
deltanumberReputation 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()

ts
change_goodwill(delta_goodwill: number, to_object: game_object): void;

Add a delta to goodwill toward another object.

Parameters

ParameterTypeDescription
delta_goodwillnumberGoodwill delta.
to_objectgame_objectTarget 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()

ts
change_team(
   team_id: number, 
   squad_id: number, 
   group_id: number): void;

Change team, squad, and group ids.

Parameters

ParameterTypeDescription
team_idnumberTeam id.
squad_idnumberSquad id.
group_idnumberGroup id.

Returns

void

Remarks

Intended for alive AI objects. It changes runtime relation grouping, not smart-terrain squad membership.


character_community()

ts
character_community<T>(): T;

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Object community like monolith, stalker or zombied.


character_icon()

ts
character_icon<T>(): T;

Get character icon id.

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Icon id.


character_name()

ts
character_name<T>(): T;

Get localized character name.

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Character display name.


character_rank()

ts
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()

ts
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()

ts
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()

ts
clear_callbacks(): void;

Clear all callbacks registered on this object.

Returns

void

Inherited from

game_object_callbacks_implementation_base.clear_callbacks


clear_game_news()

ts
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()

ts
clear_override_animation(): void;

Clear override animation.

Returns

void


clsid()

ts
clsid(): TXR_class_id;

Get engine class id.

Returns

TXR_class_id

Class id constant.


command()

ts
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

ParameterTypeDescription
entity_actionentity_actionAction to perform.
is_high_prioritybooleanWhether 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()

ts
community_goodwill(from_community: string): number;

Get goodwill toward a community.

Parameters

ParameterTypeDescription
from_communitystringCommunity 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()

ts
condition(): number;

Get item condition.

Returns

number

Condition value.

Remarks

Requires an inventory item or another object with condition/durability data.


cost()

ts
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()

ts
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()

ts
deadbody_can_take(value: boolean): void;

Allow or block taking items from this dead body.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
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()

ts
deadbody_closed(value: boolean): void;

Mark this dead body inventory as opened or closed.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
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

ts
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

ts
death_sound_enabled(value: boolean): void;

Enable or disable death sounds.

Parameters
ParameterTypeDescription
valuebooleanWhether 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()

ts
death_time(): number;

Get object death time.

Returns

number

Death time.


debug_planner()

ts
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

ParameterTypeDescription
planneraction_plannerAction planner to show in stalker stats when debugging is enabled.

Returns

void


detach_vehicle()

ts
detach_vehicle(force: boolean): void;

Detach actor from the current vehicle or holder.

Parameters

ParameterTypeDescription
forcebooleanWhether 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()

ts
detail_path_type(): TXR_detail_path_type;

Get current detail path type used by the object's movement manager.

Returns

TXR_detail_path_type

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()

ts
direction(): vector;

Get object facing direction.

Returns

vector

Direction vector.

Remarks

Returns the current engine transform direction. For AI-facing goals, prefer sight or movement APIs.


disable_anomaly()

ts
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

ts
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

ts
disable_hit_marks(value: boolean): void;

Enable or disable hit mark suppression.

Parameters
ParameterTypeDescription
valuebooleanWhether 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()

ts
disable_info_portion(info_portion: string): boolean;

Remove an info portion from this object.

Parameters

ParameterTypeDescription
info_portionstringInfo 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()

ts
disable_inv_upgrade(): void;

Disable inventory upgrades for this object.

Returns

void


disable_show_hide_sounds()

ts
disable_show_hide_sounds(value: boolean): void;

Enable or disable weapon show, hide and reload sounds for this inventory owner.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
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()

ts
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()

ts
dont_has_info(info_portion: string): boolean;

Check that this object does not have an info portion.

Parameters

ParameterTypeDescription
info_portionstringInfo 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()

ts
drop_item(item: game_object): void;

Drop item from inventory.

Parameters

ParameterTypeDescription
itemgame_objectGame 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()

ts
drop_item_and_teleport(item: game_object, position: vector): void;

Drop an item and teleport it to a position.

Parameters

ParameterTypeDescription
itemgame_objectItem to drop.
positionvectorTarget 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()

ts
eat(item: game_object): void;

Consume an inventory item.

Parameters

ParameterTypeDescription
itemgame_objectItem 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()

ts
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()

ts
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

ParameterTypeDescription
is_enabledbooleanWhether 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()

ts
enable_inv_upgrade(): void;

Enable inventory upgrades for this object.

Returns

void


enable_level_changer()

ts
enable_level_changer(is_enabled: boolean): void;

Switch client level changed enabled state.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether level changer should be enabled.

Returns

void

Remarks

Requires this object to be a level changer. Other object types do nothing.


enable_memory_object()

ts
enable_memory_object(object: game_object, is_enabled: boolean): void;

Enable or disable memory tracking for an object.

Parameters

ParameterTypeDescription
objectgame_objectObject to update.
is_enabledbooleanWhether 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()

ts
enable_night_vision(is_enabled: boolean): void;

Enable or disable night vision on actor equipment.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether 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()

ts
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()

ts
enable_torch(is_enabled: boolean): void;

Enable or disable torch.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether 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()

ts
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()

ts
enable_vision(value: boolean): void;

Enable or disable visual memory for this monster.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
explode(id: number): void;

Trigger object explosion.

Parameters

ParameterTypeDescription
idnumberExplosion 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()

ts
external_sound_start(sound: string): void;

Start an external object sound.

Parameters

ParameterTypeDescription
soundstringSound 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()

ts
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

ts
extrapolate_length(): number;
Returns

number

Movement path extrapolation length.

Call Signature

ts
extrapolate_length(value: number): void;

Set movement path extrapolation length.

Parameters
ParameterTypeDescription
valuenumberExtrapolation length.
Returns

void


fake_death_fall_down()

ts
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()

ts
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()

ts
find_best_cover(position: vector): cover_point;

Find the best cover from a threat position.

Parameters

ParameterTypeDescription
positionvectorThreat position.

Returns

cover_point

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()

ts
force_set_goodwill(goodwill: number, to_object: game_object): void;

Set goodwill toward another object without applying a delta.

Parameters

ParameterTypeDescription
goodwillnumberGoodwill value.
to_objectgame_objectTarget 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()

ts
force_set_position(position: vector, activate: boolean): void;

Move object with a physics shell to a position immediately.

Parameters

ParameterTypeDescription
positionvectorTarget position.
activatebooleanWhether 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()

ts
force_stand_sleep_animation(index: number): void;

Force a bloodsucker stand/sleep animation variant.

Parameters

ParameterTypeDescription
indexnumberAnimation 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()

ts
force_visibility_state(state: TXR_bloodsucker_visibility_state): void;

For bloodsuckers specifically set current visibility state.

Parameters

ParameterType
stateTXR_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()

ts
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()

ts
game_vertex_id(): number;

Get current game graph vertex id.

Returns

number

Game vertex id.


general_goodwill()

ts
general_goodwill(target: game_object): number;

Return formula: personal_goodwill + reputation_goodwill + rank_goodwill + community_goodwill + community_to_community.

Parameters

ParameterTypeDescription
targetgame_objectTarget 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()

ts
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()

ts
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()

ts
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()

ts
get_actor_relation_flags(): flags32;

Returns

flags32

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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
get_ammo_count_for_type(type: number): number;

Get inventory ammo count for a weapon ammo type.

Parameters

ParameterTypeDescription
typenumberAmmo 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
get_bone_id(bone: string): number;

Get model bone id by name.

Parameters

ParameterTypeDescription
bonestringBone 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()

ts
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()

ts
get_car(): CCar;

Returns

CCar

This object as a car.

Remarks

Requires this object to be a car. Other object types log a script error.


get_corpse()

ts
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()

ts
get_current_direction(): vector;

Get current movement direction.

Returns

vector

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()

ts
get_current_holder(): Nullable<holder>;

Returns

Nullable<holder>

Current holder used by the actor, or null.


get_current_outfit()

ts
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()

ts
get_current_outfit_protection(hit_type: number): number;

Get protection value from the currently equipped outfit.

Parameters

ParameterTypeDescription
hit_typenumberHit 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()

ts
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()

ts
get_dest_smart_cover(): cover_point;

Get destination smart cover.

Returns

cover_point

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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
get_hanging_lamp(): hanging_lamp;

Cast this object to a hanging lamp.

Returns

hanging_lamp

Hanging lamp object.

Remarks

Requires this object to be a hanging lamp. Other object types log a script error.


get_helicopter()

ts
get_helicopter(): CHelicopter;

Returns

CHelicopter

This object as a helicopter.

Remarks

Requires this object to be a helicopter. Other object types log a script error.


get_holder_class()

ts
get_holder_class(): holder;

Cast this object to a holder.

Returns

holder

Holder object.

Remarks

Requires this object to be a holder object. Other object types log a script error or return null.


get_info_time()

ts
get_info_time(info: string): CTime;

Get time when an info portion was received.

Parameters

ParameterTypeDescription
infostringInfo portion id.

Returns

CTime

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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
get_monster_hit_info(): MonsterHitInfo;

Get latest monster hit information.

Returns

MonsterHitInfo

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()

ts
get_movement_speed(): vector;

Returns

vector

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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
get_sound_info(): SoundInfo;

Returns

SoundInfo

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()

ts
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()

ts
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()

ts
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()

ts
get_task(task_id: string, only_in_process: boolean): Nullable<CGameTask>;

Get task by id.

Parameters

ParameterTypeDescription
task_idstringTask id.
only_in_processbooleanWhether 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()

ts
get_task_state(task_id: string): TXR_TaskState;

Get task state by id.

Parameters

ParameterTypeDescription
task_idstringTask id.

Returns

TXR_TaskState

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()

ts
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()

ts
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()

ts
get_visual_name<T>(): T;

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Visual name assigned to this object.


get_weapon_substate()

ts
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()

ts
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()

ts
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

ParameterTypeDescription
titlestringNotification title.
textstringNotification text.
icon_texturestringNotification icon texture.
delaynumberDelay before show notification.
show_timenumberTime 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()

ts
give_info_portion(info_portion: string): boolean;

Add an info portion to this object.

Parameters

ParameterTypeDescription
info_portionstringInfo 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()

ts
give_money(amount: number): void;

Add money to this object.

Parameters

ParameterTypeDescription
amountnumberMoney 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()

ts
give_talk_message(
   title: string, 
   text: string, 
   icon: string): void;

Show a talk message.

Parameters

ParameterTypeDescription
titlestringMessage title.
textstringMessage text.
iconstringMessage 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()

ts
give_talk_message2(
   title: string, 
   text: string, 
   icon_texture_name: string, 
   selector: string): void;

Show talk dialog message with icon.

Parameters

ParameterTypeDescription
titlestringTitle of the message.
textstringText of the message.
icon_texture_namestringIcon to display in message image.
selectorstringPath 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()

ts
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

ParameterTypeDescription
taskCGameTaskTask object to give.
time_to_completenumberTime allowed to complete the task.
check_existingbooleanWhether an existing task should be reused.
timer_ttlnumberTimer 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()

ts
goodwill(target: game_object): number;

Returns level of goodwill stored for an object. No strict formulas, just get actual value.

Parameters

ParameterTypeDescription
targetgame_objectTarget 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()

ts
group(): number;

Get object group id.

Returns

number

Group id.


group_throw_time_interval()

Call Signature

ts
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

ts
group_throw_time_interval(interval: number): void;

Set delay between group grenade throws.

Parameters
ParameterTypeDescription
intervalnumberThrow 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()

ts
has_ammo_type(type: string): boolean;

Check whether weapon supports an ammo type.

Parameters

ParameterTypeDescription
typestringAmmo 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()

ts
has_info(info_portion: string): boolean;

Check whether this object has an info portion.

Parameters

ParameterTypeDescription
info_portionstringInfo 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()

ts
has_upgrade(upgrade_section: string): boolean;

Parameters

ParameterTypeDescription
upgrade_sectionstringSection of upgrade to check.

Returns

boolean

Whether upgrade is installed.


has_upgrade_group()

ts
has_upgrade_group(upgrade_group_section: string): boolean;

Check whether an upgrade group is installed.

Parameters

ParameterTypeDescription
upgrade_group_sectionstringSection 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()

ts
has_upgrade_group_by_upgrade_id(upgrade_section: string): boolean;

Check whether an upgrade's parent group is installed.

Parameters

ParameterTypeDescription
upgrade_sectionstringSection of upgrade to check parent group.

Returns

boolean

Whether upgrade parent group is installed.

Since

OpenXRay 2023-10-19, a6016f10, PR #1463


head_orientation()

ts
head_orientation(): vector;

Returns

vector

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()

ts
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()

ts
hit(hit: hit): void;

Apply a hit descriptor to this object.

Parameters

ParameterTypeDescription
hithitHit descriptor.

Returns

void


id()

ts
id(): number;

Get engine object id.

Returns

number

Runtime object id.


idle_max_time()

Call Signature

ts
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

ts
idle_max_time(time: number): void;

Set maximum idle time.

Parameters
ParameterTypeDescription
timenumberIdle 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

ts
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

ts
idle_min_time(value: number): void;

Set minimum idle time for smart-cover animation.

Parameters
ParameterTypeDescription
valuenumberIdle 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

ts
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

ts
ignore_monster_threshold(threshold: number): void;

Set monster ignore threshold used by this stalker's enemy memory.

Parameters
ParameterTypeDescription
thresholdnumberIgnore 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()

ts
in_current_loophole_fov(position: vector): boolean;

Check whether a position is inside the current loophole field of view.

Parameters

ParameterTypeDescription
positionvectorPosition 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()

ts
in_current_loophole_range(position: vector): boolean;

Check whether a point is in range of the current smart-cover loophole.

Parameters

ParameterTypeDescription
positionvectorPoint 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()

ts
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

ParameterTypeDescription
cover_namestringSmart cover name.
loophole_namestringLoophole name.
positionvectorPosition 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()

ts
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

ParameterTypeDescription
cover_idstringSmart-cover id.
loophole_idstringLoophole id.
positionvectorPoint 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()

ts
in_restrictions(): string;

Returns

string

Active input restriction names.

Remarks

Requires an object with AI path restriction support.


in_smart_cover()

ts
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()

ts
inactualize_game_path(): void;

Mark game path cache as outdated.

Returns

void


inactualize_level_path()

ts
inactualize_level_path(): void;

Mark level path cache as outdated.

Returns

void


inactualize_patrol_path()

ts
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()

ts
info_add(text: string): void;

Available only in debug mode. Sets information for game object for debug.

Parameters

ParameterType
textstring

Returns

void

Remarks

Intended for engine/debug overlays. Release builds may ignore it or compile out the visible effect.


info_clear()

ts
info_clear(): void;

Reset debugging information about object. Available only for debug builds.

Returns

void


inside()

Call Signature

ts
inside(position: vector): boolean;

Check whether a position is inside this space restrictor.

Parameters
ParameterTypeDescription
positionvectorPosition to test.
Returns

boolean

Whether the position is inside.

Call Signature

ts
inside(position: vector, epsilon: number): boolean;

Check whether a position is inside this space restrictor.

Parameters
ParameterTypeDescription
positionvectorPosition to test.
epsilonnumberExtra tolerance.
Returns

boolean

Whether the position is inside.


install_upgrade()

ts
install_upgrade(upgrade_section: string): boolean;

Install an upgrade section.

Parameters

ParameterTypeDescription
upgrade_sectionstringSection 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()

ts
inv_box_can_take(value: boolean): boolean;

Set whether items can be taken from this inventory box.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
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()

ts
inv_box_closed(is_closed: boolean, reason: string): boolean;

Close or open this inventory box.

Parameters

ParameterTypeDescription
is_closedbooleanWhether the box is closed.
reasonstringScript 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()

ts
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()

ts
inventory_for_each(cb: (this: void) => void): void;

Iterate inventory items.

Parameters

ParameterTypeDescription
cb(this: void) => voidCallback 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

ts
invulnerable(): boolean;
Returns

boolean

Whether this monster ignores damage.

Call Signature

ts
invulnerable(value: boolean): void;

Enable or disable monster damage immunity.

Parameters
ParameterTypeDescription
valuebooleanWhether the monster should be invulnerable.
Returns

void


is_active_task()

ts
is_active_task(task: CGameTask): boolean;

Parameters

ParameterTypeDescription
taskCGameTaskTask 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()

ts
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()

ts
is_ammo(): boolean;

Check whether this object is ammo.

Returns

boolean

Whether this object is ammo.

Since

OpenXRay 2017-08-15, 565b39e5


is_anomaly()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
is_inv_upgrade_enabled(): boolean;

Returns

boolean

Whether inventory upgrade interaction is enabled.


is_inventory_box()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
is_on_belt(object: game_object): boolean;

Check whether an item is on belt.

Parameters

ParameterTypeDescription
objectgame_objectItem 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
is_weapon_going_to_be_strapped(weapon: Nillable<game_object>): boolean;

Check whether a weapon is being strapped.

Parameters

ParameterTypeDescription
weaponNillable<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()

ts
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()

ts
item_in_slot(slot: number): Nullable<game_object>;

Get item in inventory slot.

Parameters

ParameterTypeDescription
slotnumberInventory 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()

ts
item_on_belt(slot: number): Nullable<game_object>;

Get item on belt by belt container index.

Parameters

ParameterTypeDescription
slotnumberBelt 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()

ts
iterate_feel_touch(callback: (this: void, object_id: number) => void): void;

Iterate object ids from this object's Feel::Touch contact list.

Parameters

ParameterTypeDescription
callback(this: void, object_id: number) => voidCallback 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()

ts
iterate_installed_upgrades(callback: (upgrade_section: string, object: game_object) => void): void;

Iterate over all item upgrades.

Parameters

ParameterTypeDescription
callback(upgrade_section: string, object: game_object) => voidCallback to call on each iteration to check installed upgrades.

Returns

void

Since

OpenXRay 2023-10-19, a6016f10, PR #1463


iterate_inventory()

ts
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

ParameterTypeDescription
cb(this: void, owner: game_object, item: game_object) => boolean | voidCallback to run for each item.
objectgame_objectTarget 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()

ts
iterate_inventory_box(cb: (this: void, box: game_object, item: game_object) => void, object: game_object): void;

Iterate items inside an inventory box.

Parameters

ParameterTypeDescription
cb(this: void, box: game_object, item: game_object) => voidCallback called for each box item.
objectgame_objectInventory 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()

ts
jump(target: vector, factor: number): void;

Force this monster to jump toward a point.

Parameters

ParameterTypeDescription
targetvectorJump target.
factornumberJump 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()

ts
kill(object: game_object): void;

Kill a target object.

Parameters

ParameterTypeDescription
objectgame_objectTarget 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()

ts
level_vertex_id(): number;

Get current level vertex id.

Returns

number

Level vertex id.


location_on_path()

ts
location_on_path(distance: number, position: vector): number;

Sample a future position on the current movement path.

Parameters

ParameterTypeDescription
distancenumberDistance along the path.
positionvectorOutput 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()

ts
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

ts
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

ts
lookout_max_time(value: number): void;

Set maximum lookout time.

Parameters
ParameterTypeDescription
valuenumberLookout 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

ts
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

ts
lookout_min_time(time: number): void;

Set minimum time spent looking out from smart cover.

Parameters
ParameterTypeDescription
timenumberLookout 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()

ts
make_item_active(item: game_object): void;

Make an inventory item active.

Parameters

ParameterTypeDescription
itemgame_objectItem 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()

ts
make_object_visible_somewhen(object: game_object): void;

Make another object temporarily visible to this object's memory.

Parameters

ParameterTypeDescription
objectgame_objectObject 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()

ts
mark_item_dropped(object: game_object): void;

Mark an inventory item as dropped.

Parameters

ParameterTypeDescription
objectgame_objectItem object.

Returns

void


marked_dropped()

ts
marked_dropped(object: game_object): boolean;

Check whether an item was marked as dropped by this object.

Parameters

ParameterTypeDescription
objectgame_objectItem object.

Returns

boolean

Whether the item is marked as dropped.


mass()

ts
mass(): number;

Returns

number

Physics mass of this object.


max_health()

ts
max_health(): number;

Returns

number

Maximum health for this entity.


max_ignore_monster_distance()

Call Signature

ts
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

ts
max_ignore_monster_distance(value: number): void;

Set maximum distance at which monsters can be ignored.

Parameters
ParameterTypeDescription
valuenumberDistance.
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()

ts
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()

ts
memory_position(object: game_object): vector;

Get remembered position of another object.

Parameters

ParameterTypeDescription
objectgame_objectRemembered object.

Returns

vector

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()

ts
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()

ts
memory_time(another: game_object): number;

Get time since this object remembered another object.

Parameters

ParameterTypeDescription
anothergame_objectObject 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()

ts
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()

ts
mental_state(): TXR_mental_state;

Get current stalker mental state.

Returns

TXR_mental_state

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()

ts
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()

ts
motivation_action_manager(): action_planner;

Returns

action_planner

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

ts
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

ts
movement_enabled(value: boolean): void;

Enable or disable movement for this inventory owner.

Parameters
ParameterTypeDescription
valuebooleanWhether 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()

ts
movement_target_reached(): boolean;

Check whether current movement target is reached.

Returns

boolean

Whether movement target is reached.


movement_type()

ts
movement_type(): TXR_movement_type;

Get current stalker movement type.

Returns

TXR_movement_type

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()

ts
name(): string;

Get runtime object name.

Returns

string

Object name.


night_vision_enabled()

ts
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()

ts
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()

ts
object(value: string | number): Nullable<game_object>;

Get inventory object by index or name.

Parameters

ParameterTypeDescription
valuestring | numberInventory 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()

ts
object_count(): number;

Get inventory object count.

Returns

number

Inventory item count.


on_door_is_closed()

ts
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()

ts
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()

ts
out_restrictions(): string;

Returns

string

Current outgoing restriction list.


parent()

ts
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()

ts
path_completed(): boolean;

Check whether current path is complete.

Returns

boolean

Whether path was completed.


path_type()

ts
path_type(): TXR_game_object_path;

Get current movement path type.

Returns

TXR_game_object_path

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()

ts
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()

ts
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()

ts
phantom_set_enemy(object: game_object): void;

Set enemy target for this phantom.

Parameters

ParameterTypeDescription
objectgame_objectEnemy 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

ts
play_cycle(animation: string, mix_in: boolean): void;

Play a model animation cycle.

Parameters
ParameterTypeDescription
animationstringAnimation name.
mix_inbooleanWhether to blend with current animation.
Returns

void

Call Signature

ts
play_cycle(animation: string): void;

Play a model animation cycle with default blending.

Parameters
ParameterTypeDescription
animationstringAnimation name.
Returns

void


play_hud_motion()

ts
play_hud_motion(
   motion: string, 
   mix_in: boolean, 
   state: number): number;

Play a HUD animation if it exists.

Parameters

ParameterTypeDescription
motionstringHUD motion name.
mix_inbooleanWhether to blend with the current animation.
statenumberState 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()

ts
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

ParameterTypeDescription
sound_typenumberInternal sound type.
max_start_time?numberOptional maximum start delay.
min_start_time?numberOptional minimum start delay.
max_stop_time?numberOptional maximum stop time.
min_stop_time?numberOptional minimum stop time.
id?numberOptional 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()

ts
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()

ts
poltergeist_set_actor_ignore(value: boolean): void;

Set whether this poltergeist ignores the actor.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
position(): vector;

Get current world position.

Returns

vector

Position vector.


profile_name()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
relation(object: game_object): TXR_relation;

Get relation to another object.

Parameters

ParameterTypeDescription
objectgame_objectTarget object.

Returns

TXR_relation

Relation id.


release_stand_sleep_animation()

ts
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()

ts
remove_all_restrictions(): void;

Clear all space restrictions from this object.

Returns

void


remove_danger()

ts
remove_danger(object: danger_object): void;

Remove a danger event from this stalker's danger memory.

Parameters

ParameterTypeDescription
objectdanger_objectDanger 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()

ts
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()

ts
remove_memory_hit_object(object: hit_memory_object): void;

Remove a hit-memory record from this stalker's memory manager.

Parameters

ParameterTypeDescription
objecthit_memory_objectHit-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()

ts
remove_memory_sound_object(object: sound_memory_object): void;

Remove a sound-memory record from this stalker's memory manager.

Parameters

ParameterTypeDescription
objectsound_memory_objectSound-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()

ts
remove_memory_visible_object(object: visible_memory_object): void;

Remove a visual-memory record from this stalker's memory manager.

Parameters

ParameterTypeDescription
objectvisible_memory_objectVisual-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()

ts
remove_restrictions(out_restrictions: string, in_restrictions: string): void;

Remove movement restrictions from this object.

Parameters

ParameterTypeDescription
out_restrictionsstringOut restriction names.
in_restrictionsstringIn 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()

ts
remove_sound(sound_type: number): void;

Stop and remove an NPC sound by internal sound type.

Parameters

ParameterTypeDescription
sound_typenumberInternal 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()

ts
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()

ts
reset_bone_protections(immunity_section: string, bones_section: string): void;

Reset stalker bone protections from immunity and bones sections.

Parameters

ParameterTypeDescription
immunity_sectionstringImmunity section name, or an empty string to use the model default.
bones_sectionstringBones 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
run_talk_dialog(object: game_object, disable_break: boolean): void;

Start actor talk dialog with another inventory owner.

Parameters

ParameterTypeDescription
objectgame_objectDialog partner.
disable_breakbooleanWhether 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()

ts
safe_cover(
   position: vector, 
   radius: number, 
   min_distance: number): cover_point;

Find a safe cover near a position.

Parameters

ParameterTypeDescription
positionvectorSearch position.
radiusnumberSearch radius.
min_distancenumberMinimum distance from position.

Returns

cover_point

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()

ts
script(script_control: boolean, script_name: string): void;

Enable or disable script control.

Parameters

ParameterTypeDescription
script_controlbooleanWhether script control is enabled.
script_namestringScript 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()

ts
section<T>(): T;

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Config section name of this object.


see()

Call Signature

ts
see(object: game_object): boolean;

Check whether this object can see another object.

Parameters
ParameterTypeDescription
objectgame_objectObject 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

ts
see(value: string): boolean;

Check whether this object can see a named point or object.

Parameters
ParameterTypeDescription
valuestringName 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

ts
sell_condition(ini_file: ini_file, section: string): void;

Load sell condition factors from an ini section.

Parameters
ParameterTypeDescription
ini_fileini_fileSource ini file.
sectionstringSection 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

ts
sell_condition(friend_factor: number, enemy_factor: number): void;

Set sell condition factors directly.

Parameters
ParameterTypeDescription
friend_factornumberCondition factor for friendly buyers.
enemy_factornumberCondition 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()

ts
set__force(
   force: vector, 
   magnitude: number, 
   impulse: number): void;

Apply a physics force to this object.

Parameters

ParameterTypeDescription
forcevectorForce vector.
magnitudenumberForce magnitude.
impulsenumberImpulse 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()

ts
set_active_task(task: CGameTask): void;

Mark a task as active.

Parameters

ParameterTypeDescription
taskCGameTaskTask 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()

ts
set_actor_direction(direction: number): void;

Set actor yaw direction.

Parameters

ParameterTypeDescription
directionnumberDirection 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()

ts
set_actor_jump_speed(speed: number): void;

Set actor jump speed.

Parameters

ParameterTypeDescription
speednumberJump 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()

ts
set_actor_max_walk_weight(weight: number): void;

Set actor maximum walk weight.

Parameters

ParameterTypeDescription
weightnumberMaximum 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()

ts
set_actor_max_weight(weight: number): void;

Set actor maximum carry weight.

Parameters

ParameterTypeDescription
weightnumberMaximum 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()

ts
set_actor_position(position: vector): void;

Move the actor to a position.

Parameters

ParameterTypeDescription
positionvectorNew 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()

ts
set_actor_relation_flags(value: flags32): void;

Set actor relation flags for this object.

Parameters

ParameterTypeDescription
valueflags32Relation 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()

ts
set_actor_run_coef(coef: number): void;

Set actor run speed coefficient.

Parameters

ParameterTypeDescription
coefnumberRun 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()

ts
set_actor_runback_coef(coef: number): void;

Set actor backward run speed coefficient.

Parameters

ParameterTypeDescription
coefnumberBackward 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()

ts
set_actor_sprint_koef(coef: number): void;

Set actor sprint speed coefficient.

Parameters

ParameterTypeDescription
coefnumberSprint 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()

ts
set_additional_max_walk_weight(weight: number): void;

Set additional maximum walk weight.

Parameters

ParameterTypeDescription
weightnumberAdditional 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()

ts
set_additional_max_weight(weight: number): void;

Set additional maximum carry weight.

Parameters

ParameterTypeDescription
weightnumberAdditional 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()

ts
set_alien_control(is_enabled: boolean): void;

Enable or disable bloodsucker alien control.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether 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()

ts
set_ammo_elapsed(count: number): void;

Set ammo count in current magazine.

Parameters

ParameterTypeDescription
countnumberAmmo 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()

ts
set_ammo_type(type: number): void;

Set active ammo type for this weapon.

Parameters

ParameterTypeDescription
typenumberAmmo 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()

ts
set_anomaly_power(power: number): void;

Set anomaly power.

Parameters

ParameterTypeDescription
powernumberNew 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()

ts
set_artefact_bleeding(rate: number): void;

Set artefact bleeding restore rate.

Parameters

ParameterTypeDescription
ratenumberRestore 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()

ts
set_artefact_health(rate: number): void;

Set artefact health restore rate.

Parameters

ParameterTypeDescription
ratenumberRestore 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()

ts
set_artefact_power(rate: number): void;

Set artefact power restore rate.

Parameters

ParameterTypeDescription
ratenumberRestore 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()

ts
set_artefact_radiation(rate: number): void;

Set artefact radiation restore rate.

Parameters

ParameterTypeDescription
ratenumberRestore 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()

ts
set_artefact_satiety(rate: number): void;

Set artefact satiety restore rate.

Parameters

ParameterTypeDescription
ratenumberRestore 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()

ts
set_body_state(state: TXR_body_state): void;

Set target body state for stalker movement.

Parameters

ParameterTypeDescription
stateTXR_body_stateBody 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()

ts
set_bone_visible(
   name: string, 
   visible: boolean, 
   recursive: boolean): void;

Set bone visibility on this object visual.

Parameters

ParameterTypeDescription
namestringBone name.
visiblebooleanWhether the bone is visible.
recursivebooleanWhether 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

ts
set_callback(type: TXR_callback, cb: Nillable<never>): void;

Clear one callback registration.

Parameters
ParameterTypeDescription
typeTXR_callbackCallback type to clear.
cbNillable<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

ts
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
ParameterType
type0
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

ts
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
ParameterType
type1
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

ts
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
ParameterType
type2
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

ts
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
ParameterType
type3
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

ts
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
ParameterType
type4
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

ts
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
ParameterType
type5
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

ts
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
ParameterType
type6
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

ts
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
ParameterType
type7
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

ts
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
ParameterType
type8
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

ts
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
ParameterType
type9
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

ts
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
ParameterType
type11
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

ts
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
ParameterType
type12
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

ts
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
ParameterType
type13
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

ts
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
ParameterType
type13
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

ts
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
ParameterType
type14
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

ts
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
ParameterType
type15
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

ts
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
ParameterType
type15
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

ts
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
ParameterType
type16
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

ts
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
ParameterType
type17
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

ts
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
ParameterType
type18
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

ts
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
ParameterType
type19
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

ts
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
ParameterType
type20
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

ts
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
ParameterType
type21
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

ts
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
ParameterType
type22
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

ts
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
ParameterType
type23
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

ts
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
ParameterType
type24
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

ts
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
ParameterType
type26
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

ts
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
ParameterType
type27
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

ts
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
ParameterType
type28
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

ts
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
ParameterType
type29
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

ts
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
ParameterType
type30
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

ts
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
ParameterType
type31
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

ts
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
ParameterType
type32
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

ts
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
ParameterType
type33
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

ts
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
ParameterType
type34
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

ts
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
ParameterType
type35
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

ts
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
ParameterType
type36
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

ts
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
ParameterType
type123
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

ts
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
ParameterType
type124
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

ts
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
ParameterType
type125
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

ts
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
ParameterType
type127
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

ts
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
ParameterType
type126
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

ts
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
ParameterType
type48
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

ts
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
ParameterType
type49
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

ts
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
ParameterType
type50
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

ts
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
ParameterType
type51
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

ts
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
ParameterType
type37
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

ts
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
ParameterType
type38
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

ts
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
ParameterType
type39
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

ts
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
ParameterType
type40
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

ts
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
ParameterType
type41
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

ts
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
ParameterType
type42
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

ts
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
ParameterType
type43
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

ts
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
ParameterType
type44
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

ts
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
ParameterType
type45
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

ts
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
ParameterType
type46
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

ts
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
ParameterType
type47
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()

ts
set_capture_anim(
   object: game_object, 
   animation: string, 
   position: vector, 
   factor: number): void;

Configure bloodsucker capture animation jump.

Parameters

ParameterTypeDescription
objectgame_objectTarget object.
animationstringCapture animation name.
positionvectorJump position.
factornumberJump 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()

ts
set_character_community(
   community: string, 
   rank: number, 
   goodwill: number): void;

Set character community.

Parameters

ParameterTypeDescription
communitystringCommunity id.
ranknumberRank value used by relation logic.
goodwillnumberGoodwill 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()

ts
set_character_icon(icon: string): void;

Set character icon texture id.

Parameters

ParameterTypeDescription
iconstringIcon 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()

ts
set_character_rank(rank: number): void;

Set character rank.

Parameters

ParameterTypeDescription
ranknumberRank 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()

ts
set_character_reputation(reputation: number): void;

Set character reputation.

Parameters

ParameterTypeDescription
reputationnumberReputation 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()

ts
set_collision_off(value: boolean): void;

Enable or disable bloodsucker collision override.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
set_community_goodwill(community: string, goodwill: number): void;

Set goodwill toward a community.

Parameters

ParameterTypeDescription
communitystringCommunity id.
goodwillnumberGoodwill 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()

ts
set_condition(condition: number): void;

Set item condition.

Parameters

ParameterTypeDescription
conditionnumberNew condition value.

Returns

void


set_const_force()

ts
set_const_force(
   direction: vector, 
   power: number, 
   time_interval: number): void;

Apply constant force for a time interval.

Parameters

ParameterTypeDescription
directionvectorForce direction.
powernumberForce power.
time_intervalnumberDuration 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()

ts
set_custom_panic_threshold(threshold: number): void;

Set custom panic threshold for this base monster.

Parameters

ParameterTypeDescription
thresholdnumberPanic 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()

ts
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

ts
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

ts
set_desired_direction(direction: vector): void;

Set desired movement direction for this stalker.

Parameters
ParameterTypeDescription
directionvectorDesired 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

ts
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

ts
set_desired_position(position: vector): void;

Set desired movement position for this stalker.

Parameters
ParameterTypeDescription
positionvectorDesired 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()

ts
set_dest_game_vertex_id(value: number): void;

Set destination game graph vertex.

Parameters

ParameterTypeDescription
valuenumberGame 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()

ts
set_dest_level_vertex_id(vertex_id: number): void;

Set destination level vertex.

Parameters

ParameterTypeDescription
vertex_idnumberTarget 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

ts
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

ts
set_dest_loophole(loophole_id: string): void;

Set desired smart-cover loophole by id.

Parameters
ParameterTypeDescription
loophole_idstringLoophole 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

ts
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

ts
set_dest_smart_cover(smart_cover: string): void;

Set destination smart cover by name.

Parameters
ParameterTypeDescription
smart_coverstringSmart 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()

ts
set_detail_path_type(type: TXR_detail_path_type): void;

Set detail path type used by movement.

Parameters

ParameterTypeDescription
typeTXR_detail_path_typeDetail 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()

ts
set_enemy(object: game_object): void;

Set current enemy object.

Parameters

ParameterTypeDescription
objectgame_objectEnemy 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

ts
set_enemy_callback(cb: null): void;

Clear the custom enemy selector callback.

Parameters
ParameterType
cbnull
Returns

void

Inherited from

game_object_callbacks_implementation_base.set_enemy_callback

Call Signature

ts
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
ParameterTypeDescription
cb(this: T, object: game_object, enemy: game_object) => booleanCallback that receives this object and a candidate enemy.
objectTLua context used as callback this.
Returns

void

Inherited from

game_object_callbacks_implementation_base.set_enemy_callback


set_fastcall()

ts
set_fastcall<T>(cb: (this: T) => boolean, context: T): void;

Set a fast update callback for this object.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
cb(this: T) => booleanCallback called from the object's fast update path.
contextTLua context used as callback this.

Returns

void

Inherited from

game_object_callbacks_implementation_base.set_fastcall


set_force_anti_aim()

ts
set_force_anti_aim(value: boolean): void;

Force or release anti-aim behavior for this base monster.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
set_fov(fov: number): void;

Set field of view.

Parameters

ParameterTypeDescription
fovnumberField 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()

ts
set_goodwill(goodwill: number, object: game_object): void;

Set goodwill toward another object.

Parameters

ParameterTypeDescription
goodwillnumberGoodwill value.
objectgame_objectTarget 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()

ts
set_health_ex(value: number): void;

Directly set entity health instead of applying a health property delta.

Parameters

ParameterType
valuenumber

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

ts
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
ParameterTypeDescription
nameNillable<string>Patrol path name, or null to clear home.
min_radiusnumberMinimum home radius.
max_radius?numberMaximum home radius.
is_aggressive?booleanWhether home is aggressive.
mid_radius?numberMiddle home radius.
Returns

void

Call Signature

ts
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
ParameterTypeDescription
lvidNillable<number>Level vertex id, or null to clear home.
min_radiusnumberMinimum home radius.
max_radius?numberMaximum home radius.
is_aggressive?booleanWhether home is aggressive.
mid_radius?numberMiddle home radius.
Returns

void


set_invisible()

ts
set_invisible(is_invisible: boolean): void;

Force bloodsucker invisibility state.

Parameters

ParameterTypeDescription
is_invisiblebooleanWhether 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()

ts
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

ParameterTypeDescription
action_idnumberAction id.
objectNillable<game_object>Item object, or null.
min_queue_size?numberOptional minimum queue size.
max_queue_size?numberOptional maximum queue size.

Returns

void


set_level_changer_invitation()

ts
set_level_changer_invitation(hint: string): void;

Set level changer invitation hint text.

Parameters

ParameterTypeDescription
hintstringText 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()

ts
set_main_weapon_type(type: number): void;

Set main weapon type id.

Parameters

ParameterTypeDescription
typenumberMain 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()

ts
set_manual_invisibility(value: boolean): void;

Enable or disable manual bloodsucker invisibility control.

Parameters

ParameterTypeDescription
valuebooleanWhether 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()

ts
set_mental_state(state: TXR_mental_state): void;

Set mental animation state.

Parameters

ParameterTypeDescription
stateTXR_mental_stateTarget 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()

ts
set_movement_selection_type(type: TXR_movement_selection_type): void;

Set movement target selection type.

Parameters

ParameterTypeDescription
typeTXR_movement_selection_typeSelection 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()

ts
set_movement_type(movement_type: TXR_movement_type): void;

Set target movement type for this stalker.

Parameters

ParameterTypeDescription
movement_typeTXR_movement_typeMovement 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()

ts
set_nonscript_usable(is_usable: boolean): void;

Set whether this usable object may be used by non-script logic.

Parameters

ParameterTypeDescription
is_usablebooleanWhether non-script usage is allowed.

Returns

void


set_npc_position()

ts
set_npc_position(position: vector): void;

Move an NPC to a position.

Parameters

ParameterTypeDescription
positionvectorNew 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()

ts
set_override_animation(animation: string): void;

Force an override animation.

Parameters

ParameterTypeDescription
animationstringAnimation name.

Returns

void


set_path_type()

ts
set_path_type(type: TXR_game_object_path): void;

Set path planning type.

Parameters

ParameterTypeDescription
typeTXR_game_object_pathPath 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()

ts
set_patrol_extrapolate_callback(cb?: Nillable<(cur_pt: number) => boolean>, object?: object): void;

Set or clear the patrol extrapolation callback.

Parameters

ParameterTypeDescription
cb?Nillable<(cur_pt: number) => boolean>Callback called with current patrol point index.
object?objectOptional Lua context.

Returns

void

Inherited from

game_object_callbacks_implementation_base.set_patrol_extrapolate_callback


set_patrol_path()

ts
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

ParameterTypeDescription
path_namestringPatrol path name.
start_typeTXR_patrol_start_typePatrol start type.
route_typeTXR_patrol_route_typePatrol route type.
randombooleanWhether 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()

ts
set_previous_point(point: number): void;

Set previous patrol point index.

Parameters

ParameterTypeDescription
pointnumberPoint 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()

ts
set_queue_size(size: number): void;

Set weapon fire queue size.

Parameters

ParameterTypeDescription
sizenumberQueue 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()

ts
set_range(range: number): void;

Set monster vision range.

Parameters

ParameterTypeDescription
rangenumberNew 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()

ts
set_relation(relation: TXR_relation, object: game_object): void;

Set relation to another object.

Parameters

ParameterTypeDescription
relationTXR_relationRelation id.
objectgame_objectTarget 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()

ts
set_remaining_uses(remaining: number): void;

Set remaining item uses count.

Parameters

ParameterTypeDescription
remainingnumberCount 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()

ts
set_restrictor_type(type: TXR_restrictor_type): void;

Set space-restrictor category.

Parameters

ParameterTypeDescription
typeTXR_restrictor_typeRestrictor type.

Returns

void

Remarks

Requires this object to be a space restrictor. Other object types silently do nothing.


set_sight()

Call Signature

ts
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
ParameterTypeDescription
typeTXR_SightTypeSight mode.
torso_lookbooleanWhether the torso should turn toward the sight target.
pathbooleanWhether to use the current path direction.
Returns

void

Call Signature

ts
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
ParameterTypeDescription
typeTXR_SightTypeSight mode.
targetNillable<vector>Point to look at, or null to clear the explicit point.
look_over_delaynumberDelay before looking over.
Returns

void

Call Signature

ts
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
ParameterTypeDescription
typeTXR_SightTypeSight mode.
targetvectorPoint to look at.
torso_lookbooleanWhether the torso should turn toward the target.
fire_objectbooleanWhether the object should fire while aiming.
Returns

void

Call Signature

ts
set_sight(
   type: TXR_SightType, 
   target: vector, 
   torso_look: boolean): void;

Set the NPC sight mode toward a point.

Parameters
ParameterTypeDescription
typeTXR_SightTypeSight mode.
targetvectorPoint to look at.
torso_lookbooleanWhether the torso should turn toward the target.
Returns

void

Call Signature

ts
set_sight(type: TXR_SightType, target: vector): void;

Set the NPC sight mode toward a point.

Parameters
ParameterTypeDescription
typeTXR_SightTypeSight mode.
targetvectorPoint to look at.
Returns

void

Call Signature

ts
set_sight(
   object: game_object, 
   torso_look?: boolean, 
   fire_object?: boolean, 
   no_pitch?: boolean): void;

Set the NPC sight target to another object.

Parameters
ParameterTypeDescription
objectgame_objectObject to look at.
torso_look?booleanWhether the torso should turn toward the target.
fire_object?booleanWhether the object should fire while aiming.
no_pitch?booleanWhether to ignore pitch while aiming.
Returns

void


set_smart_cover_target()

Call Signature

ts
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

ts
set_smart_cover_target(game_object: game_object): void;

Set smart cover target object.

Parameters
ParameterTypeDescription
game_objectgame_objectTarget 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

ts
set_smart_cover_target(vector: vector): void;

Set smart cover target position.

Parameters
ParameterTypeDescription
vectorvectorTarget 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()

ts
set_smart_cover_target_default(is_enabled: boolean): void;

Enable or disable default smart cover target.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
set_smart_cover_target_selector(cb?: Nillable<(object: game_object) => void>, object?: Nillable<object>): void;

Set or clear smart-cover target selection callback.

Parameters

ParameterTypeDescription
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()

ts
set_sound_mask(mask: number): void;

Set active sound mask for this monster.

Parameters

ParameterTypeDescription
masknumberSound 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()

ts
set_sound_threshold(threshold: number): void;

Set sound memory threshold for this monster.

Parameters

ParameterTypeDescription
thresholdnumberSound 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()

ts
set_spatial_type(type: number): void;

Set spatial registration type for this object.

Parameters

ParameterTypeDescription
typenumberSpatial 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()

ts
set_start_dialog(dialog_id: string): void;

Set start dialog id for this phrase dialog manager.

Parameters

ParameterTypeDescription
dialog_idstringDialog 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()

ts
set_start_point(point: number): void;

Set start patrol point index.

Parameters

ParameterTypeDescription
pointnumberPoint 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()

ts
set_sympathy(value: number): void;

Set sympathy value used by relation logic.

Parameters

ParameterTypeDescription
valuenumberSympathy 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()

ts
set_task_state(state: TXR_TaskState, task_id: string): void;

Set the state of a task by id.

Parameters

ParameterTypeDescription
stateTXR_TaskStateNew task state.
task_idstringTask 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()

ts
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

ParameterTypeDescription
textstringText to set as tip.

Returns

void


set_tip_text_default()

ts
set_tip_text_default(): void;

Restore default usable-object tip text.

Returns

void


set_trader_global_anim()

ts
set_trader_global_anim(animation: string): void;

Set trader global animation.

Parameters

ParameterTypeDescription
animationstringAnimation 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()

ts
set_trader_head_anim(animation: string): void;

Set trader head animation.

Parameters

ParameterTypeDescription
animationstringAnimation 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()

ts
set_trader_sound(animation: string, sound: string): void;

Set trader sound for an animation state.

Parameters

ParameterTypeDescription
animationstringTrader animation name.
soundstringSound 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()

ts
set_vis_state(state: number): void;

Set bloodsucker visibility state as a raw engine value.

Parameters

ParameterTypeDescription
statenumberVisibility 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()

ts
set_visual_memory_enabled(enabled: boolean): void;

Enable or disable visual memory for this object.

Parameters

ParameterTypeDescription
enabledbooleanWhether 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()

ts
set_visual_name(name: string): void;

Set visual name for this object.

Parameters

ParameterTypeDescription
namestringVisual 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()

ts
set_weapon_type(type: number): void;

Set weapon type id.

Parameters

ParameterTypeDescription
typenumberWeapon 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()

ts
set_weight(weight: number): void;

Set carried object weight.

Parameters

ParameterTypeDescription
weightnumberNew weight.

Returns

void

Since

OpenXRay 2016-04-12, 1a206d71


show_condition()

ts
show_condition(ini_file: ini_file, section: string): void;

Set trade show condition.

Parameters

ParameterTypeDescription
ini_fileini_fileTrade config.
sectionstringCondition 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()

ts
sight_params(): CSightParams;

Returns

CSightParams

Current sight parameters.

Remarks

Requires a stalker or another AI object with a sight manager.


skip_transfer_enemy()

ts
skip_transfer_enemy(value: boolean): void;

Enable or disable enemy transfer skipping.

Parameters

ParameterTypeDescription
valuebooleanWhether 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

ts
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

ts
sniper_fire_mode(value: boolean): void;

Enable or disable stalker sniper fire mode.

Parameters
ParameterTypeDescription
valuebooleanWhether 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

ts
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

ts
sniper_update_rate(value: boolean): void;

Enable or disable sniper update rate.

Parameters
ParameterTypeDescription
valuebooleanWhether 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

ts
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

ts
sound_prefix(prefix: string): void;

Set the sound voice prefix used by the object sound player.

Parameters
ParameterTypeDescription
prefixstringSound 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()

ts
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()

ts
spawn_ini(): Nullable<ini_file>;

Returns

Nullable<ini_file>

Spawn ini attached to this object, or null.


special_danger_move()

Call Signature

ts
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

ts
special_danger_move(value: boolean): void;

Enable or disable special danger movement.

Parameters
ParameterTypeDescription
valuebooleanWhether 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()

ts
squad(): number;

Returns

number

Game object squad id.


start_particles()

ts
start_particles(name: string, bone: string): void;

Start particles attached to a bone.

Parameters

ParameterTypeDescription
namestringParticle effect name.
bonestringBone 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()

ts
start_trade(object: game_object): void;

Start trade with another object.

Parameters

ParameterTypeDescription
objectgame_objectTrade 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()

ts
start_upgrade(object: game_object): void;

Start upgrade interaction with another object.

Parameters

ParameterTypeDescription
objectgame_objectUpgrade 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()

ts
stop_particles(name: string, bone: string): void;

Stop particles attached to a bone.

Parameters

ParameterTypeDescription
namestringParticle effect name.
bonestringBone name.

Returns

void

Remarks

Requires the effect to have been started on this object and the bone to exist on its visual.


stop_talk()

ts
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()

ts
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()

ts
suitable_smart_cover(object: game_object): boolean;

Check whether a smart-cover object is suitable for this stalker.

Parameters

ParameterTypeDescription
objectgame_objectSmart-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()

ts
switch_state(state: number): void;

Switch HUD item state.

Parameters

ParameterTypeDescription
statenumberNew 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()

ts
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()

ts
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()

ts
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()

ts
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

ts
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

ts
take_items_enabled(value: boolean): void;

Enable or disable item taking for this NPC.

Parameters
ParameterTypeDescription
valuebooleanWhether 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()

ts
target_body_state(): TXR_body_state;

Returns

TXR_body_state

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()

ts
target_mental_state(): TXR_mental_state;

Returns

TXR_mental_state

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()

ts
target_movement_type(): TXR_movement_type;

Returns

TXR_movement_type

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()

ts
team(): number;

Returns

number

Object team id.


torch_enabled()

ts
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()

ts
transfer_item(item: game_object, to: game_object): void;

Transfer an item to another inventory owner.

Parameters

ParameterTypeDescription
itemgame_objectItem to transfer.
togame_objectRecipient 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()

ts
transfer_money(amount: number, from: game_object): void;

Transfer money from another object to this object.

Parameters

ParameterTypeDescription
amountnumberMoney amount.
fromgame_objectSource 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
use(object: game_object): void;

Use an object.

Parameters

ParameterTypeDescription
objectgame_objectObject 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

ts
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

ts
use_smart_covers_only(value: boolean): void;

Restrict or allow regular cover selection.

Parameters
ParameterTypeDescription
valuebooleanWhether 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()

ts
vertex_in_direction(
   level_vertex_id: number, 
   direction: vector, 
   max_distance: number): number;

Find the farthest accessible level vertex in a direction.

Parameters

ParameterTypeDescription
level_vertex_idnumberStarting level vertex id.
directionvectorDirection to search in.
max_distancenumberMaximum 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()

ts
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()

ts
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()

ts
weapon_addon_attach(object: game_object): void;

Attach a weapon addon from an inventory object.

Parameters

ParameterTypeDescription
objectgame_objectAddon 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()

ts
weapon_addon_detach(addon: string): void;

Detach a weapon addon by section name.

Parameters

ParameterTypeDescription
addonstringAddon 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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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()

ts
who_hit_name(): string;

Returns

string

Name of the object that last hit this object.


who_hit_section_name()

ts
who_hit_section_name(): string;

Returns

string

Section name of the object that last hit this object.


wounded()

Call Signature

ts
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

ts
wounded(value: boolean): void;

Mark this stalker as wounded or recovered.

Parameters
ParameterTypeDescription
valuebooleanWhether 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

ts
bleeding: number;

Intensity of actor bleeding. 0 - no bleeding.

Remarks

Assignment applies a delta through CScriptGameObject::SetBleeding, not an absolute value.


health

ts
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

ts
morale: number;

Creature morale value.

Remarks

Assignment applies a delta through CScriptGameObject::SetMorale, not an absolute value.


power

ts
power: number;

Actor stamina/power value.

Remarks

Assignment applies a delta through CScriptGameObject::SetPower, not an absolute value.


psy_health

ts
psy_health: number;

Psy health value.

Remarks

Assignment applies a delta through CScriptGameObject::SetPsyHealth, not an absolute value.


radiation

ts
radiation: number;

Actor radiation value.

Remarks

Assignment applies a delta through CScriptGameObject::SetRadiation, not an absolute value.


satiety

ts
satiety: number;

Actor satiety value.

Remarks

Assignment applies a delta through CScriptGameObject::ChangeSatiety, not an absolute value.


action_type_count

ts
readonly static action_type_count: 6;

Engine enum value for game_object.action_type_count.


alifeMovementTypeMask

ts
readonly static alifeMovementTypeMask: 0;

Engine enum value for game_object.alifeMovementTypeMask.


alifeMovementTypeRandom

ts
readonly static alifeMovementTypeRandom: 1;

Engine enum value for game_object.alifeMovementTypeRandom.


animation

ts
readonly static animation: 2;

Engine enum value for game_object.animation.


dialog_pda_msg

ts
readonly static dialog_pda_msg: 0;

Engine enum value for game_object.dialog_pda_msg.


dummy

ts
readonly static dummy: -1;

Engine enum value for game_object.dummy.


enemy

ts
readonly static enemy: 2;

Engine enum value for game_object.enemy.


friend

ts
readonly static friend: 0;

Engine enum value for game_object.friend.


game_path

ts
readonly static game_path: 0;

Engine enum value for game_object.game_path.


info_pda_msg

ts
readonly static info_pda_msg: 1;

Engine enum value for game_object.info_pda_msg.


level_path

ts
readonly static level_path: 1;

Engine enum value for game_object.level_path.


movement

ts
readonly static movement: 0;

Engine enum value for game_object.movement.


neutral

ts
readonly static neutral: 1;

Engine enum value for game_object.neutral.


no_path

ts
readonly static no_path: 3;

Engine enum value for game_object.no_path.


no_pda_msg

ts
readonly static no_pda_msg: 2;

Engine enum value for game_object.no_pda_msg.


object

ts
readonly static object: 5;

Engine enum value for game_object.object.


particle

ts
readonly static particle: 4;

Engine enum value for game_object.particle.


patrol_path

ts
readonly static patrol_path: 2;

Engine enum value for game_object.patrol_path.


relation_attack

ts
readonly static relation_attack: 1;

Engine enum value for game_object.relation_attack.


relation_fight_help_human

ts
readonly static relation_fight_help_human: 2;

Engine enum value for game_object.relation_fight_help_human.


relation_fight_help_monster

ts
readonly static relation_fight_help_monster: 4;

Engine enum value for game_object.relation_fight_help_monster.


relation_kill

ts
readonly static relation_kill: 0;

Engine enum value for game_object.relation_kill.


sound

ts
readonly static sound: 3;

Engine enum value for game_object.sound.


watch

ts
readonly static watch: 1;

Engine enum value for game_object.watch.