Menu
Lumberyard
Legacy Reference

AI Nodes

Flow Graph is deprecated and will be removed in a future version of Lumberyard. Learn about Script Canvas, Lumberyard's new visual scripting environment.

This topic references tools and features that are legacy. If you want to use legacy tools in Lumberyard Editor, disable the CryEntity Removal gem using the Project Configurator or the command line. To learn about the latest features, see the Amazon Lumberyard User Guide.

You can use these flow graph nodes to configure AI agent behaviors and settings.

Note

These nodes will only work with the Legacy Game Sample (CryEngine GameSDK), which is available at Lumberyard Downloads.

ActionAbort node

Used to define a "clean-up" procedure that is run when an AI action is aborted.

Inputs

Port Type Description
Abort Any Cancels execution of AI action

Outputs

Port Type Description
UserId Any ID of agent that is performing the action
ObjectId Any ID of the object on which the agent is executing

ActiveCount node

Used to count how many AI agents are active.

Outputs

Port Type Description
Total Integer Number of active agents
Enemy Integer Number of enemies

ActionEnd node

Used to end an AI action.

Inputs

Port Type Description
End Any Ends the AI action
Cancel Any Cancels the action

ActionStart node

Used to start an AI action.

Outputs

Port Type Description
UserId Any ID of agent that is performing the action
ObjectId Any ID of the object on which the agent is executing
Position Vec3 Position of the object

ActiveCountInFaction node

Used to count how many AI factions are active.

Inputs

Port Type Description
Faction String Factions to be counted
IncludedHumanPlayers Boolean Include human players when counting active AI agents in the faction

Outputs

Port Type Description
Count Integer Number of active agents in the faction
Changed Any Trigger for changes in the number of active agents

ActiveCountMonitor node

Used to monitor the active AI count against a limit and then periodically output the current state. When the condition is met, the monitor loop will stop automatically. This will then need to be restarted manually.

Inputs

Port Type Description
Start Any Starts monitoring
Stops Any Stops monitoring
MaxActiveAIs Integer Maximum number of active AIs
Loop Boolean Enables loop monitoring
LoopPeriod Float Period of time between checks if Loop is enabled

Outputs

Port Type Description
SlotsFree Any Triggers when the number of active agents drops below MaxActiveAIs
SlotsFull Any Triggers when the number of active agents is equal to or above MaxActiveAIs
CurrentActiveAIs Integer Current number of active AI agents

AIGlobalPerceptionScaling node

Used to specify a global scale for AI perception.

Inputs

Port Type Description
Enable Any Enables perception scaling
Disable Any Disables perception scaling
AudioScale Float Auditory perception scaling factor
VisualScale Float Visual perception scaling factor
FilterAI Integer Filter which AI agents are used
Faction String Faction

Outputs

Port Type Description
Enabled Any Triggers when node is enabled
Disabled Any Triggers when node is disabled

AlertMe node

A generic AI signal.

Inputs

Port Type Description
Sync Any Generic AI signal

AttentionTarget node

Used to output an AI agent's attention target.

Inputs

Port Type Description
Active Boolean Activates the node

Outputs

Port Type Description
Pos Vec3 Position of the attention target
EntityId Any Entity ID of attention target
None Any Triggers when there is no attention target

AutoDisable node

Used to control auto-disabling.

Inputs

Port Type Description
On Any Enables autodisabling
Off Any Disables autodisabling

Communication node

Used to specify the communication that an AI agent plays.

Inputs

Port Type Description
Start Any Starts communication
Stop Any Stops communication
Communication String Name of communication to play
Channel String Name of channel to play the communications in
ContextExpirity Float Time that must elapse before communication can be played again
SkipSound Boolean Skips sound component
SkipAnim Boolean Skips animation component
TargetId Any (Optional) Target ID to play communication at
TargetPos Vec3 (Optional) Target position to play communication at

Outputs

Port Type Description
Done Any Triggered when communication has finished playing
Started Any Triggers if communication has started
Stopped Any Triggers if communication has stopped
Finished Any Triggers if communication has finished playing
Fail Any Triggers if communication has failed

EventListener node

Used to listen for an event.

Inputs

Port Type Description
Pos Vec3 Position of the listener
Radius Float Listening radius of the listener
ThresholdSound Float Sensitivity of the sound output
ThresholdCollision Float Sensitivity of the collision output
ThresholdBullet Float Sensitivity of the bullet output
ThresholdExplosion Float Sensitivity of the explosion output

Outputs

Port Type Description
Sound Any Trigger for a sound event
Collision Any Trigger for a collision event
Bullet Any Trigger for a bullet event
Explosion Any Trigger for an explosion event

