StendhalScripting/Lua: Difference between revisions

Content deleted Content added
imported>AntumDeluge
See also
imported>AntumDeluge
Add Zone Music: "setZoneMusic" replaced with "game:setMusic"
Line 278:
=== Add Zone Music ===
 
Music can be added to zones with the <code>setZoneMusicgame:setMusic</code> global function. It supports the following arguments:
* ''<span style="color:darkgreen; font-style:italic;>filename:''</span> Basename of the OGG audio file to use stored in {{StendhalFile|master|data/music|data/music}}.
* <span style="color:darkgreen; font-style:italic;>args:</span> A table of key=value integers.
* ''volume:'' (optional) Volume level.
* Valid keys:
* ''x:'' (optional) The horizontal point for the source of the music.
** <span style="color:darkblue; font-style:italic;">volume:</span> Volume level (default: 100).
* ''y:'' (optional) The vertical point for the source of the music.
** ''<span style="color:darkblue; font-style:italic;">x:'' (optional)</span> The horizontal point for the source of the music (default: 1).
* ''radius:'' (optional) The radial range at which the music can be heard.
** ''<span style="color:darkblue; font-style:italic;">y:'' (optional)</span> The vertical point for the source of the music (default: 1).
** ''<span style="color:darkblue; font-style:italic;">radius:'' (optional)</span> The radial range at which the music can be heard (default: 10000).
 
Example:
<pre>
if game:setZone("0_semos_plains_n") then
setZoneMusicgame:setMusic("pleasant_creek_loop", {volume=85, radius=100})
end
</pre>