Sandbox 2 Manual
ContentsIndexHome
PreviousUpNext
Game Nodes

Game Nodes

 

 

Game:ActorGetHealth

Description 

This node outputs the health of the target entity as an integer. 


In this example the health of the target entity is compared using a Math:Less node to check if the value is below 50. 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "Trigger" 
This port triggers the health output port. 
Outputs 
 
integer "Health" 
This port outputs the health of the target entity. 

 

Game:ActorCheckHealth

Description 

The Game:ActorCheckHealth node checks the health of an actor and outputs the result on a Boolean output port. 

A health range can be defined using the MinHealth and MaxHealth input ports. The target entity of this class needs to be an actor in order to work. When the node is triggered the health of the target entity is checked and if it is within the defined values true will be output on the output port. 


The health of an actor is checked by using the Game:ActorCheckHealth node and checking the Boolean output port using a Math:FromBoolean node. The input to the Math:FromBoolean node will be true if the health of the target entity is between 0 and 50. The Math:FromBoolean node then splits the Boolean input in to outputs to be passed on. 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "Trigger" 
The health is checked when this port is triggered. 
integer "MaxHealth" 
Defines the maximum amount of health to check for. 
integer "MinHealth" 
Defines the minimum amount of check for. 
Outputs 
 
bool "InRange" 
True is output on this port if the health of the target entity is within the defined limit. 

 

Game:DamageActor

Description 

The Game:DamageActor node is used to damage the AI characters or the player. The target of the node has to be an actor, it does not work with entities that are not based on an actor class. The amount of damage as well of the position where the damage will be applied can be defined. 


In this example the Game:ActorGetHealth node is used to get the health of the target entity. The health is divided by two and used as a damage value and trigger for the G ame:DamageActor node . 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "Trigger" 
Used to trigger the damage. 
integer "Damage" 
Defines the amount of damage. 
vector "Position" 
Defines the amount of damage. 
Outputs 
 
NA 

 

Game:PlayerStaging

Description 

The Game:PlayerStaging node is used to limit the controls of the player 


In this example the position output port is used with a Vec3:AddVec3 node to perform a simple vector operation. 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "Trigger" 
This port triggers the player staging. 
Outputs 
 
vector "Pos" 
Position of the entity is output on this port. 
vector "Rotate" 
Rotation of the entity is output on this port. 
vector "Scale" 
Scale of the entity is output on this port. 
vector "FwdDir" 
Direction of the Y axis of the entity is output on this port. 
vector "RightDir" 
Direction of the X axis of the entity is output on this port. 
vector "UpDir" 
Direction of the Z axis of the entity is output on this port. 

 

Game:LocalPlayer

Description 

The Game:LocalPlayer node is outputs the local player client ID in singleplayer games. It does not work in multiplayer games. 


In this example the ID of an entity entering a proximity trigger is compared to the local player ID using the Math:Equal node. 

 

Outputs 
integer "entityID" The ID of the local player. 

 

Game:ActorSensor

Description 

When enabled the Game:ActorSensor node outputs events on the output ports when the target entity of this node performs certain actions. The node has only two input ports for enabling and disabling it. When enabled the output ports will be triggered whenever a certain action happens. If the outputs are not needed, the node should be disabled to prevent any unnecessary outputs. Each port outputs an entity id or other information that can be used to determine which objects the target entity interacted with. 


This example shows how to check if the player entered a specific vehicle. The Game:ActorSensor node is enabled and outputs the vehicle Id when a vehicle is entered. The Math:Equal node compares this Id with the entityId of the entity ‘MyVehicle’ obtained from a Entity:EntityId node. 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "Enable" 
This port enables the node when triggered. 
any "Disable" 
This port disables the node when triggered. 
Outputs 
 
integer "EnterVehicle" 
The ID of the vehicle the target entity has entered. 
integer "ExitVehicle" 
The ID of the vehicle the target entity has exited. 
integer "SeatChange" 
The number of the seat in the vehicle the target entity has switched to. 
integer "ItemPickedUp" 
The ID of the entity that has been picked up by the target entity. 
integer "ItemDropped" 
The ID of the entity that has been dropped up by the target entity. 
integer "ItemUsed" 
The ID of the entity that has been used by the target entity. 
integer "NPCGrabbed" 
The ID of the entity that has been grabbed by the target entity. 
integer " NPCThrown" 
The ID of the entity that has been thrown by the target entity. 
integer " ObjectGrabbed" 
The ID of the entity that has been grabbed by the target entity. 
integer " ObjectThrown" 
The ID of the entity that has been thrown by the target entity. 
integer " StanceChanged" 
When the stance of the target entity changes the new stance is output: 
 
0: Stand 
 
1: Crouch 
 
2: Prone 
 
3: Relaxed 
 
4: Stealth 
 
5: Swim 
 
6: ZeroG 
integer "SpecialMove" 
When the target entity performs a special move this port will output: 
 
0: Jump 
 
1: Suitsprint 
 
2: Suitjump 
integer "OnDeath" 
When the target entity dies this port will be triggered. 

 

Game:SetVehicleAltitudeLimit

Description 

The Game:SetVehicleAltitudeLimit node set the global limit for how high a vehicles can fly in a level. This limit is absolute, so the height of the terrain needs to be taken into account. 


In this example the height limit for flying vehicles is set to 100m using the Game:SetVehicleAltitudeLimit node. 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "SetLimit" 
This port sets the new altitude limit for the level. 
float "Limit" 
This value will be set as the new altitude limit for the level. 
Outputs 
 
NA 

 

Game:DifficultyLevel

Description 

The Game:DifficultyLevel node outputs on one of the output ports depending on which difficulty is currently set. 


At the start of the level the Game:DifficultyLevel node is triggered using a Misc:Start node. If the difficulty is set to easy, the enemy ‘MyEnenmy_1’ will be spawned. For each higher difficulty setting up to hard one additional enemy will be spawned. 

 

integer "entityId" 
Used when changing the attached entity dynamically. Displays the name of the node. 
any "Trigger" 
This port triggers the output of difficulty level. 
Outputs 
 
any "Easy" 
This output port is triggers when the difficulty is set to easy. 
any "Normal" 
This output port is triggers when the difficulty is set to normal. 
any "Hard" 
This output port is triggers when the difficulty is set to hard. 
any "Delta" 
This output port is triggers when the difficulty is set to delta. 
Copyright © 2008 Crytek GmbH. All rights reserved.