Menu
Lumberyard
Developer Guide (Version 1.12)

ScriptBind_Action

CryLua is deprecated and will be removed in a future version of Lumberyard.

Lists the action related Lua script bind functions. When parameters are present, the data types indicated in the signatures reflect those of the underlying C++ function.

ActivateEffect

Activates the effect specified.

Syntax

Action.ActivateEffect(const char * name)

Parameter Description
name Specifies the effect to activate.

ActivateExtensionForGameObject

Activates a specified extension for a game object.

Syntax

Action.ActivateExtensionForGameObject(ScriptHandle entityId, const char *extension, bool activate)

Parameter Description
entityId The identifier of the entity.
extension The name of the extension.
activate Specify true to activate the extension or false to deactivate it.

AddAngleSignal

Adds an angle for the signal.

Syntax

Action.AddAngleSignal(ScriptHandle entityId, float fAngle, float fFlexibleBoundary, const char *sSignal)

Parameter Description
entityId The identifier of the entity.
fAngle The angle value.
fFlexibleBoundary The size of the flexible boundary.
sSignal The string for the signal.

AddRangeSignal

Adds a range for the signal.

Syntax

Action.AddRangeSignal(ScriptHandle entityId, float fRadius, float fFlexibleBoundary, const char *sSignal)

Parameter Description
entityId The identifier of the entity.
fRadius The adius of the range area.
fFlexibleBoundary Flexible boundary size.
sSignal String for signal.

AddTargetRangeSignal

Adds a target range signal that has the parameters specified.

Syntax

Action.AddTargetRangeSignal(ScriptHandle entityId, ScriptHandle targetId, float fRadius, float fFlexibleBoundary, const char *sSignal)

Parameter Description
entityId The identifier of the entity.
targetId The identifier of the target.
fRadius The radius of the range area.
fFlexibleBoundary The size of the flexible boundary.
sSignal The string for the signal.

BanPlayer

Bans a specified player.

Syntax

Action.BanPlayer(ScriptHandle entityId, const char* message)

Parameter Description
entityId The identifier of the entity.
message The message for the ban.

BindGameObjectToNetwork

Binds a specifed game object to the network.

Syntax

Action.BindGameObjectToNetwork(ScriptHandle entityId)

Parameter Description
entityId The identifier of the entity to bind to the network.

CacheItemGeometry

Caches an item geometry.

Syntax

Action.CacheItemGeometry(const char *itemName)

Parameter Description
itemName The string name of the item.

CacheItemSound

Caches an item sound.

Syntax

Action.CacheItemSound(const char *itemName)

Parameter Description
itemName The string name of the item.

ClearEntityTags

Clears the tag for the specified entity.

Syntax

Action.ClearEntityTags(ScriptHandle entityId)

Parameter Description
entityId The identifier of the entity.

ClearStaticTag

Clears the specified static tag for the specified entity.

Syntax

Action.ClearStaticTag(ScriptHandle entityId, const char *staticId)

Parameter Description
entityId The identifier of the entity.
staticId The identifier of the static tag.

ConnectToServer

Connects to the server specified.

Syntax

Action.ConnectToServer(char* server)

Parameter Description
server String that specifies the server to connect to.

CreateGameObjectForEntity

Creates a game object for the entity ID specified.

Syntax

Action.CreateGameObjectForEntity(ScriptHandle entityId)

Parameter Description
entityId The identifier of the entity.

DestroyRangeSignaling

Removes range signaling.

Syntax

Action.DestroyRangeSignaling(ScriptHandle entityId)

Parameter Description
entityId The identifier of the entity.

DisableSignalTimer

Disables the signal timer.

Syntax

Action.DisableSignalTimer(ScriptHandle entityId, const char *sText)

Parameter Description
entityId The identifier of the entity.
sText The text for the signal.

DontSyncPhysics

Instructs the engine to not synchronize physics for the specified entity.

Syntax

Action.DontSyncPhysics(ScriptHandle entityId)

Parameter Description
entityId The identifier of the entity.

EnableRangeSignaling

Enables or disables range signaling for the specified entity.

Syntax

Action.EnableRangeSignaling(ScriptHandle entityId, bool bEnable)

Parameter Description
entityId The identifier of the entity.
bEnable Enable or disable range signaling.

EnableSignalTimer

Enables the signal timer.

Syntax

Action.EnableSignalTimer(ScriptHandle entityId, const char *sText)

Parameter Description
entityId The identifier of the entity.
sText The text for the signal.

ForceGameObjectUpdate

Forces the game object to be updated.

Syntax

Action.ForceGameObjectUpdate(ScriptHandle entityId, bool force)

Parameter Description
entityId The identifier of the entity.
force Specify true to force the update; specify false otherwise.

GetClassName

Returns the class name, if available, for specified classId.

Syntax

Action.GetClassName(int classId)

GetPlayerList

Retrieves the current players list.

Syntax

Action.GetPlayerList()

GetServer

Gets the server that corresponds to the number specified.

Syntax

Action.GetServer(int number)

Parameter Description
number The number of the server.

GetServerTime

Gets the current time on the server.

Syntax

Action.GetServerTime()

GetWaterInfo

Gets information about the water at the position specified.

Syntax

Action.GetWaterInfo(Vec3 pos)

Parameter Description
pos The position for which information will be returned.

HasAI

Returns true if the entity has an AI object associated with it and has been registered with the AI System

Syntax

Action.HasAI(ScriptHandle entityId)

IsChannelOnHold

Checks if the channel specified is on hold.

Syntax

Action.IsChannelOnHold(int channelId)

Parameter Description
channelId The identifier of the channel.

IsChannelSpecial

Returns true if the channel is special.

