Skyline Lua API  Version 1.0
Lua Script Reference for Skyline Game Engine.
action Class Reference

#include <LUA_API_Action.h>

Public Member Functions

int getActionID (int entityID, string actionName)
 Get the Id of the action with the string arg of actionName. More...
 
string getActionParam (int entityID, int actionID, string actionParam)
 Get the property value from any entity Action. For use in script to control elements of your game. More...
 
void setActionParam (int entityID, int actionID, string actionParam, string actionValue)
 Set a value in of specified Action property. Using this Function and getActionParam, you will be able to control an Entities Action from Script. More...
 
void fadeActionParam (int entity_ID, int action_ID, string param, float from, float to, float rate, int looped)
 Fade out any float based action property. More...
 
void action addToEntity (int objID, ”PLAYER”, “AI Sensor”)
 addToEntity action. More...
 

Detailed Description

This area covers action functions. Set or get various action properties and other script based action utilities.
Use as action.function()
Action functions require entity and action IDs. The entity ID can be found by calling the getEntityIDFromTag("myTag") command. The action ID is this entities attached action, where the ID value is from 1 to num of actions.
For more information on how these functions can be used please visit the User Manual - https://home.aurasoft-skyline.co.uk

Member Function Documentation

void action action::addToEntity ( int  objID,
”PLAYER”  ,
“AI  Sensor” 
)

addToEntity action.

Parameters
entityID: The EntityID to use to set the action data to.
Tag: The Tag of the Source Object
Tag: The Tag of the Object been attached

Here is a Small Example of how to use this function:

function onInit(objID)
    action.addToEntity(objID,”PLAYER”, “AI Sensor”);
end
void action::fadeActionParam ( int  entity_ID,
int  action_ID,
string  param,
float  from,
float  to,
float  rate,
int  looped 
)

Fade out any float based action property.

Parameters
entityID: The EntityID to use to set the action data to.
actionID: The Action Index Number in order of attachment from base properties. 0 = first action, 1 = second action etc...
actionParam: The Parameter of the action to set the value to. (See Properties Panel for action Parameters. )
from: The Parameter of the action to set the value to. (See Properties Panel for action Parameters. )
to: Passes the value you set to the actionParam.
rate: the time interval between step in ms
looped: If looped = 0 the fade is once. If looped = 1 then this fade and repeate, If looped = 2 then the fade will bounce back and forth.

Here is a Small Example of how to use this function:

function onInit(objID)
    action.fadeActionParam(entity.getEntityIDFromTag("cube_1"), 1, "alpha", 100, 0 , 20, 0);
end
int action::getActionID ( int  entityID,
string  actionName 
)

Get the Id of the action with the string arg of actionName.

Parameters
entityID: The EntityID to use to get the action data from.
actionName: The name of the action, this can be found by looking at the actions header in the property panel )

Here is a Small Example of how to use this function:

function onInit(objID)
    actionID = action.getActionID(entityID,"ActionName");
end
string action::getActionParam ( int  entityID,
int  actionID,
string  actionParam 
)

Get the property value from any entity Action. For use in script to control elements of your game.

See also
setActionParam to set a value back to an action.
Parameters
entityID: The EntityID to use to get the action data from.
actionID: The Action Index Number in order of attachment from base properties. 0 = first action, 1 = second action etc...
actionParam: The Parameter of the action to get value off. (See Properties Panel for action Parameters. )
Returns
actionValue : Returns a string containing the value of the Action Property.

Here is a Small Example of how to use this function:

function onInit(objID)
    id = action.getActionParam(entity.getEntityIDFromTag("cube_1"), 1, "enabled");
end
void action::setActionParam ( int  entityID,
int  actionID,
string  actionParam,
string  actionValue 
)

Set a value in of specified Action property. Using this Function and getActionParam, you will be able to control an Entities Action from Script.

Parameters
entityID: The EntityID to use to set the action data to.
actionID: The Action Index Number in order of attachment from base properties. 0 = first action, 1 = second action etc...
actionParam: The Parameter of the action to set the value to. (See Properties Panel for action Parameters. )
actionValue: Passes the value you set to the actionParam.

Here is a Small Example of how to use this function:

function onInit(objID)
    action.setActionParam(entity.getEntityIDFromTag("cube_1"), 1, "enabled", "1");
end

The documentation for this class was generated from the following file: