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

From Frictional Wiki
Jump to navigation Jump to search
(Page creation - WIP)
 
(WIP - Started filling in mode specifications.)
Line 13: Line 13:
 
= Important Functions =
 
= Important Functions =
  
 +
<syntaxhighlight lang="c++">void Ghoul_Mode_Set(const tString &in asAgentName, eGhoulMode aMode, bool abForce = false)</syntaxhighlight>
 +
Puts the ghoul into a mode, which determines its behavior when it's not reacting to the player's presence.<br />
 +
 +
'''asAgentName''': Name of the agent.<br />
 +
'''aMode''': Which mode to put the ghoul in.<br />
 +
'''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.<br />
  
 
= Modes =
 
= Modes =
Line 25: Line 31:
  
 
== eGhoulMode_Patrol ==
 
== eGhoulMode_Patrol ==
 +
 +
A ghoul in patrol mode will move to specified patrol path nodes when not reacting to the player.
  
 
=== Patrol Functions ===
 
=== Patrol Functions ===
  
==== Ghoul_ModePatrol_ClearNodes ====
+
<syntaxhighlight lang="c++">void Ghoul_ModePatrol_Setup(const tString &in asAgentName, bool abRandom = false, eGhoulSpeed aSpeed = eGhoulSpeed_Walk)</syntaxhighlight>
 +
Sets up the basic parameters for the ghoul's patrol mode.<br />
  
* Clears nodes PLACEHOLDER
+
'''asAgentName''': Name of the agent.<br />
 +
'''abRandom''': If nodes should be picked randomly, otherwise they will be picked in the order added.<br />
 +
'''aSpeed''': The speed with which the ghoul will move.<br />
 +
 
 +
<syntaxhighlight lang="c++">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)</syntaxhighlight>
 +
Adds a node to the list of nodes to patrol in patrol mode.<br />
  
==== Ghoul_ModePatrol_AddNode ====
+
'''asAgentName''': Name of the agent.<br />
 +
'''asNodeName''': Name of the node.<br />
 +
'''afMinWaitTime''': The minimum amount of time how long the ghoul should wait at this node.<br />
 +
'''afMaxWaitTime''': The maximum amount of time how long the ghoul should wait at this node.<br />
 +
'''asAnimName''': Name of the animation that should play when the ghoul reaches this node.<br />
 +
'''abLoopAnim''' If the animation should loop.<br />
  
* Adds nodes PLACEHOLDER
+
 
 +
* Clears nodes PLACEHOLDER
  
 
== eGhoulMode_StalkThroughHoles ==
 
== eGhoulMode_StalkThroughHoles ==
  
 
== eGhoulMode_Hunt ==
 
== eGhoulMode_Hunt ==
 +
 +
A ghoul in hunt mode will be always hunting the player.
  
 
== eGhoulMode_Trapped ==
 
== eGhoulMode_Trapped ==
  
 
== eGhoulMode_Enthralled ==
 
== eGhoulMode_Enthralled ==
 +
 +
A ghoul in enthralled mode will move to a specific location when not reacting to the player.
  
 
== eGhoulMode_Guard ==
 
== eGhoulMode_Guard ==
  
 
== eGhoulMode_RandomWanderArea ==
 
== eGhoulMode_RandomWanderArea ==
 +
 +
A ghoul in the random wander area will move to random path nodes within a specified area when not reacting to the player.

Revision as of 07:37, 10 November 2020


Wip icon.png Basic overview of agent


Basic Setup

Map Configuration

Scripting Setup

Important 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

Wip icon.png Overview of the mode.


Idle Functions

Wip icon.png Mode 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.


  • Clears nodes PLACEHOLDER

eGhoulMode_StalkThroughHoles

eGhoulMode_Hunt

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

eGhoulMode_Trapped

eGhoulMode_Enthralled

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

eGhoulMode_Guard

eGhoulMode_RandomWanderArea

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