Menu
Login
Language
DE EN FR ES IT CZ
Back

Background music

  • #10, z ke4 Tuesday, 19. May 2015, 18:49 hodinky 11 years ago Quote
    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

    Zabiják klíčů

    810 Posts

  • #11, z Alex Wednesday, 20. May 2015, 17:19 hodinky 11 years ago Quote
    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.

    Čestný člen

    378 Posts

  • #12, z afrlme Wednesday, 20. May 2015, 18:35 hodinky 11 years ago Quote
    Thanks for clarifying exactly what it is used for Alex. wink

    Imperátor

    7290 Posts

  • #13, z battlehamx Thursday, 02. July 2015, 01:04 hodinky 11 years ago Quote
    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

    Bažant

    2 Posts

  • #14, z battlehamx Friday, 03. July 2015, 03:38 hodinky 11 years ago Quote
    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.

    Bažant

    2 Posts

  • #15, z ke4 Friday, 03. July 2015, 13:03 hodinky 11 years ago Quote
    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.

    Zabiják klíčů

    810 Posts