Difference between revisions of "StartAction"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
==startAction==
<b>Command History</b>
 
<div class="mw-collapsible-content">
 
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
 
</div></div>
 
  
 +
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.0</span></div>
  
Allows you to start any "called by other action" you include!
+
<div class="command-doc">Starts an action. If the action is already running a new active action for the action data object is started.</div>
  
 
+
Lua Syntax:
Syntax:
+
<pre class="command-syntax">startAction(action)</pre>
 +
===Arguments===
 +
====action====
 +
:'''"object path"|"object id"|object''' - Visionaire object which specifies an action.
 +
===Flags===
 +
===Return Values===
 +
;visionaireObject
 +
:The visionaire object representing the active action.
 +
===Examples===
 +
Example 1:  
 
<syntaxhighlight>
 
<syntaxhighlight>
startAction(action)
 
</syntaxhighlight>
 
 
 
Example 1: basic start action method
 
<syntaxhighlight enclose="div">
 
--[[
 
!important: you must take care when using this method that you don't have multiple instances of actions with the same name otherwise it will not work correctly!
 
--]]
 
 
-- shortened get action method; !important: see comment above!
 
startAction("Actions[action_name]")
 
 
 
-- full get action method; !recommended
 
 
startAction("Scenes[scene_name].SceneObjects[object_name].SceneActions[action_name]")
 
startAction("Scenes[scene_name].SceneObjects[object_name].SceneActions[action_name]")
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
Example 2:  
Example 2: start action via a variable
 
 
<syntaxhighlight>
 
<syntaxhighlight>
-- 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>
 
 
 
<b><u>Arguments</u></b>
 
 
<b>action</b>: path <br/>
 
The path to the action to be started! ("path"."object_id"."action")
 
 
<b><u>Flags</u></b>
 
 
none
 
 
 
<b><u>Return</u></b>
 
 
<b>visionaireObject</b> <br/>
 
The visionaire object representing the active action!
 
{{i18n|StartAction}} <br/>
 
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
 
|-
 
|<b>Relevant Pages</b>: [[StopAction|stopAction]]
 
|}
 

Revision as of 21:28, 30 September 2014

startAction

Available since: v3.0
Starts an action. If the action is already running a new active action for the action data object is started.

Lua Syntax:

startAction(action)

Arguments

action

"object path"|"object id"|object - Visionaire object which specifies an action.

Flags

Return Values

visionaireObject
The visionaire object representing the active action.

Examples

Example 1:

startAction("Scenes[scene_name].SceneObjects[object_name].SceneActions[action_name]")

Example 2:

local act = getObject("Actions[action_name]")
startAction(act)