Difference between revisions of "StartSound"

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 sound files; with optional property values!
 +
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
 +
<b>Additional Info</b>
 +
<div class="mw-collapsible-content">
 +
<div>Currently available properties: <br/>
 +
* volume (allows you to set volume level)
 +
* balance (allows you to set left/right balance)
 +
* offset (allows you to start audio file from x time; in ms)
 +
* loop (allows you to loop the audio file)</div>
 +
</div></div>
  
  
 
Syntax:
 
Syntax:
 
<syntaxhighlight>
 
<syntaxhighlight>
startAction(action)
+
startSound("filename")
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
Example 1: basic start action method
+
Example 1: basic play audio file method
<syntaxhighlight enclose="div">
+
<syntaxhighlight>
--[[
+
n/a
!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]")
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Example 2: start action via a variable
+
Example 2: ...
 
<syntaxhighlight>
 
<syntaxhighlight>
-- you can of course use variables with actions stored in them instead!
+
n/a
local act = getObject("Actions[action_name]")
 
startAction(act)
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 40: Line 38:
 
<b><u>Arguments</u></b>
 
<b><u>Arguments</u></b>
  
action: path <br/>
+
<b>filename</b>: path <br/>
The path to the action to be started! ("path"."object_id"."action")
+
The path to the audio file to be played! ("path/filename.type")
 +
 
 +
<b><u>Flags</u></b>
 +
 
 +
none
  
Flags: none
+
<b><u>Return</u></b>
  
Return: visionaireObject <br/>
+
<b>visionaireObject</b> <br/>
 
The visionaire object representing the active action!
 
The visionaire object representing the active action!
 
{{i18n|StartSound}}
 
{{i18n|StartSound}}

Revision as of 18:38, 8 March 2013

Command History

Available since v3.8


Allows you to play sound files; with optional property values!

Additional Info

Currently available properties:
  • volume (allows you to set volume level)
  • balance (allows you to set left/right balance)
  • offset (allows you to start audio file from x time; in ms)
  • loop (allows you to loop the audio file)


Syntax:

startSound("filename")


Example 1: basic play audio file method

n/a

Example 2: ...

n/a


Arguments

filename: path
The path to the audio file to be played! ("path/filename.type")

Flags

none

Return

visionaireObject
The visionaire object representing the active action!