Skip to content

Class: cse_alife_object

Base representation of any object on server side.

Source

C++ class cse_alife_object : cse_abstract

Custom Constructor

cse_alife_object

Remarks

Base ALife object registered in the simulator graph. Switching flags describe whether the simulator may move it between offline and online state.

Extends

Extended by

Constructors

Constructor

ts
new cse_alife_object(section: string): cse_alife_object;

Create an ALife object for a spawn section.

Parameters

ParameterTypeDescription
sectionstringSpawn section name.

Returns

cse_alife_object

Overrides

cse_abstract.constructor

Methods

can_save()

ts
can_save(): boolean;

Returns

boolean

Whether this object should be saved.


can_switch_offline()

Call Signature

ts
can_switch_offline(): boolean;
Returns

boolean

Whether this object may 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.


can_switch_online()

Call Signature

ts
can_switch_online(): boolean;
Returns

boolean

Whether this object may 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.


clsid()

ts
clsid(): TXR_class_id;

Returns

TXR_class_id

Engine class id.

Inherited from

cse_abstract.clsid


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

Inherited from

cse_abstract.FillProps


init()

ts
init(): cse_abstract;

Initialize the ALife object and return its abstract base.

Returns

cse_abstract

Initialized abstract entity.


interactive()

ts
interactive(): boolean;

Returns

boolean

Whether the object is interactive.


move_offline()

Call Signature

ts
move_offline(): boolean;
Returns

boolean

Whether the object should move while 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


name()

ts
name<T>(): T;

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Runtime object name.

Inherited from

cse_abstract.name


section_name()

ts
section_name<T>(): T;

Type Parameters

Type ParameterDefault type
T extends stringstring

Returns

T

Spawn section name.

Inherited from

cse_abstract.section_name


spawn_ini()

ts
spawn_ini(): Nullable<ini_file>;

Returns

Nullable<ini_file>

Spawn ini attached to this object, if any.

Inherited from

cse_abstract.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.

Inherited from

cse_abstract.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

Inherited from

cse_abstract.STATE_Write


update()

ts
update(): void;

Run the server-side ALife update for this object.

Returns

void


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.

Inherited from

cse_abstract.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

Inherited from

cse_abstract.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


used_ai_locations()

ts
used_ai_locations(): boolean;

Returns

boolean

Whether the object uses AI location graph data.


visible_for_map()

Call Signature

ts
visible_for_map(): boolean;
Returns

boolean

Whether the object is visible on the 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

Properties

__name

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from

cse_abstract.__name


angle

ts
angle: vector;

Server-side orientation angles.

Inherited from

cse_abstract.angle


id

ts
readonly id: number;

Server object id.

Inherited from

cse_abstract.id


m_game_vertex_id

ts
readonly m_game_vertex_id: number;

Game graph vertex used by ALife simulation.


m_level_vertex_id

ts
readonly m_level_vertex_id: number;

Level graph vertex used by ALife simulation.


m_story_id

ts
readonly m_story_id: number;

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


online

ts
readonly online: boolean;

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


parent_id

ts
readonly parent_id: number;

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

Inherited from

cse_abstract.parent_id


position

ts
position: vector;

Server-side world position.

Inherited from

cse_abstract.position


script_version

ts
readonly script_version: number;

Script data version stored with this object.

Inherited from

cse_abstract.script_version


__name

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from

cse_abstract.__name