Difference between revisions of "StartAnimation"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"> <b>Command History</b> <div class="mw-collapsible-co...")
 
Line 6: Line 6:
  
  
Allows you to start any "called by other action" you include!
+
Allows you to play any animation; if the animation is already playing then the existing animation is returned!
  
  
 
Syntax:
 
Syntax:
 
<syntaxhighlight>
 
<syntaxhighlight>
startAction(action)
+
startAnimation(animation [, reverse])
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 17: Line 17:
 
Example 1: basic start action method
 
Example 1: basic start action method
 
<syntaxhighlight enclose="div">
 
<syntaxhighlight enclose="div">
--[[
+
-- n/a: will add later!
!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([getObject("Actions[action_name]")])
 
 
 
 
 
-- full get action method; !recommended
 
startAction([getObject("Scenes[scene_name].SceneObjects[object_name].SceneActions[action_name]")])
 
</syntaxhighlight>
 
 
 
Example 2: start action via a variable
 
<syntaxhighlight>
 
-- you can of course use variables with actions stored in them instead!
 
local act = getObject("Actions[action_name]")
 
startAction(act)
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 40: Line 24:
 
<b><u>Arguments</u></b>
 
<b><u>Arguments</u></b>
  
action: link <br/>
+
animation: link <br/>
The link to the action to be started! ("path"|"object_id"|"action_name")
+
The link to the animation to be started! ("path"|"object_id"|"animation_name")
  
 
Flags: none
 
Flags: none
  
 
Return: visionaireObject <br/>
 
Return: visionaireObject <br/>
The visionaire object representing the active action!
+
The visionaire object representing the active animation!
{{i18n|StartAction}}
+
{{i18n|StartAnimation}}

Revision as of 23:40, 6 March 2013

Command History

Available since v3.7


Allows you to play any animation; if the animation is already playing then the existing animation is returned!


Syntax:

startAnimation(animation [, reverse])


Example 1: basic start action method

-- n/a: will add later!


Arguments

animation: link
The link to the animation to be started! ("path"|"object_id"|"animation_name")

Flags: none

Return: visionaireObject
The visionaire object representing the active animation!