Syntax

Action.IsChannelSpecial()

IsClient

Returns true if the current script runs on a client.

Syntax

Action.IsClient()

IsGameObjectProbablyVisible

Returns true if the specifed object is likely visible.

Syntax

Action.IsGameObjectProbablyVisible(ScriptHandle gameObject)

Parameter Description
gameObject The game object to check for likely visibilty.

IsGameStarted

Returns true if the game has started.

Syntax

Action.IsGameStarted()

IsImmersivenessEnabled

Returns true if immersive multiplayer is enabled.

Syntax

Action.IsImmersivenessEnabled()

IsRMIServer

Returns true if the current script is running on an RMI (Remote Method Invocation) server.

Syntax

Action.IsRMIServer()

IsServer

Returns true if the current script runs on a server.

Syntax

Action.IsServer()

LoadXML

Loads XML data from the file specified. For more information, see Using the Lua XML Loader.

Syntax

Action.LoadXML(const char * definitionFile, const char * dataFile)

Parameter Description
definitionFile Name of an XML file that declares the kind of data that is included in dataFile.
dataFile The name of the XML file that contains the Lua data described in definitionFile.

PauseGame

Puts the game into pause mode.

Syntax

Action.PauseGame(bool pause)

Parameter Description
pause Specify true to set the game in pause mode. Specify false to resume the game.

Persistent2DText

Adds persistent 2D text.

Syntax

Action.Persistent2DText(const char* text, float size, Vec3 color, const char* name, float timeout)

Parameter Description
text The text to be displayed.
size The size of the 2D text.
color The color of the 2D text.
name The name assigned to the 2D text.
timeout The timeout for the 2D text.

PersistentArrow

Adds a persistent arrow to the world.

Syntax

Action.PersistentArrow(Vec3 pos, float radius, Vec3 dir, Vec3 color, const char* name, float timeout)

Parameter Description
pos The position of the arrow.
radius The radius of the arrow.
dir The direction of the arrow.
color The color of the arrow.
name The name assigned to the arrow.
timeout The timeout for the arrow.

PersistentEntityTag

Adds a persistent entity tag.

Syntax

Action.PersistentEntityTag(ScriptHandle entityId, const char *text)

Parameter Description
entityId The identifier of the entity.
text The text for the entity tag.

PersistentLine

Adds a persistent line to the world.

Syntax

Action.PersistentLine(Vec3 start, Vec3 end, Vec3 color, const char* name, float timeout)

Parameter Description
start The starting position of the line.
end The ending position of the line.
color The color of the line.
name The name assigned to the line.
timeout The timeout for the line.

PersistentSphere

Adds a persistent sphere to the world.

Syntax

Action.PersistentSphere(Vec3 pos, float radius, Vec3 color, const char* name, float timeout)

Parameter Description
pos The position of the sphere.
radius The radius of the sphere.
color The color of the sphere.
name The name assigned to the sphere.
timeout The timeout for the sphere.

PreLoadADB

Use this function to pre-cache ADB files.

Syntax

Action.PreLoadADB(const char* adbFileName)

Parameter Description
adbFileName The path and filename of the animation ADB file which is to be pre-loaded.

RefreshPings

Refreshes pings for all servers.

Syntax

Action.RefreshPings()

RegisterWithAI

Registers the entity to the AI system and creates an AI object associated with it.

Syntax

Action.RegisterWithAI()

ResetRangeSignaling

Resets range signaling.

Syntax

Action.ResetRangeSignaling(ScriptHandle entityId)

Parameter Description
entityId The identifier of the entity.

ResetSignalTimer

Resets the rate for the signal timer.

Syntax

Action.ResetSignalTimer(ScriptHandle entityId, const char *sText)

Parameter Description
entityId The identifier of the entity.
sText Th text for the signal.

ResetToNormalCamera

Resets the camera to the last valid view stored.

Syntax

Action.ResetToNormalCamera()

SaveXML

Saves the specified XML data to the file system.

Syntax

Action.SaveXML(const char * definitionFile, const char * dataFile, SmartScriptTable dataTable)

Parameter Description
definitionFile Name of an XML file that declares the kind of data that is included in dataFile. For more information, see Using the Lua XML Loader.
dataFile The name of the XML file that contains the Lua data described in definitionFile.
dataTable The name of the data table.

SendGameplayEvent

Sends an event for the gameplay.

Syntax

Action.SendGameplayEvent(ScriptHandle entityId, int event)

Parameter Description
entityId The identifier of the entity.
event The integer of the event.

SetAimQueryMode

Sets the aim query mode for the AI proxy. By default, the AI proxy queries the movement controller if the character is aiming. You can override this behavior by using a different keyword for the mode parameter.

Syntax

Action.SetAimQueryMode(ScriptHandle entityId, int mode)

Parameter Description
entityId The identifier of the entity.
mode Specifies one of the following values: QueryAimFromMovementController (the default), OverriddenAndAiming, or OverriddenAndNotAiming

SetNetworkParent

Sets the network parent.

Syntax

Action.SetNetworkParent(ScriptHandle entityId, ScriptHandle parentId)

Parameter Description
entityId The identifier of the entity.
parentID The identifier of the parent network.

SetSignalTimerRate

Sets the rate for the signal timer.

Syntax

Action.SetSignalTimerRate(ScriptHandle entityId, const char *sText, float fRateMin, float fRateMax)

Parameter Description
entityId The identifier of the entity.
sText The text for the signal.
fRateMin The minimum rate for the signal timer.
fRateMax The maximum rate for the signal timer.

SetViewCamera

Saves the previous valid view and overrides it with the current camera settings.

Syntax

Action.SetViewCamera()