Skip to content

Class: cse_alife_trader ​

Server object binding for cse_alife_trader.

Source ​

C++ class cse_alife_trader : cse_alife_dynamic_object_visual,cse_alife_trader_abstract

Custom Constructor ​

cse_alife_trader

Extends ​

Implements ​

Constructors ​

Constructor ​

ts
new cse_alife_trader(section: string): cse_alife_trader;

Create an ALife object for a spawn section.

Parameters ​

ParameterTypeDescription
sectionstringSpawn section name.

Returns ​

cse_alife_trader

Inherited from ​

cse_alife_dynamic_object_visual.constructor

Methods ​

can_save() ​

ts
can_save(): boolean;

Returns ​

boolean

Whether this object should be saved.

Implementation of ​

cse_alife_trader_abstract.can_save

Inherited from ​

cse_alife_dynamic_object_visual.can_save


can_switch_offline() ​

Call Signature ​

ts
can_switch_offline(): boolean;
Returns ​

boolean

Whether this object may switch offline.

Implementation of ​

cse_alife_trader_abstract.can_switch_offline

Inherited from ​

cse_alife_dynamic_object_visual.can_switch_offline

Call Signature ​

ts
can_switch_offline(value: boolean): void;

Allow or block switching offline.

Parameters ​
ParameterTypeDescription
valuebooleanWhether offline switching is allowed.
Returns ​

void

Remarks ​

Sets the object's switch-offline flag; it does not switch the object immediately.

Implementation of ​

cse_alife_trader_abstract.can_switch_offline

Inherited from ​

cse_alife_dynamic_object_visual.can_switch_offline


can_switch_online() ​

Call Signature ​

ts
can_switch_online(): boolean;
Returns ​

boolean

Whether this object may switch online.

Implementation of ​

cse_alife_trader_abstract.can_switch_online

Inherited from ​

cse_alife_dynamic_object_visual.can_switch_online

Call Signature ​

ts
can_switch_online(value: boolean): void;

Allow or block switching online.

Parameters ​
ParameterTypeDescription
valuebooleanWhether online switching is allowed.
Returns ​

void

Remarks ​

Sets the object's switch-online flag; it does not switch the object immediately.

Implementation of ​

cse_alife_trader_abstract.can_switch_online

Inherited from ​

cse_alife_dynamic_object_visual.can_switch_online


character_icon() ​

ts
character_icon(): string;

Resolve and return the character icon name.

Returns ​

string

Icon name.

Implementation of ​

cse_alife_trader_abstract.character_icon


character_name() ​

ts
character_name(): string;

Returns ​

string

Localized character name.

Implementation of ​

cse_alife_trader_abstract.character_name


clsid() ​

ts
clsid(): TXR_class_id;

Returns ​

TXR_class_id

Engine class id.

Implementation of ​

cse_alife_trader_abstract.clsid

Inherited from ​

cse_alife_dynamic_object_visual.clsid


community() ​

ts
community(): string;

Returns ​

string

Trader community name.

Implementation of ​

cse_alife_trader_abstract.community


FillProps() ​

ts
FillProps(pref: string, items: prop_item_vec): void;

Fill editor property rows for this object.

Parameters ​

ParameterTypeDescription
prefstringProperty prefix.
itemsprop_item_vecProperty collection to populate.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.FillProps

Inherited from ​

cse_alife_dynamic_object_visual.FillProps


init() ​

ts
init(): cse_abstract;

Initialize the ALife object and return its abstract base.

Returns ​

cse_abstract

Initialized abstract entity.

Implementation of ​

cse_alife_trader_abstract.init

Inherited from ​

cse_alife_dynamic_object_visual.init


interactive() ​

ts
interactive(): boolean;

Returns ​

boolean

Whether the object is interactive.

Implementation of ​

cse_alife_trader_abstract.interactive

Inherited from ​

cse_alife_dynamic_object_visual.interactive


keep_saved_data_anyway() ​

ts
keep_saved_data_anyway(): boolean;

