Class: CALifeHumanBrain
ALife human brain binding.
Source
C++ class CALifeHumanBrain : CALifeMonsterBrain
Custom Constructor
CALifeHumanBrain
Remarks
Human ALife brain with the same script-visible surface as CALifeMonsterBrain.
Extends
Constructors
Constructor
new CALifeHumanBrain(object: cse_alife_monster_abstract): CALifeHumanBrain;Create a brain for a monster server object.
Parameters
| Parameter | Type | Description |
|---|---|---|
object | cse_alife_monster_abstract | Monster server object. |
Returns
CALifeHumanBrain
Inherited from
CALifeMonsterBrain.constructor
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.
Inherited from
CALifeMonsterBrain.action_type
can_choose_alife_tasks()
Call Signature
can_choose_alife_tasks(): boolean;Returns
boolean
Whether this brain may choose ALife tasks.
Inherited from
CALifeMonsterBrain.can_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
Inherited from
CALifeMonsterBrain.can_choose_alife_tasks
default_behaviour()
default_behaviour(): void;Reset the brain to default no-path behavior.
Returns
void
Inherited from
CALifeMonsterBrain.default_behaviour
movement()
movement(): CALifeMonsterMovementManager;Returns
Offline movement manager.
Inherited from
object()
object(): cse_alife_monster_abstract;Returns
Owning monster server object.
Inherited from
on_location_change()
on_location_change(): void;Called when the owning monster changes graph location.
Returns
void
Inherited from
CALifeMonsterBrain.on_location_change
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.
Inherited from
CALifeMonsterBrain.on_register
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
Inherited from
CALifeMonsterBrain.on_state_read
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
Inherited from
CALifeMonsterBrain.on_state_write
on_switch_offline()
on_switch_offline(): void;Called when the owning monster switches offline.
Returns
void
Inherited from
CALifeMonsterBrain.on_switch_offline
on_switch_online()
on_switch_online(): void;Called when the owning monster switches online.
Returns
void
Inherited from
CALifeMonsterBrain.on_switch_online
on_unregister()
on_unregister(): void;Called when the owning monster is unregistered.
Returns
void
Remarks
Pair cleanup here with state installed from on_register.
Inherited from
CALifeMonsterBrain.on_unregister
perform_attack()
perform_attack(): boolean;Try to perform an offline attack.
Returns
boolean
Whether an attack was performed.
Inherited from
CALifeMonsterBrain.perform_attack
process_task()
process_task(): void;Process the currently selected ALife task.
Returns
void
Inherited from
CALifeMonsterBrain.process_task
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
Inherited from
CALifeMonsterBrain.select_task
smart_terrain()
smart_terrain(): cse_alife_smart_zone;Returns
Smart terrain assigned to the owner.
Inherited from
CALifeMonsterBrain.smart_terrain
update()
update(forced?: boolean): void;Update offline planning.
Parameters
| Parameter | Type | Description |
|---|---|---|
forced? | boolean | Whether the update should ignore regular throttling. |
Returns
void
Inherited from
update_script()
update_script(): void;Script-facing update hook.
Returns
void