Difference between revisions of "StartAction"
From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 7: | Line 7: | ||
Allows you to start any "called by other action" you include! | Allows you to start any "called by other action" you include! | ||
+ | |||
Syntax: | Syntax: | ||
Line 15: | Line 16: | ||
Example: | Example: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | -- shortened get action method; !important: you must | + | --[[ |
+ | shortened get action method; | ||
+ | !important: you must take care when using this method that you don't have multiple instances of actions with the same name! | ||
+ | --]] | ||
startAction([getObject("Actions[action_name]")]) | startAction([getObject("Actions[action_name]")]) | ||
+ | |||
+ | |||
+ | |||
+ | -- full path action method; !recommended | ||
+ | getObject("Scenes[scene_name].SceneObjects[object_name].SceneActions[action_name]") | ||
+ | |||
+ | |||
-- you can of course use variables with actions stored in them instead! | -- you can of course use variables with actions stored in them instead! | ||
local act = getObject("Actions[action_name]") | local act = getObject("Actions[action_name]") | ||
startAction(act) | startAction(act) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 21:43, 6 March 2013
Command History
Available since v3.7
Allows you to start any "called by other action" you include!
Syntax:
startAction(action)
Example:
--[[
shortened get action method;
!important: you must take care when using this method that you don't have multiple instances of actions with the same name!
--]]
startAction([getObject("Actions[action_name]")])
-- full path action method; !recommended
getObject("Scenes[scene_name].SceneObjects[object_name].SceneActions[action_name]")
-- you can of course use variables with actions stored in them instead!
local act = getObject("Actions[action_name]")
startAction(act)
Arguments
action: link
The link to the action to be started! ("path|"object_id"|"action_name")
Flags: none
Return: visionaireObject
The visionaire object representing the active action!