<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Play sound once]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=443</link>
		<description><![CDATA[The most recent posts in Play sound once.]]></description>
		<lastBuildDate>Fri, 19 Dec 2014 22:45:56 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7452#p7452</link>
			<description><![CDATA[<p>Fine thanks ! just finished a 4 months pre-forming module, <br />now i&#039;m going to hibernate for a week before starting something else <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Fri, 19 Dec 2014 22:45:56 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7452#p7452</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7451#p7451</link>
			<description><![CDATA[<p>Thanks Vegas. I&#039;ll download them today and test. How are you By the way?</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Fri, 19 Dec 2014 16:54:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7451#p7451</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7450#p7450</link>
			<description><![CDATA[<p>Hey TD, the scripts Anael &amp; i posted are both valid, i assume Almighty Laxz problem was somewhere else<br />Here&#039;s a project with both scripts (you must un-comment one of the method first) : <br /><a href="https://dl.dropboxusercontent.com/u/19970067/Maratis/Soundtest.rar">https://dl.dropboxusercontent.com/u/199 &#133; ndtest.rar</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Thu, 18 Dec 2014 04:43:29 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7450#p7450</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7447#p7447</link>
			<description><![CDATA[<p>I had to revisit this post, as I need this again, however, I am on a mac now and something as simple as:</p><div class="codebox"><pre><code>if isCollisionBetween(box,trigger) then
        playSound(news)
    end</code></pre></div><p>In the update function plays the sound only once (although it plays it after the collision is finished, not upon impact). </p><p>I wonder if the issue is a Windows thing? Or at least, I don&#039;t hear the repetitions if there are any.</p><p>Nope. It still skips</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Tue, 16 Dec 2014 03:10:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7447#p7447</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6537#p6537</link>
			<description><![CDATA[<p>Well, I was hoping to find my answer here, guess I have to try elsewhere.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Sun, 02 Mar 2014 23:45:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6537#p6537</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2639#p2639</link>
			<description><![CDATA[<p>Still not working, I now have:<br /></p><div class="quotebox"><blockquote><p>Sound0 = getObject(&quot;Sound0&quot;)<br />SOUND = {obj = Sound0, impact = 0}<br />&nbsp; &nbsp;function play_impact(sound)<br />&nbsp; &nbsp; if SOUND.impact == 0 then playSound(sound.obj) end<br />&nbsp; &nbsp; &nbsp; &nbsp;SOUND.impact = 1<br />&nbsp; &nbsp;end<br />&nbsp; &nbsp;function stop_impact(sound)<br />&nbsp; &nbsp;SOUND.impact = 0<br />&nbsp; &nbsp;end<br />function onSceneUpdate()<br />if isCollisionBetween(Car, Ground)<br />then changeCurrentCamera(Camera1)<br />deactivate(Text0)<br />deactivate(Text1)<br />camcycle = 1<br />play_impact(SOUND)<br />else<br />stop_impact(SOUND)<br />end</p></blockquote></div><p>Any other ideas?</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Mon, 17 Sep 2012 22:14:13 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2639#p2639</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2615#p2615</link>
			<description><![CDATA[<p>And something like that ?</p><div class="codebox"><pre><code>Sound0 = getObject(&quot;Sound0&quot;)
SOUND = {obj = Sound0, impact = 0}

function play_impact(sound)
    if sound.impact == 0 then
        playSound(sound.obj)
        sound.impact = 1
    end
end

function stop_impact(sound)
   sound.impact = 0
end

function onSceneUpdate()
   
    if isCollisionBetween(Car, Ground) then
        changeCurrentCamera(Camera1)
        deactivate(Text0)
        deactivate(Text1)  
        camcycle = 1
        play_impact(SOUND)
    else
        stop_impact(SOUND)
    end

end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 14 Sep 2012 10:57:35 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2615#p2615</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2614#p2614</link>
			<description><![CDATA[<p>Whoops, it actually didn&#039;t work, its still looping. <br />I now have:<br /></p><div class="quotebox"><blockquote><p>Sound0 = getObject(&quot;Sound0&quot;)<br />SOUND = {impact = 0}<br />function onSceneUpdate()<br />&nbsp; &nbsp;function play_impact()<br />&nbsp; &nbsp; if SOUND.impact == 0 then playSound(Sound0) end<br />&nbsp; &nbsp; &nbsp; &nbsp;SOUND.impact = 1<br />&nbsp; &nbsp;end<br />&nbsp; &nbsp;function stop_impact()<br />&nbsp; &nbsp;SOUND.impact = 0<br />&nbsp; &nbsp;end<br />if isCollisionBetween(Car, Ground)<br />then changeCurrentCamera(Camera1)<br />deactivate(Text0)<br />deactivate(Text1)<br />camcycle = 1<br />play_impact()<br />else<br />stop_impact()<br />end</p></blockquote></div><p>Putting the functions after isCollisionBetween doesn&#039;t work, it stops the script working.</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Fri, 14 Sep 2012 10:21:03 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2614#p2614</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2602#p2602</link>
			<description><![CDATA[<p>Try this :</p><div class="quotebox"><blockquote><p>Sound0 = getObject(&quot;Sound0&quot;)</p><p>SOUND = {impact = 0}</p><p>function onSceneUpdate()<br />&nbsp; &nbsp; if isCollisionBetween(Car, Ground) then<br />&nbsp; &nbsp; &nbsp; &nbsp; changeCurrentCamera(Camera1)<br />&nbsp; &nbsp; &nbsp; &nbsp; deactivate(Text0)<br />&nbsp; &nbsp; &nbsp; &nbsp; deactivate(Text1)<br />&nbsp; &nbsp; &nbsp; &nbsp; camcycle = 1<br />&nbsp; &nbsp; &nbsp; &nbsp; play_impact()<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; stop_impact()<br />&nbsp; &nbsp; end&nbsp; &nbsp; <br />end</p><p>function play_impact()<br />&nbsp; &nbsp; if SOUND.impact == 0 then playSound(Sound0) end<br />&nbsp; &nbsp; &nbsp; &nbsp;SOUND.impact = 1<br />end<br />&nbsp; &nbsp;<br />function stop_impact()<br />&nbsp; &nbsp; SOUND.impact = 0<br />end</p></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Thu, 13 Sep 2012 10:29:10 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2602#p2602</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2601#p2601</link>
			<description><![CDATA[<p>Ok, I now have:<br /></p><div class="quotebox"><blockquote><p>Sound0 = getObject(&quot;Sound0&quot;)<br />IMPACT = {Sound0 = 0}<br />&nbsp; &nbsp;function play_impact()<br />&nbsp; &nbsp; &nbsp; &nbsp;if IMPACT.Sound0 == 0 then playSound(Sound0) end<br />&nbsp; &nbsp; &nbsp; &nbsp;IMPACT.Sound0 = 1<br />&nbsp; &nbsp;end<br />&nbsp; &nbsp;function stop_impact()<br />&nbsp; &nbsp;IMPACT.Sound0 = 0<br />&nbsp; &nbsp;end<br />function onSceneUpdate()<br />if isCollisionBetween(Car, Ground)<br />then changeCurrentCamera(Camera1)<br />deactivate(Text0)<br />deactivate(Text1)<br />camcycle = 1<br />if IMPACT.Sound0 == 0 then play_impact()<br />else<br />stop_impact()<br />end<br />end</p></blockquote></div><p>But it still loops. Any idea why?</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Thu, 13 Sep 2012 10:09:27 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2601#p2601</guid>
		</item>
		<item>
			<title><![CDATA[Re: Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2600#p2600</link>
			<description><![CDATA[<p>I used that method into a test scene, maybe that&#039;s what you are looking for :</p><div class="quotebox"><blockquote><p>Bleep = getObject(&quot;Bleep&quot;)&nbsp; -- the sound file<br />SOUND = {bleep = 0}</p><p>function onSceneUpdate()<br />&nbsp; &nbsp; if isCollisionBetween(object1, object2) then<br />&nbsp; &nbsp; &nbsp; &nbsp; play_Bleep()<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; stop_Bleep()&nbsp; &nbsp; <br />&nbsp; &nbsp; end<br />end<br />&nbsp; &nbsp; <br />function play_Bleep()<br />&nbsp; &nbsp; if SOUND.bleep == 0 then playSound(Bleep) end<br />&nbsp; &nbsp; &nbsp; &nbsp;SOUND.bleep = 1<br />end</p><p>function stop_Bleep()<br />&nbsp; &nbsp; SOUND.bleep = 0<br />end</p></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Thu, 13 Sep 2012 09:45:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2600#p2600</guid>
		</item>
		<item>
			<title><![CDATA[Play sound once]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=2598#p2598</link>
			<description><![CDATA[<p>Hi,<br />I am having problems getting a sound to play once in my script.<br />At the start:<br />soundplay = 0<br />&nbsp; &nbsp;function playsound()<br />&nbsp; &nbsp; &nbsp; &nbsp;if soundplay == 0 then playSound(Sound0) end<br />&nbsp; &nbsp; &nbsp; &nbsp;soundplay = 1<br />&nbsp; &nbsp;end<br />Then:<br />function onSceneUpdate()<br />if isCollisionBetween(Car, Ground)<br />if soundplay == 0 then playsound()<br />else<br />soundplay = 0<br />end<br />end</p><p>It loops repeatedly, but I&#039;m not sure why, could anyone help?</p>]]></description>
			<author><![CDATA[dummy@example.com (Almighty Laxz)]]></author>
			<pubDate>Thu, 13 Sep 2012 08:55:36 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=2598#p2598</guid>
		</item>
	</channel>
</rss>
