License from €75 Log in
DE EN FR ES IT CZ

Lua script about StartSound seems not working

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 12 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})
    
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 12 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.
  4. · 12 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.
  5. · 12 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...

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?