Check whether client data should survive regular cleanup.

Returns ​

boolean

Whether saved data should be kept even when regular cleanup would remove it.

Source ​

src/xrGame/alife_object.cpp, CSE_ALifeObject::keep_saved_data_anyway.

Source ​

src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::clear_client_data.

Remarks ​

Most objects return false, so client_data is cleared when switching offline or after a failed switch online. Classes can override this to keep saved client data across cleanup.

Implementation of ​

cse_alife_trader_abstract.keep_saved_data_anyway

Inherited from ​

cse_alife_dynamic_object_visual.keep_saved_data_anyway


move_offline() ​

Call Signature ​

ts
move_offline(): boolean;
Returns ​

boolean

Whether the object should move while offline.

Implementation of ​

cse_alife_trader_abstract.move_offline

Inherited from ​

cse_alife_dynamic_object_visual.move_offline

Call Signature ​

ts
move_offline(value?: boolean): void;

Set whether the object should move while offline.

Parameters ​
ParameterTypeDescription
value?booleanWhether offline movement is enabled.
Returns ​

void

Implementation of ​

cse_alife_trader_abstract.move_offline

Inherited from ​

cse_alife_dynamic_object_visual.move_offline


name() ​

ts
name<T>(): T;

Type Parameters ​

Type ParameterDefault type
T extends stringstring

Returns ​

T

Runtime object name.

Implementation of ​

cse_alife_trader_abstract.name

Inherited from ​

cse_alife_dynamic_object_visual.name


on_before_register() ​

ts
on_before_register(): void;

Prepare for registration in the ALife registry.

Returns ​

void

Source ​

src/xrGame/alife_simulator_base2.cpp, CALifeSimulatorBase::register_object.

Remarks ​

Uses the same registration path as on_register. During savegame load it runs before the final on_register pass for all restored objects, so avoid cross-object links that need every object fully registered.

Implementation of ​

cse_alife_trader_abstract.on_before_register

Inherited from ​

cse_alife_dynamic_object_visual.on_before_register


on_register() ​

ts
on_register(): void;

Handle registration in the ALife registry.

Returns ​

void

Source ​

src/xrGame/alife_simulator_base2.cpp, CALifeSimulatorBase::register_object.

Source ​

src/xrGame/alife_storage_manager.cpp, CALifeStorageManager::load.

Source ​

src/xrGame/alife_update_manager.cpp, CALifeUpdateManager::update.

Remarks ​

This is a repeatable registry hook, not first-spawn-only logic. Savegame load registers restored objects with callbacks disabled, then calls on_register for each restored object. Keep handlers idempotent and pair cleanup with on_unregister.

Implementation of ​

cse_alife_trader_abstract.on_register

Inherited from ​

cse_alife_dynamic_object_visual.on_register


on_spawn() ​

ts
on_spawn(): void;

Handle initial server-object spawn.

Returns ​

void

Source ​

src/xrGame/alife_simulator_base.cpp, CALifeSimulatorBase::create.

Source ​

src/xrGame/alife_storage_manager.cpp, CALifeStorageManager::load.

Remarks ​

This is a server-object creation hook. ALife create paths call it after registration and supply spawning. Savegame load does not call it for restored objects; restored objects receive on_register instead.

Implementation of ​

cse_alife_trader_abstract.on_spawn

Inherited from ​

cse_alife_dynamic_object_visual.on_spawn


on_unregister() ​

ts
on_unregister(): void;

Handle removal from the ALife registry.

Returns ​

void

Source ​

src/xrGame/alife_simulator_base2.cpp, CALifeSimulatorBase::unregister_object.

Remarks ​

Pair this with on_register to remove registry links, scheduler state, story mappings, or similar state.

Implementation of ​

cse_alife_trader_abstract.on_unregister

Inherited from ​

cse_alife_dynamic_object_visual.on_unregister


profile_name() ​

ts
profile_name(): string;

Returns ​

string

Character profile section name.

Implementation of ​

cse_alife_trader_abstract.profile_name


