Difference between revisions of "HPL3/Amnesia: Rebirth/Scripting/Agents/Ghouls"

From Frictional Wiki
Jump to navigation Jump to search
(WIP - more mode funcs)
m (command section)
Line 126: Line 126:
  
 
A ghoul in hunt mode will be always hunting the player.
 
A ghoul in hunt mode will be always hunting the player.
 +
 +
TODO - Verify no hunt specific funcs
  
 
== eGhoulMode_StalkThroughHoles ==
 
== eGhoulMode_StalkThroughHoles ==
Line 144: Line 146:
 
== eGhoulMode_Trapped ==
 
== eGhoulMode_Trapped ==
  
 +
TODO - What is this?
  
 +
= Command Functions =
  
 +
TODO
  
 
= unsorted funcs =
 
= unsorted funcs =

Revision as of 09:01, 10 November 2020


Wip icon.png Basic overview of agent


Basic Overview

Map Configuration

Make sure any agents placed in your map are set to inactive. Activating them later via map script ensures that the agent can register itself with AgentBlackboard.

TODO

Scripting Setup

TODO

Modes vs Commands

Each mode contains a subset of behaviors. They define what the 'default' action for the agent should be and can be used to give different agents of the same type unique behaviors.

A command is an order issued to the agent independent of the current mode. They can be used to override the agents current action.

Unlike previous HPL titles, agents should only be commanded through modes (or commands) and NOT through changing the agent state.

General Functions

void Ghoul_Mode_Set(const tString &in asAgentName, eGhoulMode aMode, bool abForce = false)

Puts the ghoul into a mode, which determines its behavior when it's not reacting to the player's presence.

asAgentName: Name of the agent.
aMode: Which mode to put the ghoul in.
abForce: If true the ghoul will switch the behavior instantly regardless of state, otherwise it will do so more naturally on the next best opportunity.

Modes

eGhoulMode_Idle

This is the ghouls default mode. In this mode the ghoul will remain stationary when not reacting to the player.

TODO - Verify there are no idle specific functions.

eGhoulMode_Patrol

A ghoul in patrol mode will move to specified patrol path nodes when not reacting to the player.

Patrol Functions

void Ghoul_ModePatrol_Setup(const tString &in asAgentName, bool abRandom = false, eGhoulSpeed aSpeed = eGhoulSpeed_Walk)

Sets up the basic parameters for the ghoul's patrol mode.

asAgentName: Name of the agent.
abRandom: If nodes should be picked randomly, otherwise they will be picked in the order added.
aSpeed: The speed with which the ghoul will move.

void Ghoul_ModePatrol_AddNode(const tString &in asAgentName, const tString&in asNodeName, float afMinWaitTime = 0, float afMaxWaitTime= - 1,
								const tString &in asAnimName = "", bool abLoopAnim = false)

Adds a node to the list of nodes to patrol in patrol mode.

asAgentName: Name of the agent.
asNodeName: Name of the node.
afMinWaitTime: The minimum amount of time how long the ghoul should wait at this node.
afMaxWaitTime: The maximum amount of time how long the ghoul should wait at this node.
asAnimName: Name of the animation that should play when the ghoul reaches this node.
abLoopAnim If the animation should loop.

void Ghoul_ModePatrol_ClearNodes(const tString &in asAgentName)

Removes all the nodes from the patrol mode list.

asAgentName: Name of the agent.

void Ghoul_ModePatrol_SetSpeed(const tString &in asAgentName, eGhoulSpeed aSpeed = eGhoulSpeed_Walk)

Sets the speed of movement for the current patrol mode.

asAgentName: Name of the agent.
aSpeed: The speed with which the ghoul will move.

eGhoulMode_RandomWanderArea

A ghoul in the random wander area will move to random nodes within a specified area when not reacting to the player.

RandomWanderArea Functions

void Ghoul_ModeRandomWanderArea_Setup(const tString &in asAgentName, const cVector3f &in avAreaCenter, float afMinRadius, float afMaxRadius)

Makes the ghoul randomly wander inside a specified area.

asAgentName: Name of the agent.
avAreaCenter: The center of the area.
afMinRadius: The closest distance the nodes can be picked from.
afMaxRadius: The furthest distance the nodes can be picked from.

eGhoulMode_Guard

TODO - Guard mode overview TODO - Guard vs Enthralled

Guard Functions

void Ghoul_ModeGuard_Setup(const tString &in asAgentName, const tString &in asLookAtEntity, const tString &in asStandPosEntity, const tString &in asIdleAnim,
						   const tString &in asIdleSound, const tString &in asDisturbAnim, eGhoulSpeed aSpeedState = eGhoulSpeed_FastWalk)

Makes the ghoul enter the Guard state.

asAgentName: Name of the agent.
asLookAtEntity: Name of the entity to be turned toward.
asStandPosEntity: Name of the entity to stand at.
asIdleAnim: Name of the idle animation.
asIdleSound: Name of the sound entity placed in the map that will be played when guarding.
asDisturbAnim: Name of the disturbed animation.
aSpeedState: Speed state of the ghoul when moving to the stand pos.

eGhoulMode_Enthralled

A ghoul in enthralled mode will move to a specified location when not reacting to the player.

Enthralled Functions

void Ghoul_ModeEnthralled_Setup(const tString &in asAgentName, const tString &in asLookAtEntity, const tString &in asStandPosEntity, const tString &in asIdleAnim)

Puts the ghoul in the enthralled state.

asAgentName: Name of the agent.
asLookAtEntity: Name of the entity to be turned toward.
asStandPosEntity: Name of the entity to stand at.
asIdleAnim: Name of the idle animation.

eGhoulMode_Hunt

A ghoul in hunt mode will be always hunting the player.

TODO - Verify no hunt specific funcs

eGhoulMode_StalkThroughHoles

Mode behavior and functionality currently unknown.

StalkThroughHoles Functions

void Ghoul_ModeStalkThroughHoles_Setup(const tString &in asAgentName, const tString &in asHoleNetwork, const tString &in asPlayerPath = "", const tString &in asHoleConnections = "", bool abHideUntilDisturbed = false)

Sets up the basic parameters for the StalkThroughHoles mode.

asAgentName: Name of the agent.
asHoleNetwork: The name of the group of ghoul holes the ghoul should move between, use wildcard *.
asPlayerPath: The name of the group of nodes that represent the general path the player will take, used to determine if a hole is ahead or behind the player, use wildcard *.
asHoleConnections: The name of a group of areas that represent the connections between holes, the ghoul will move along these areas and make noise, use wildcard *.
abHideUntilDisturbed: If the ghoul shouldn't emerge unless the player makes noise.

eGhoulMode_Trapped

TODO - What is this?

Command Functions

TODO

unsorted funcs

Wip icon.png Temporary


/** * Puts a ghoul in the EatMeat state and destroys the specified meat. * * @param asAgentName, name of the agent * @param asMeatEntity, name of the meat to be destroyed **/ void Ghoul_EatMeat(const tString &in asAgentName, const tString &in asMeatEntity)