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
new cse_alife_object(section: string): cse_alife_object;Create an ALife object for a spawn section.
Parameters
| Parameter | Type | Description |
|---|---|---|
section | string | Spawn section name. |
Returns
cse_alife_object
Overrides
Methods
can_save()
can_save(): boolean;Returns
boolean
Whether this object should be saved.
can_switch_offline()
Call Signature
can_switch_offline(): boolean;Returns
boolean
Whether this object may switch offline.
Call Signature
can_switch_offline(value: boolean): void;Allow or block switching offline.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether 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
can_switch_online(): boolean;Returns
boolean
Whether this object may switch online.
Call Signature
can_switch_online(value: boolean): void;Allow or block switching online.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether online switching is allowed. |
Returns
void
Remarks
Sets the object's switch-online flag; it does not switch the object immediately.
clsid()
clsid(): TXR_class_id;Returns
Engine class id.
Inherited from
FillProps()
FillProps(pref: string, items: prop_item_vec): void;Fill editor property rows for this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
pref | string | Property prefix. |
items | prop_item_vec | Property collection to populate. |
Returns
void
Inherited from
init()
init(): cse_abstract;Initialize the ALife object and return its abstract base.
Returns
Initialized abstract entity.
interactive()
interactive(): boolean;Returns
boolean
Whether the object is interactive.
move_offline()
Call Signature
move_offline(): boolean;Returns
boolean
Whether the object should move while offline.
Call Signature
move_offline(value?: boolean): void;Set whether the object should move while offline.
Parameters
| Parameter | Type | Description |
|---|---|---|
value? | boolean | Whether offline movement is enabled. |
Returns
void
name()
name<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Runtime object name.
Inherited from
section_name()
section_name<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Spawn section name.
Inherited from
spawn_ini()
spawn_ini(): Nullable<ini_file>;Returns
Nullable<ini_file>
Spawn ini attached to this object, if any.
Inherited from
STATE_Read()
STATE_Read(packet: net_packet, size: number): void;Read a state packet into this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
size | number | Serialized state size. |
Returns
void
Remarks
Use only with packets written for the same server object class and state format.
Inherited from
STATE_Write()
STATE_Write(packet: net_packet): void;Write a state packet from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
Inherited from
update()
update(): void;Run the server-side ALife update for this object.
Returns
void
UPDATE_Read()
UPDATE_Read(packet: net_packet): void;Read an update packet into this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
Returns
void
Remarks
Use only with packets written for the same server object class and update format.
Inherited from
UPDATE_Write()
UPDATE_Write(packet: net_packet): void;Write an update packet from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
Inherited from
use_ai_locations()
use_ai_locations(value: boolean): void;Enable or disable AI location graph use.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether AI locations should be used. |
Returns
void
used_ai_locations()
used_ai_locations(): boolean;Returns
boolean
Whether the object uses AI location graph data.
visible_for_map()
Call Signature
visible_for_map(): boolean;Returns
boolean
Whether the object is visible on the map.
Call Signature
visible_for_map(value: boolean): void;Set whether the object is visible on the map.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the object should be shown on the map. |
Returns
void
Properties
__name
readonly __name: string;LuaBind instance constructor name.
Inherited from
angle
angle: vector;Server-side orientation angles.
Inherited from
id
readonly id: number;Server object id.
Inherited from
m_game_vertex_id
readonly m_game_vertex_id: number;Game graph vertex used by ALife simulation.
m_level_vertex_id
readonly m_level_vertex_id: number;Level graph vertex used by ALife simulation.
m_story_id
readonly m_story_id: number;Always numeric value. Returns maximal u32 (4294967295) value if object has no story id.
online
readonly online: boolean;Whether server object has client representation and is in online mode.
parent_id
readonly parent_id: number;Parent server object id, or 65535 when there is no parent.
Inherited from
position
position: vector;Server-side world position.
Inherited from
script_version
readonly script_version: number;Script data version stored with this object.
Inherited from
__name
readonly static __name: string;LuaBind class constructor name.