rank() ​

ts
rank(): number;

Returns ​

number

Trader rank.

Implementation of ​

cse_alife_trader_abstract.rank


reputation() ​

ts
reputation(): number;

Returns ​

number

Trader reputation value.

Implementation of ​

cse_alife_trader_abstract.reputation


section_name() ​

ts
section_name<T>(): T;

Type Parameters ​

Type ParameterDefault type
T extends stringstring

Returns ​

T

Spawn section name.

Implementation of ​

cse_alife_trader_abstract.section_name

Inherited from ​

cse_alife_dynamic_object_visual.section_name


set_character_name() ​

ts
set_character_name(name: string): void;

Set localized character name.

Parameters ​

ParameterTypeDescription
namestringCharacter name.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.set_character_name


set_profile_name() ​

ts
set_profile_name(name: string): void;

Set character profile section name.

Parameters ​

ParameterTypeDescription
namestringProfile section name.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.set_profile_name


set_rank() ​

ts
set_rank(rank: number): void;

Set trader rank.

Parameters ​

ParameterTypeDescription
ranknumberNew rank value.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.set_rank


set_yaw() ​

ts
set_yaw(yaw: number): void;

Set object yaw.

Parameters ​

ParameterTypeDescription
yawnumberYaw angle.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.set_yaw

Inherited from ​

cse_alife_dynamic_object_visual.set_yaw


spawn_ini() ​

ts
spawn_ini(): Nullable<ini_file>;

Returns ​

Nullable<ini_file>

Spawn ini attached to this object, if any.

Implementation of ​

cse_alife_trader_abstract.spawn_ini

Inherited from ​

cse_alife_dynamic_object_visual.spawn_ini


STATE_Read() ​

ts
STATE_Read(packet: net_packet, size: number): void;

Read a state packet into this object.

Parameters ​

ParameterTypeDescription
packetnet_packetSource network packet.
sizenumberSerialized state size.

Returns ​

void

Remarks ​

Use only with packets written for the same server object class and state format.

Implementation of ​

cse_alife_trader_abstract.STATE_Read

Inherited from ​

cse_alife_dynamic_object_visual.STATE_Read


STATE_Write() ​

ts
STATE_Write(packet: net_packet): void;

Write a state packet from this object.

Parameters ​

ParameterTypeDescription
packetnet_packetTarget network packet.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.STATE_Write

Inherited from ​

cse_alife_dynamic_object_visual.STATE_Write


switch_offline() ​

ts
switch_offline(): void;

Mark the server object offline.

Returns ​

void

Source ​

src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::switch_offline.

Remarks ​

Requires the object to be online. The base implementation marks it offline, removes it from the online ALife set, and clears client data unless keep_saved_data_anyway() returns true.

Implementation of ​

cse_alife_trader_abstract.switch_offline

Inherited from ​

cse_alife_dynamic_object_visual.switch_offline


switch_online() ​

ts
switch_online(): void;

Mark the server object online.

Returns ​

void

Source ​

src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::switch_online.

Remarks ​

Requires the object to be offline. The base implementation marks it online and adds it to the online ALife set. Use the simulator switch manager for normal distance-based switching.

Implementation of ​

cse_alife_trader_abstract.switch_online

Inherited from ​

cse_alife_dynamic_object_visual.switch_online


update() ​

ts
update(): void;

Run the server-side ALife update for this object.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.update

Inherited from ​

cse_alife_dynamic_object_visual.update


UPDATE_Read() ​

ts
UPDATE_Read(packet: net_packet): void;

Read an update packet into this object.

Parameters ​

ParameterTypeDescription
packetnet_packetSource network packet.

Returns ​

void

Remarks ​

Use only with packets written for the same server object class and update format.

Implementation of ​

cse_alife_trader_abstract.UPDATE_Read

Inherited from ​

cse_alife_dynamic_object_visual.UPDATE_Read


UPDATE_Write() ​

ts
UPDATE_Write(packet: net_packet): void;

Write an update packet from this object.

