Class: cse_alife_smart_zone
Server object binding for cse_alife_smart_zone.
Source
C++ class cse_alife_smart_zone : cse_alife_space_restrictor,cse_alife_schedulable
Custom Constructor
cse_alife_smart_zone
Remarks
Server-side smart terrain/zone hook. Base implementations may be placeholders; gameplay scripts usually work with concrete smart-terrain logic.
Extends
Implements
Constructors
Constructor
new cse_alife_smart_zone(section: string): cse_alife_smart_zone;Create an ALife object for a spawn section.
Parameters
| Parameter | Type | Description |
|---|---|---|
section | string | Spawn section name. |
Returns
cse_alife_smart_zone
Inherited from
cse_alife_space_restrictor.constructor
Methods
can_save()
can_save(): boolean;Returns
boolean
Whether this object should be saved.
Inherited from
cse_alife_space_restrictor.can_save
can_switch_offline()
Call Signature
can_switch_offline(): boolean;Returns
boolean
Whether this object may switch offline.
Inherited from
cse_alife_space_restrictor.can_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.
Inherited from
cse_alife_space_restrictor.can_switch_offline
can_switch_online()
Call Signature
can_switch_online(): boolean;Returns
boolean
Whether this object may switch online.
Inherited from
cse_alife_space_restrictor.can_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.
Inherited from
cse_alife_space_restrictor.can_switch_online
clsid()
clsid(): TXR_class_id;Returns
Engine class id.
Inherited from
cse_alife_space_restrictor.clsid
detect_probability()
detect_probability(): number;Returns
number
Probability used by the zone for detecting objects.
enabled()
enabled(monster: cse_alife_monster_abstract): boolean;Check whether this smart zone is enabled for a monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
monster | cse_alife_monster_abstract | Monster server object. |
Returns
boolean
Whether the zone can be used.
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
cse_alife_space_restrictor.FillProps
init()
init(): cse_abstract;Initialize the ALife object and return its abstract base.
Returns
Initialized abstract entity.
Inherited from
cse_alife_space_restrictor.init
interactive()
interactive(): boolean;Returns
boolean
Whether the object is interactive.
Inherited from
cse_alife_space_restrictor.interactive
keep_saved_data_anyway()
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.
Inherited from
cse_alife_space_restrictor.keep_saved_data_anyway
move_offline()
Call Signature
move_offline(): boolean;Returns
boolean
Whether the object should move while offline.
Inherited from
cse_alife_space_restrictor.move_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
Inherited from
cse_alife_space_restrictor.move_offline
name()
name<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Runtime object name.
Inherited from
cse_alife_space_restrictor.name
on_before_register()
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.
Inherited from
cse_alife_space_restrictor.on_before_register
on_register()
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.
Inherited from
cse_alife_space_restrictor.on_register
on_spawn()
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.
Inherited from
cse_alife_space_restrictor.on_spawn
on_unregister()
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.
Inherited from
cse_alife_space_restrictor.on_unregister
register_npc()
register_npc(monster: cse_alife_monster_abstract): void;Register a monster in the smart zone.
Parameters
| Parameter | Type | Description |
|---|---|---|
monster | cse_alife_monster_abstract | Monster server object. |
Returns
void
section_name()
section_name<T>(): T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Spawn section name.
Inherited from
cse_alife_space_restrictor.section_name
smart_touch()
smart_touch(monster: cse_alife_monster_abstract): void;Notify the smart zone that a monster touched it.
Parameters
| Parameter | Type | Description |
|---|---|---|
monster | cse_alife_monster_abstract | Monster server object. |
Returns
void
Remarks
The base implementation is empty; concrete smart zones can override behavior.
spawn_ini()
spawn_ini(): Nullable<ini_file>;Returns
Nullable<ini_file>
Spawn ini attached to this object, if any.
Inherited from
cse_alife_space_restrictor.spawn_ini
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
cse_alife_space_restrictor.STATE_Read
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
cse_alife_space_restrictor.STATE_Write
suitable()
suitable(monster: cse_alife_monster_abstract): number;Rate how suitable this smart zone is for a monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
monster | cse_alife_monster_abstract | Monster server object. |
Returns
number
Suitability score.
switch_offline()
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.
Inherited from
cse_alife_space_restrictor.switch_offline
switch_online()
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.
Inherited from
cse_alife_space_restrictor.switch_online
task()
task(monster: cse_alife_monster_abstract): Nullable<CALifeSmartTerrainTask>;Get the smart terrain task assigned to a monster.
Parameters
| Parameter | Type | Description |
|---|---|---|
monster | cse_alife_monster_abstract | Monster server object. |
Returns
Nullable<CALifeSmartTerrainTask>
Smart terrain task, or null when none is assigned.
unregister_npc()
unregister_npc(monster: cse_alife_monster_abstract): void;Remove a monster from the smart zone.
Parameters
| Parameter | Type | Description |
|---|---|---|
monster | cse_alife_monster_abstract | Monster server object. |
Returns
void
update()
update(): void;Run the server-side ALife update for this object.
Returns
void
Inherited from
cse_alife_space_restrictor.update
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
cse_alife_space_restrictor.UPDATE_Read
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
cse_alife_space_restrictor.UPDATE_Write
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
Inherited from
cse_alife_space_restrictor.use_ai_locations
used_ai_locations()
used_ai_locations(): boolean;Returns
boolean
Whether the object uses AI location graph data.
Inherited from
cse_alife_space_restrictor.used_ai_locations
visible_for_map()
Call Signature
visible_for_map(): boolean;Returns
boolean
Whether the object is visible on the map.
Inherited from
cse_alife_space_restrictor.visible_for_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
Inherited from
cse_alife_space_restrictor.visible_for_map
Properties
__name
readonly __name: string;LuaBind instance constructor name.
Inherited from
cse_alife_space_restrictor.__name
angle
angle: vector;Server-side orientation angles.
Inherited from
cse_alife_space_restrictor.angle
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.
Inherited from
cse_alife_space_restrictor.m_game_vertex_id
m_level_vertex_id
readonly m_level_vertex_id: number;Level graph vertex used by ALife simulation.
Inherited from
cse_alife_space_restrictor.m_level_vertex_id
m_story_id
readonly m_story_id: number;Always numeric value. Returns maximal u32 (4294967295) value if object has no story id.
Inherited from
cse_alife_space_restrictor.m_story_id
online
readonly online: boolean;Whether server object has client representation and is in online mode.
Inherited from
cse_alife_space_restrictor.online
parent_id
readonly parent_id: number;Parent server object id, or 65535 when there is no parent.
Inherited from
cse_alife_space_restrictor.parent_id
position
position: vector;Server-side world position.
Inherited from
cse_alife_space_restrictor.position
script_version
readonly script_version: number;Script data version stored with this object.
Inherited from
cse_alife_space_restrictor.script_version
__name
readonly static __name: string;LuaBind class constructor name.