Execute node

Used to execute an AI action.

Inputs

Port Type Description
Sync Any Activates the node
Cancel Any Cancels the operation
ObjectId Any ID of the entity that receives the action that is executed
Action String Action to be executed
MaxAlertness Integer Maximum alertness that allows execution
HighPriority Boolean Action priority level
Force Integer Force execution method

Outputs

Port Type Description
Done Any Triggers when the action has been executed
Succeed Any Triggers if the action has been executed
Fail Any Triggers if the action has not been executed

Faction node

Used to trigger an AI faction.

Inputs

Port Type Description
Trigger Any Tiggers the output
Faction String Name of faction to trigger

Outputs

Port Type Description
Faction String Outputs the faction that was triggered

FactionReaction node

Used to set or get AI faction reaction information.

Inputs

Port Type Description
Source String Source faction
Target String Target faction
Reaction Integer Source faction reaction to target faction
Get Any Gets the faction reaction and triggers output
Set Any Sets the faction reaction and triggers output

Outputs

Port Type Description
Neutral Boolean Triggers if source faction reaction to target faction is neutral
Friendly Boolean Triggers if source faction reaction to target faction is friendly
Hostile Boolean Triggers if source faction reaction to target faction is hostile

GroupAlertness node

Used to output the alertness level of any AI agent in a group.

Inputs

Port Type Description
GroupId Integer ID of group to set alertness level for

Outputs

Port Type Description
Alertness Integer Alertness level of the group
Green Any Trigger for green alertness level
Orange Any Trigger for orange alertness level
Red Any Trigger for red alertness level
PlayerSighted Any Triggers if the player has been sighted

GroupCount node

Used to output the AI agent count in a group.

Inputs

Port Type Description
GroupId Integer Agent group ID

Outputs

Port Type Description
Count Integer Number of agents in the group
Empty Any Triggers if no agents are in the group

GroupIDGet node

Used to output the group ID for an AI agent.

Inputs

Port Type Description
Sync Any Triggers the output
GroupId Integer Group ID

Outputs

Port Type Description
GroupId Integer Outputs agent group ID

GroupIDSet node

Used to set the group ID for an AI agent.

Inputs

Port Type Description
Sync Any Triggers the output
FromId Integer The group to be merged
ToId Integer The group to merge to
EnabledFromGroup Boolean Enables members of the FromID group

IgnoreState node

Used to make an AI agent ignore enemies or to be ignored.

Inputs

Port Type Description
Hostile Any Activates the node
Ignore Any Agent ignores enemies
ResetPerception Any Resets Ignore state

IsAliveCheck node

Used to check which AI actors of a group are active.

Inputs

Port Type Description
Trigger Any Triggers the node
Actor 0 - 7 Any Specific actors to check

Outputs

Port Type Description
AliveCount Integer Number of actors that are alive
AliveId0 - 7 Any Triggers if specific actor is alive

LookAt node

Used to make an AI agent look at a specific location, an entity, or a direction.

Inputs

Port Type Description
Sync Any Activates the node
Cancel Any Cancels the operation
Point Vec3 Point for agent to look at
Direction Vec3 Direction for agent to look along
ObjectId Any ID of object for agent to look at
Duration Float Time in seconds for agent to look
Force Integer Force execution method

Outputs

Port Type Description
Done Any Triggers when agent is done looking
Succeed Any Triggers if agent is looking
Fail Any Triggers if agent is not looking

NavCostFactor node

Used to set the AI navigation cost factor for traveling through a region.

Inputs

Port Type Description
Sync Any Activates the node
Factor Float Navigation cost factor
NavModifierName String Name of the cost factor navigation modifier

Outputs

Port Type Description
Done Integer Triggers when cost factor for travelling through a region has been set

ObjectDrop node

Used to have an AI agent drop a grabbed object.

Inputs

Port Type Description
Sync Any Activates the node
Cancel Any Cancels the operation
Impulse Vec3 Impulse strength for dropping object
Force Integer Force execution method

Outputs

Port Type Description
Done Any Triggers when object has been dropped
Succeed Any Triggers if object is dropped
Fail Any Triggers if object is not dropped

ObjectGrab node

Used to make an AI agent grab an object.

Inputs

Port Type Description
Sync Any Activates the node
Cancel Any Cancels the operation
ObjectId Any Object to be grabbed
Force Integer Force execution method

Outputs

Port Type Description
Done Any Triggers when object has been grabbed
Succeed Any Triggers if object is grabbed
Fail Any Triggers if object is not grabbed

