Sound Bug Using "Set Fade Effect To New Scene"

  • #10, by SDMonoThursday, 24. April 2014, 15:10 6 years ago
    Thank you so much... you are always a great help!!!

    I will see what I can do. Will report back to you later!!! wink

    Forum Fan

    148 Posts


  • #11, by SDMonoThursday, 24. April 2014, 15:58 6 years ago
    Short question: Does this all has to be done by one script or do I need more than one script to do it?

    Forum Fan

    148 Posts

  • #12, by afrlmeThursday, 24. April 2014, 16:34 6 years ago
    what do you mean?

    You could create functions to handle it or you can create execution scripts.

    Imperator

    6842 Posts

  • #13, by SDMonoThursday, 24. April 2014, 17:49 6 years ago
    Not sure if I am thinking right but lets see. At the beginning of the first scene I call an execution script that starts to play the sound. At the end of the scene I have to call another script that gets the offset of the sound. Than the scene changes and it calls a third script that start the sound with the offset from the scene before. Is that about right or I am completely off?

    Forum Fan

    148 Posts

  • #14, by afrlmeThursday, 24. April 2014, 18:43 6 years ago
    yeah sounds about right but maybe you should see if the togglepause function works ok first? Seeing as the sound is not linked to a scene or anything it should just continue to play between scenes, until you stop it no?

    Imperator

    6842 Posts

  • #15, by SDMonoThursday, 24. April 2014, 18:52 6 years ago
    Exactly. I am trying to get the pause thing to work. Until now I get it to pause but it doesn't start again... at least not where I paused it. Maybe I am just doing it wrong... not saving the sound property in a variable correctly. On you wiki site at the end there is a print sting... that is how you save the properties and later on you just recall them? I am sorry for my stupid question... I just have no idea how things work... I am trying to get my head around it.

    Forum Fan

    148 Posts

  • #16, by afrlmeThursday, 24. April 2014, 19:35 6 years ago
    print is just for printing messages into the log. more for debugging.

    which wiki article are you looking at?
    I was talking about this one: http://wiki.visionaire-tracker.net/wiki/ToggleSoundPause

    Imperator

    6842 Posts

  • #17, by SDMonoThursday, 24. April 2014, 19:55 6 years ago
    Yeah that one.

    I am still trying to get the thing working in the same scene... without jumping to another one. Just to understand how things work.

    Its a cut-scene.

    I have one script at the beginning of the scene.


    local song = startSound("vispath:data/audio/tellisis/sounds/song.ogg")
    1
    2
    3


    Then I have another one in the middle of the cutscene that pauses the song.


    local song = getSoundId("vispath:data/audio/tellisis/sounds/song.ogg")
    toggleSoundPause(song)

    1
    2
    3
    4
    5


    And close to the end I put the second script again because I thought it would toggle between pause and playing the sound. But nothing happens. roll

    Forum Fan

    148 Posts

  • #18, by afrlmeThursday, 24. April 2014, 20:23 6 years ago
    you don't need to do the local variable for the start sound.

    if you wanted you could do..
    local sound1 = "vispath:data/audio/tellisis/sounds/song.ogg"
    startSound(sound1)
    1
    2
    3

    or...
    startSound("vispath:data/audio/tellisis/sounds/song.ogg")
    1
    2

    for the id you are better naming it something like this...
    local sound1_id = getSoundId("vispath:data/audio/tellisis/sounds/song.ogg")
    -- or if you have stored the path in a variable
    local sound1_id = getSoundId(sound1)
    1
    2
    3
    4

    etc...

    Imperator

    6842 Posts

  • #19, by SDMonoThursday, 24. April 2014, 21:35 6 years ago
    ok I tried it and well:

    1. option:

    script 1
    local sound1 = "vispath:data/audio/tellisis/sounds/song.ogg"
    startSound(sound1)
    1
    2
    3


    script 2
    local sound1_id = getSoundId(sound1)
    toggleSoundPause(sound1_id)
    1
    2
    3


    The sound starts but does not stop.

    2. option

    script 1
    startSound("vispath:data/audio/tellisis/sounds/song.ogg")
    1
    2


    script 2
    local sound1_id = getSoundId("vispath:data/audio/tellisis/sounds/song.ogg")
    toggleSoundPause(sound1_id)
    1
    2
    3


    The sound starts and stops.

    If I understand all of this correctly.

    In option 1 the first script. defines sound1 as a variable and startSound(sound1) calls this variable and well starts the sound. Now the pause script defines a new variable sound1_id which is sound1 but somehow it does not find it or something because it does not pause the sound.

    Forum Fan

    148 Posts

  • #20, by SDMonoThursday, 24. April 2014, 21:49 6 years ago
    Can it be that local sound1 = "vispath:data/audio/tellisis/sounds/song.ogg" is just a local variable and thats why I cannot call it from another script?

    Forum Fan

    148 Posts

Write post