Sound button in Inventory and intro movie

  • #1, by LekkaThursday, 27. August 2015, 15:03 9 years ago
    Hey there,


    I have a videofile playing at the beginning of the game, including sound.
    Then there are background sounds for each screen.

    Now I want to create a Sound button in my Inventory. So if you click it, it should change its status and stop playing the background music/sound. But there is just no command that works.
    Also the intro music overlaps with the background music.
    But if I create a button in the inventory and select "Change volume to 0" the music in the introfile isn't playing.

    Did anyone do something similar before and knows the ultimate way to solve this problem?

    Newbie

    19 Posts


  • #2, by sebastianThursday, 27. August 2015, 16:24 9 years ago
    you can change the different gamevolumes also via lua.

    Thread Captain

    2346 Posts

  • #3, by LekkaThursday, 27. August 2015, 16:44 9 years ago
    Hi, thanks for answering.

    Yes, I read that.
    But I haven't really used scripting before, so I don't know anything ^^
    I found a Tutorial about a volume regulator, but this isn't exactly what I am looking for.
    I just need an "ON" and "OFF" function. I didn't imagine this could be so complicated ^^

    Newbie

    19 Posts

  • #4, by sebastianThursday, 27. August 2015, 17:27 9 years ago
    i did an interface menu where it is also possible to set the gamevolumes. I can post you a line of script which you could execute when pressing the button. Im not good with my memory so i have to look over my code when i am at home in ca 2 hours

    Thread Captain

    2346 Posts

  • #5, by LekkaThursday, 27. August 2015, 19:00 9 years ago
    This would be really nice, thank you very much smile

    Newbie

    19 Posts

  • #6, by sebastianThursday, 27. August 2015, 19:19 9 years ago
    At home again.
    So there are 5 volume types which you can control separately:
    eMusicVolume , eSoundVolume , eSpeechVolume , eMovieVolume and eGlobalVolume
    (the 5th is more ore less everything)

    To set them you can use "setVolume": http://wiki.visionaire-tracker.net/wiki/SetVolume

    You can use an "execute script" action part on you button and set the Volume for a specific type to 0 - 100.

    Example:
    setVolume(eSoundVolume, 20)
    

    which sets all the Sound effects to 20%

    so to disable music and sound for the intro you can use
    setVolume(eSoundVolume, 0)
    setVolume(eMusicVolume, 0)
    

    then play the video and set the values back after that.

    Never the less im sure that you can control what happens with sound effects in the play movie action part so maybe you dont need these scripts....





    Thread Captain

    2346 Posts

  • #7, by LekkaThursday, 27. August 2015, 19:39 9 years ago
    Du bist nicht zufällig Deutsch? wink

    Didn't try out the action part yet, mostly because I did integrate the intro through uploading it in the game settings, so the intro music is already in it. Somehow it's the loading screen without a loading bar.
    So I don't know how I could integrate it any other way to play _before_ the game actually starts.

    Nevertheless the code seems to be quite useful, thanks for that. I have to look into scripting a little bit more.

    Newbie

    19 Posts

  • #8, by sebastianThursday, 27. August 2015, 20:18 9 years ago
    ja, komme auch aus dem Kartoffelland smile

    Thread Captain

    2346 Posts

  • #9, by LekkaThursday, 27. August 2015, 20:32 9 years ago
    Hach, na dann kann man sich vielleicht auf Deutsch unterhalten wink

    Ich hab den Soundknopf bisher so gelöst, dass ich im Inventar zwei Schalter angelegt hab, einmal Aktiv und einmal Inaktiv.
    Bei Aktiv leuchtet der Knopf rot, bei Inaktiv grau. Wenn man mit links draufklickt, dann

    - Wenn Bedingung "SoundAktiv" wahr
    dann - Animation "Inaktiv" abspielen
    - Inaktives Bild von Schalter "Sound" setzen
    - Musiklautstärke auf 0 setzen
    - Bedingung "SoundAktiv" auf falsch setzen
    - Bedingung "SoundInaktiv" auf wahr setzen
    -Ende Wenn

    ist das jetzt total unlogisch? Hab jetzt quasi den normalen Sound als Hintergrundsound angelegt. Trotzdem spielt er den Introsound nicht, korreliert das irgendwie mit dem Hintergrundsound?

    Newbie

    19 Posts

  • #10, by sebastianThursday, 27. August 2015, 20:38 9 years ago
    Ist der Hintergrundsound nun als Musik definiert in der Scene oder gestartet per Action Part oder wirklich "Sound"?

    Soweit ist deine Abfrage noch logisch grin
    Es gibt übrigens in der Spieloptionen (Zahnrad) rechts einen Punkt "Intro Video", welches glaub ich ganz zu anfang bevor man in Szene 1 kommt abgespielt wird. Ist das nicht eine viel unkompliziertere Lösung?

    Grüße

    Thread Captain

    2346 Posts

  • #11, by LekkaThursday, 27. August 2015, 21:04 9 years ago
    Die normale Hintergrundmusik ist in den Kulissen als Hintergrundmusik für jede Szene gespeichert.

    Das mit dem Introvideo hab ich ja genau so, aber es spielt den Ton nicht ab, wenn ich den Soundknopf eingebaut habe. Ohne den hat es vorher problemlos funktioniert ^^

    Lg

    Newbie

    19 Posts