ObjectUse node

Used to make an AI agent use an object.

Inputs

Port Type Description
Sync Any Activates the node
Cancel Any Cancels the operation
ObjectId Any Object to be used
Force Integer Force execution method

Outputs

Port Type Description
Done Any Triggers when object has been used
Succeed Any Triggers if object is used
Fail Any Triggers if object is not used

PerceptionScale node

Used to scale the perception for an AI agent.

Inputs

Port Type Description
Trigger Any Triggers the node
Visual Float Visual perception scale factor
Audio Float Auditory perception scale factor

RayCastMNM node

Performs a raycast to the AI multilayer navigation mesh relative to an entity.


                RayCaseMNM node

Inputs

Port Type Description
Choose Entity Any Changes the attached entity dynamically
Activate Any Triggers the node
Direction Vec3 The direction of the raycast
MaxLength Float The maximum length of the raycast
Position Vec3 The ray start position, relative to the entity
TransformDirection Boolean Whether the direction is transformed by entity orientation

Outputs

Port Type Description
NoHit Any Activated if no object was hit by the raycast
Hit Any Activated if an object was hit by the raycast
RayDirection Vector Actual direction of the cast ray, possibly transformed by entity rotation (assumes Hit)
HitDistance Float Distance to the hit object (assumes Hit)
HitPoint Vector Position of the hit (assumes Hit)
MeshId Integer The mesh ID of the navigation mesh hit

RegenerateMNM node

Used to regenerate the AI multi-navigation mesh.

Inputs

Port Type Description
Start Any Triggers recalculation of MNM data for the bounding box
Min Vec3 Minimum limit of bounding box
Max Vec3 Maximum limit of bounding box

RequestReinforcementReadability node

Used to make an AI agent request reinforcements. There is no guarantee that the action will be performed however.

Inputs

Port Type Description
Trigger Any Triggers the node
GroupId Integer ID of the group that is notified

Outputs

Port Type Description
Done Any Triggers when group has been notified

SetCommunicationVariable node

Used to set the communication variable that an AI agent uses to communicate their intentions.

Inputs

Port Type Description
Set Any Sets the variable
VariableName String Variable to be set
VariableValue Boolean Value of variable

SetFaction node

Used to set the faction that an AI agent belongs to.

Inputs

Port Type Description
Faction String Faction to be set
SetToDefault Boolean Set to default faction
Set Any Sets the faction for the agent

SetState node

Used to set the Smart Object state for an AI agent.

Inputs

Port Type Description
Sync Any Activates the node
State String Smart object state to be set

Outputs

Port Type Description
Done Any Triggers when state has been set
Succeed Any Triggers if state has been set
Fail Any Triggers if state has not been set

ShapeState node

Use to enable or disable an AI shape.

Inputs

Port Type Description
Enable Any Enables the AI shape
Disable Any Disables the AI shape
ShapeName String Name of the AI shape

Signal node

Sends an AI agent a signal.

Inputs

Port Type Description
Sync Any Activates the node
Signal String Name of the signal to be sent
PosValue Vec3 Position value 1 of the signal
PosValue2 Vec3 Position value 2 of the signal
IValue Integer Integer value of the signal
FValiue Float Floating point value of the signal
SValue String String value of the signal
Id Any ID of the signal
Force Boolean Force execution method

Outputs

Port Type Description
Done Any Triggers when the signal has been sent
Succeed Any Triggers if the signal is sent
Fail Any Triggers if the signal is not sent

SmartObjectEvent node

Used to trigger a smart object event.

Inputs

Port Type Description
Event String Smart object event to be triggered
Trigger Any Triggers the event
UserId Any Limits event to specific user ID
ObjectId Any Limits event to specific object

Outputs

Port Type Description
UserId Any ID of the user that receives the event
ObjectId Any ID of the object that receives the event
Start Any Triggers if matching rule is found
NoRule Any Triggers if no matching rule is found

SmartObjectHelper node

Used to output an AI agent's attention target parameter.

Inputs

Port Type Description
Class String Class of smart object helper
Helper String Name of smart object helper

Outputs

Port Type Description
Pos Vec3 Position of smart object helper
Fwd Vec3 Forward direction of smart object helper
Up Vec3 Up direction of smart object helper

Stance node

Used to control an AI agent's body stance.

Inputs

Port Type Description
Sync Any Activates the node
Stance Integer Body stance of the agent

Outputs

Port Type Description
Done Any Triggers when body stance has been completed
Succeed Any Triggers if stance has changed
Fail Any Triggers if stance has not changed