Parameters ​

ParameterTypeDescription
packetnet_packetTarget network packet.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.UPDATE_Write

Inherited from ​

cse_alife_dynamic_object_visual.UPDATE_Write


use_ai_locations() ​

ts
use_ai_locations(value: boolean): void;

Enable or disable AI location graph use.

Parameters ​

ParameterTypeDescription
valuebooleanWhether AI locations should be used.

Returns ​

void

Implementation of ​

cse_alife_trader_abstract.use_ai_locations

Inherited from ​

cse_alife_dynamic_object_visual.use_ai_locations


used_ai_locations() ​

ts
used_ai_locations(): boolean;

Returns ​

boolean

Whether the object uses AI location graph data.

Implementation of ​

cse_alife_trader_abstract.used_ai_locations

Inherited from ​

cse_alife_dynamic_object_visual.used_ai_locations


visible_for_map() ​

Call Signature ​

ts
visible_for_map(): boolean;
Returns ​

boolean

Whether the object is visible on the map.

Implementation of ​

cse_alife_trader_abstract.visible_for_map

Inherited from ​

cse_alife_dynamic_object_visual.visible_for_map

Call Signature ​

ts
visible_for_map(value: boolean): void;

Set whether the object is visible on the map.

Parameters ​
ParameterTypeDescription
valuebooleanWhether the object should be shown on the map.
Returns ​

void

Implementation of ​

cse_alife_trader_abstract.visible_for_map

Inherited from ​

cse_alife_dynamic_object_visual.visible_for_map

Properties ​

__name ​

ts
readonly __name: string;

LuaBind instance constructor name.

Implementation of ​

cse_alife_trader_abstract.__name

Inherited from ​

cse_alife_dynamic_object_visual.__name


angle ​

ts
angle: vector;

Server-side orientation angles.

Implementation of ​

cse_alife_trader_abstract.angle

Inherited from ​

cse_alife_dynamic_object_visual.angle


id ​

ts
readonly id: number;

Server object id.

Implementation of ​

cse_alife_trader_abstract.id

Inherited from ​

cse_alife_dynamic_object_visual.id


m_game_vertex_id ​

ts
readonly m_game_vertex_id: number;

Game graph vertex used by ALife simulation.

Implementation of ​

cse_alife_trader_abstract.m_game_vertex_id

Inherited from ​

cse_alife_dynamic_object_visual.m_game_vertex_id


m_level_vertex_id ​

ts
readonly m_level_vertex_id: number;

Level graph vertex used by ALife simulation.

Implementation of ​

cse_alife_trader_abstract.m_level_vertex_id

Inherited from ​

cse_alife_dynamic_object_visual.m_level_vertex_id


m_story_id ​

ts
readonly m_story_id: number;

Always numeric value. Returns maximal u32 (4294967295) value if object has no story id.

Implementation of ​

cse_alife_trader_abstract.m_story_id

Inherited from ​

cse_alife_dynamic_object_visual.m_story_id


online ​

ts
readonly online: boolean;

Whether server object has client representation and is in online mode.

Implementation of ​

cse_alife_trader_abstract.online

Inherited from ​

cse_alife_dynamic_object_visual.online


parent_id ​

ts
readonly parent_id: number;

Parent server object id, or 65535 when there is no parent.

Implementation of ​

cse_alife_trader_abstract.parent_id

Inherited from ​

cse_alife_dynamic_object_visual.parent_id


position ​

ts
position: vector;

Server-side world position.

Implementation of ​

cse_alife_trader_abstract.position

Inherited from ​

cse_alife_dynamic_object_visual.position


script_version ​

ts
readonly script_version: number;

Script data version stored with this object.

Implementation of ​

cse_alife_trader_abstract.script_version

Inherited from ​

cse_alife_dynamic_object_visual.script_version


__name ​

ts
readonly static __name: string;

LuaBind class constructor name.

Implementation of ​

cse_alife_trader_abstract.__name

Inherited from ​

cse_alife_dynamic_object_visual.__name