Difference between revisions of "StartAction"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
<b>Command History</b>
+
<span class="bold">Command History</span>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
+
<div class="alt-bg">Available since v3.7</div>
 
</div></div>
 
</div></div>
  
Line 18: Line 18:
 
<syntaxhighlight enclose="div">
 
<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!
+
!important: you must take care when using this method that there is only one instance of the action you are calling.
 
--]]
 
--]]
  
Line 38: Line 38:
  
  
<b><u>Arguments</u></b>
+
<span class="bold underline">Arguments</span>
  
<b>action</b>: path <br/>
+
<span class="bold">action</span>: path <br/>
 
The path to the action to be started! ("path"."object_id"."action")
 
The path to the action to be started! ("path"."object_id"."action")
  
  
<b><u>Flags</u></b>  
+
<span class="bold underline">Flags</span>  
  
 
none
 
none
  
  
<b><u>Return</u></b>  
+
<span class="bold underline">Return</span>  
  
<b>visionaireObject</b> <br/>
+
<span class="bold">visionaireObject</span> <br/>
 
The visionaire object representing the active action!
 
The visionaire object representing the active action!
 
{{i18n|StartAction}} <br/>
 
{{i18n|StartAction}} <br/>
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
+
{| class="tbl-ds"
 
|-
 
|-
|<b>Relevant Pages</b>: [[StopAction|stopAction]]
+
|<span class="bold">Relevant Pages</span>: [[StopAction|stopAction]]
 
|}
 
|}

Revision as of 13:45, 4 April 2013

Command History

Available since v3.7


Allows you to start any "called by other action" you include!


Syntax:

startAction(action)


Example 1: basic start action method

--[[
!important: you must take care when using this method that there is only one instance of the action you are calling.
--]]

-- 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]")

Example 2: start action via a variable

-- you can of course use variables with actions stored in them instead!
local act = getObject("Actions[action_name]")
startAction(act)


Arguments

action: path
The path to the action to be started! ("path"."object_id"."action")


Flags

none


Return

visionaireObject
The visionaire object representing the active action!


Relevant Pages: stopAction