Class: CALifeMonsterBrain
Offline ALife brain for monster server objects.
Source
C++ class CALifeMonsterBrain
Custom Constructor
CALifeMonsterBrain
Remarks
Belongs to an offline monster server object. Do not use it with client-side game_object instances.
Extended by
Constructors
Constructor
new CALifeMonsterBrain(object: cse_alife_monster_abstract): CALifeMonsterBrain;Create a brain for a monster server object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | cse_alife_monster_abstract | Monster server object. |
Returns
CALifeMonsterBrain
Methods
action_type()
action_type(
object: IXR_cse_alife_schedulable,
index: number,
mutual_detection: boolean): number;Get the meet action type for another ALife object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | IXR_cse_alife_schedulable | Other ALife schedulable object. |
index | number | Relation index. |
mutual_detection | boolean | Whether both objects detected each other. |
Returns
number
Meet action type id.
can_choose_alife_tasks()
Call Signature
can_choose_alife_tasks(): boolean;Returns
boolean
Whether this brain may choose ALife tasks.
Call Signature
can_choose_alife_tasks(value: boolean): void;Enable or disable ALife task selection.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | New task-selection state. |
Returns
void
default_behaviour()
default_behaviour(): void;Reset the brain to default no-path behavior.
Returns
void
movement()
movement(): CALifeMonsterMovementManager;Returns
Offline movement manager.
object()
object(): cse_alife_monster_abstract;Returns
Owning monster server object.
on_location_change()
on_location_change(): void;Called when the owning monster changes graph location.
Returns
void
on_register()
on_register(): void;Called when the owning monster is registered.
Returns
void
Remarks
Follows the owning server object's on_register lifecycle. It can run during savegame load or ALife update setup, so treat it as repeatable.
on_state_read()
on_state_read(packet: net_packet): void;Read brain state from a network packet.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
Returns
void
on_state_write()
on_state_write(packet: net_packet): void;Write brain state to a network packet.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
on_switch_offline()
on_switch_offline(): void;Called when the owning monster switches offline.
Returns
void
on_switch_online()
on_switch_online(): void;Called when the owning monster switches online.
Returns
void
on_unregister()
on_unregister(): void;Called when the owning monster is unregistered.
Returns
void
Remarks
Pair cleanup here with state installed from on_register.
perform_attack()
perform_attack(): boolean;Try to perform an offline attack.
Returns
boolean
Whether an attack was performed.
process_task()
process_task(): void;Process the currently selected ALife task.
Returns
void
select_task()
select_task(forced?: boolean): void;Select the next ALife task.
Parameters
| Parameter | Type | Description |
|---|---|---|
forced? | boolean | Whether task selection should ignore regular throttling. |
Returns
void
smart_terrain()
smart_terrain(): cse_alife_smart_zone;Returns
Smart terrain assigned to the owner.
update()
update(forced?: boolean): void;Update offline planning.
Parameters
| Parameter | Type | Description |
|---|---|---|
forced? | boolean | Whether the update should ignore regular throttling. |
Returns
void
update_script()
update_script(): void;Script-facing update hook.
Returns
void