Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Background music

  • #10, by ke4 11 years ago Zitieren
    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
  • #11, by Alex 11 years ago Zitieren
    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.
  • #12, by afrlme 11 years ago Zitieren
    Thanks for clarifying exactly what it is used for Alex. wink
  • #13, by battlehamx 11 years ago Zitieren
    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
  • #14, by battlehamx 11 years ago Zitieren
    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.
  • #15, by ke4 11 years ago Zitieren
    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.