Skip to content

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 ​

ts
new CALifeHumanBrain(object: cse_alife_monster_abstract): CALifeHumanBrain;

Create a brain for a monster server object.

Parameters ​

ParameterTypeDescription
objectcse_alife_monster_abstractMonster server object.

Returns ​

CALifeHumanBrain

Inherited from ​

CALifeMonsterBrain.constructor

Methods ​

action_type() ​

ts
action_type(
   object: IXR_cse_alife_schedulable, 
   index: number, 
   mutual_detection: boolean): number;

Get the meet action type for another ALife object.

Parameters ​

ParameterTypeDescription
objectIXR_cse_alife_schedulableOther ALife schedulable object.
indexnumberRelation index.
mutual_detectionbooleanWhether both objects detected each other.

Returns ​

number

Meet action type id.

Inherited from ​

CALifeMonsterBrain.action_type


can_choose_alife_tasks() ​

Call Signature ​

ts
can_choose_alife_tasks(): boolean;
Returns ​

boolean

Whether this brain may choose ALife tasks.

Inherited from ​

CALifeMonsterBrain.can_choose_alife_tasks

Call Signature ​

ts
can_choose_alife_tasks(value: boolean): void;

Enable or disable ALife task selection.

Parameters ​
ParameterTypeDescription
valuebooleanNew task-selection state.
Returns ​

void

Inherited from ​

CALifeMonsterBrain.can_choose_alife_tasks


default_behaviour() ​

ts
default_behaviour(): void;

Reset the brain to default no-path behavior.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.default_behaviour


movement() ​

ts
movement(): CALifeMonsterMovementManager;

Returns ​

CALifeMonsterMovementManager

Offline movement manager.

Inherited from ​

CALifeMonsterBrain.movement


object() ​

ts
object(): cse_alife_monster_abstract;

Returns ​

cse_alife_monster_abstract

Owning monster server object.

Inherited from ​

CALifeMonsterBrain.object


on_location_change() ​

ts
on_location_change(): void;

Called when the owning monster changes graph location.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.on_location_change


on_register() ​

ts
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() ​

ts
on_state_read(packet: net_packet): void;

Read brain state from a network packet.

Parameters ​

ParameterTypeDescription
packetnet_packetSource network packet.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.on_state_read


on_state_write() ​

ts
on_state_write(packet: net_packet): void;

Write brain state to a network packet.

Parameters ​

ParameterTypeDescription
packetnet_packetTarget network packet.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.on_state_write


on_switch_offline() ​

ts
on_switch_offline(): void;

Called when the owning monster switches offline.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.on_switch_offline


on_switch_online() ​

ts
on_switch_online(): void;

Called when the owning monster switches online.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.on_switch_online


on_unregister() ​

ts
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() ​

ts
perform_attack(): boolean;

Try to perform an offline attack.

Returns ​

boolean

Whether an attack was performed.

Inherited from ​

CALifeMonsterBrain.perform_attack


process_task() ​

ts
process_task(): void;

Process the currently selected ALife task.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.process_task


select_task() ​

ts
select_task(forced?: boolean): void;

Select the next ALife task.

Parameters ​

ParameterTypeDescription
forced?booleanWhether task selection should ignore regular throttling.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.select_task


smart_terrain() ​

ts
smart_terrain(): cse_alife_smart_zone;

Returns ​

cse_alife_smart_zone

Smart terrain assigned to the owner.

Inherited from ​

CALifeMonsterBrain.smart_terrain


update() ​

ts
update(forced?: boolean): void;

Update offline planning.

Parameters ​

ParameterTypeDescription
forced?booleanWhether the update should ignore regular throttling.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.update


update_script() ​

ts
update_script(): void;

Script-facing update hook.

Returns ​

void

Inherited from ​

CALifeMonsterBrain.update_script