Sound Bug Using "Set Fade Effect To New Scene"

  • #30, by afrlmeMonday, 28. April 2014, 18:57 11 years ago
    here I've removed your scripts/actions & edited with my own script & execute a script action parts.

    http://www.sendspace.com/file/nxumaj

    This is just a very basic example. I am thinking about creating a .ved file at some point that showcases the Lua sound functions. No idea when I will get around to it though.

    Imperator

    7285 Posts


  • #31, by SDMonoMonday, 28. April 2014, 20:13 11 years ago
    Thanks man. I had something similar in my offset idea. Well we tried a lot and maybe I can use some of the stuff at some point in my game but for now I will stick with the alarm sound starting again after I change to a different scene. Because I do not see a big difference. There is still the delay and a weird sound thingy going on.

    It would help if there would be an option that lets you wait for a sound loop to finish. Like the loop is infinite but if you were to put "wait till sound loops finishes" it would play the sound one last time and then stop the loop.

    Like always thanks for you great help. I really appreciate it!!!!

    Saludos!!!

    Forum Fan

    148 Posts

  • #32, by afrlmeMonday, 28. April 2014, 20:50 11 years ago
    instead of loop you could manually loop it after each time it has finished playing. I'm not sure why it kills all sounds started via Lua when it changes to a new scene. You would think they would carry on until we told them to stop seeing as they are not directly tied to the scene. If you added it as the scene background sound via the scene properties tab & then added same sound to the next scene etc then it should keep playing between scenes without pausing & will only restart from beginning if you come from a scene that was playing something else as the background sound.

    Maybe a good idea would be to have it play the alarm after every x amount of time? say once every 10 seconds or something which would be much easier to do than having it play non-stop. Just a thought though.

    Technically I see no reason why you couldn't check for when the loop has finished. You just need to check the offset against the offset total; obviously you would have to do a bit of math to convert the time into milliseconds.

    Imperator

    7285 Posts

  • #33, by SDMonoTuesday, 29. April 2014, 06:12 11 years ago
    I build a loop manually. It works...at least with really short sounds (with longer ones the player would have to wait too long for the scene to change to the next one)! It plays a loop until I want to change to another scene then it finishes the loop and plays the sound one more time before changing the scene. Well and in the next scene the same loops starts up again.

    Forum Fan

    148 Posts

  • #34, by AlexSunday, 04. May 2014, 02:53 11 years ago
    I didn't notice any sound bugs with the fade out effect.
    Some random notes (I haven't followed the whole thread):
    - you can loop a sound directly with the 'Play and loop sound infinitely' action part
    - be careful with loops, actions run independent of the current scene (either be aware that they could still be running when you switch to a new scene or stop them)
    - if you set a background music it will be handled automatically by the engine, including fade effect when you swith to another scene. the background music can also be changed by action part or script.
    - the startSound command returns the sound id

    Great Poster

    378 Posts

  • #35, by afrlmeSunday, 04. May 2014, 03:39 11 years ago
    Ah... you just reminded me of something I was going to ask. What about adding some additional sound slots to the properties tab (same as background music one) say around 3 more which could be used for adding ambiental background sounds such as environmental sounds (wind/rain etc) or maybe industrial sounds or whatever. I think it would be quite nice to be able to do that & easier than messing around with loops or Lua for vast majority of people.

    The bug was when setting the fade out effect to "fade out" (only) was that the sound carried on in the next scene & also started playing again so you ended up with exact same sound playing 2 at same time but out of sync. By default it seems that even if you set a sound to play & loop infinitely with either action part or Lua that the sound is automatically stopped at the end of the scene. With Lua at least I would have thought that it would carry on regardless.

    Imperator

    7285 Posts