Lua script about StartSound seems not working

  • #1, by tristan-kangWednesday, 12. August 2015, 23:56 10 years ago
    I heard I can modify sound easily with this script but when I use it the sound file plays (about 0.5 sec) but stops immediately. I just wanted to add the fan rounding sound near the ventilation and set fade out/in if the player character near the object or not.

    I actually tried to put sound into the object and called the action but the sound's volume was same no matter the character near it or not.

    I hope this editor can set the object has its own sound (eg. grumbling sound of the cat from a distance or flitting sound of flies near from dead body) so the game engine detects a distance of the sound automatically.

    Otherwise I need someone who can fix the issue I mentioned above.

    Below thing was the script I used, it should be worked but it didn't.

    local sound01 = startSound('vispath:assets/audio/sound effects/fan_sound.ogg')
    setSoundProperty(sound01, {flags=1})
    

    Great Poster

    267 Posts


  • #2, by tristan-kangThursday, 13. August 2015, 00:30 10 years ago
    I just realised I can do it generally with action area.

    But the script problem is still problem, I need to fix it.

    Great Poster

    267 Posts

  • #3, by afrlmeThursday, 13. August 2015, 12:08 10 years ago
    I think there is a bug with the Lua sound side of things. A few people have already mentioned this issue in other threads over past couple of months or so. I don't remember whether or not any of them found a solution. If not then it's something the devs will need to address.

    Imperator

    7285 Posts

  • #4, by tristan-kangThursday, 13. August 2015, 12:37 10 years ago
    I see. Still there is no problem as soon as I can use the function with action area.

    But later time when I tried to develop the sound system which would be played during 'whole' scene then it would be a problem.

    I hope they fix it before I managed to get that level. It's very late part of my game...

    Great Poster

    267 Posts