Pre made Behaviors and Nodes - Terasology/Behaviors GitHub Wiki

This is a curated list with some of the more specialized Nodes and Behaviors that are available out of the box in different modules. Soon: new behaviors from GSoC 2019!

Module: Behaviors

Behaviors

You can find the premade behavior files in this folder.

Examples of these pre-made behaviors being used to create new creature behaviors can be found in this folder.

DoRandomMove

Short, utilitarian tree. When ran, finds a nearby block and moves towards it.

Stray

A basic tree for critters. The entity starts the Walk animation, executes the do_random_move tree, then waits a while in the Stand animation, then repeats. Results in randomly wandering mobs.

Follow

The entity finds the nearest player and moves towards them if they are within a minimum distance (using the set_target_to_followed_entity).

AttackFollowedEntity

The entity searches for a player to follow within a range. If it finds one, it attacks it using the damage_followed_entity action.

Hostile

This behavior uses the AttackFollowedEntity behavior and the check_attack_stop action. If the player is out of the critter's range, it will stop attacking.

Flee

The entity runs away from the player using the set_target_nearby_block_away_from_instigator action. A use for this might be if a critter is attacked, it might want to flee from its attacker.

Nodes

These nodes can be found in this folder.

Control Nodes

The target referred to in the following nodes is the target variable of the entity's MinionMoveComponent.

SetTargetLocalPlayerNode

Sets the target to the block the player is currently standing on.

SetTargetToNearbyBlockNode

Sets the target to a random reachable block near the entity.

Movement Nodes

FindPathToNode

Requests a path towards a block from the Pathfinding system. This Path will be saved as path in the entity's MinionMoveComponent.

RUNNING while the path is being searched for

SUCCESS once a path has been found

FAILURE if a path can't be found

MoveToNode

Moves to the target specified in MinionMoveComponent.

RUNNING while the actor is moving towards the target SUCCESS when the target is reached

MoveAlongPathNode

Moves along the path.

JumpNode

Triggers a single jump into the air.

RUNNING while the jump is in progress

SUCCESS once the actor lands

Sound Nodes

PlaySound

Properties: sound, volume

Plays a sound (wow, really?)

RUNNING: while the sound is playing

SUCCESS: once sound ends playing

FAILURE: otherwise

PlayMusic

Properties: music

Starts playing music

RUNNING: while music is playing

SUCCESS: once the music ends playing

FAILURE: otherwise