Background music

  • #10, by ke4Tuesday, 19. May 2015, 18:49 9 years ago
    Hehe,

    anyway it's strange, i tried different file and path too and still the same, i'll leave it for now and get back to it later..
    Thanks

    Key Killer

    810 Posts


  • #11, by AlexWednesday, 20. May 2015, 17:19 9 years ago
    btw what the flags=1 means?


    this marks an argument as a flag argument and is needed for the argument parser of our commands. Since a table can be used for almost anything in Lua we use the 'flags' key to mark a table for optional command flags.

    Great Poster

    378 Posts

  • #12, by afrlmeWednesday, 20. May 2015, 18:35 9 years ago
    Thanks for clarifying exactly what it is used for Alex. wink

    Imperator

    7278 Posts

  • #13, by battlehamxThursday, 02. July 2015, 01:04 9 years ago
    I have the same problem, the startSound() script loads the audio file and plays it just for a millisecond or so.
    Was anyone able to find a solution? smile

    Newbie

    2 Posts

  • #14, by battlehamxFriday, 03. July 2015, 03:38 9 years ago
    I have the same problem, the startSound() script loads the audio file and plays it just for a millisecond or so.
    Was anyone able to find a solution? smile


    I've found a workaround.
    It might now be viable for all situations though.
    Start the sound with the Action right before running the script instead of in the script itself. Then reference it in the script with the getSoundId() function and then you will be able to manipulate it in the script with the setSoundProperties() and so on.

    Newbie

    2 Posts

  • #15, by ke4Friday, 03. July 2015, 13:03 9 years ago
    Nice one.

    It still doesn't work for me..
    The code:
    local SoundID = getSoundId("vispath:podklady/Hudba/hotel/party.ogg")
    
    setSoundProperty(SoundID, {flags=1,  volume = 40,   loop = true,  offset = math.random(76000) })
    

    The song starts playing always from the beggining.

    Key Killer

    810 Posts