Volume independent from save data.

  • #1, by ke4Friday, 18. August 2017, 13:22 3 years ago
    Hi,

    i run into a problem. I have menu when you can set volume. As soon as you move the slider it gets writen/overwriten into config.ini file.  Writing/reading into file works great.
    A script sets all config data on game launch without problems.

    The problem is when i want to load a save data/game. Right after loading the save data i'm calling the script to load and set the data again as the save data contains ( or might contains) different data. but the script gets ignored and is not runing at all. ( I've tried setting a pause )

    Can i do something about it ( without runing the script at the beginning of every scene )

    Thanks for help.

    Key Killer

    810 Posts


  • #2, by SimonSFriday, 18. August 2017, 13:40 3 years ago
    The savegames contain no info about sound volumes. You would only need to read them again when you open your options menu.

    Thread Captain

    1368 Posts

  • #3, by ke4Friday, 18. August 2017, 13:46 3 years ago
    Ah okay. What i mean then are positions of the slider animations. ( I can solve this by runing the script at the beginning of the settings menu as you suggested)

    There are still things like subtitles on/off, language which i also need to have independent from the save data. Things that are in the config.ini file.

    Key Killer

    810 Posts

  • #4, by sebastianFriday, 18. August 2017, 13:50 3 years ago
    just load the current config.ini file settings and write its content to the designated values inside the game on menu open. This should solve the issues with all misplaced sliders or buttons

    Thread Captain

    2337 Posts

  • #5, by ke4Friday, 18. August 2017, 13:57 3 years ago
    Let's say you launch the game and before loading your game you go to the menu and turn subtitles off. Then you load your game and subtitles are set back on.

    Or if you have multiple games you could load each of this save will have some data about this settings.

    Sliders can be solved on the menu scene load, but i need the rest set after loading the save data to update the conditions/values/data.

    Key Killer

    810 Posts

  • #6, by afrlmeFriday, 18. August 2017, 17:00 3 years ago
    Let's say you launch the game and before loading your game you go to the menu and turn subtitles off. Then you load your game and subtitles are set back on.

    Or if you have multiple games you could load each of this save will have some data about this settings.

    Sliders can be solved on the menu scene load, but i need the rest set after loading the save data to update the conditions/values/data.
    Typically options are saved independently from game save data in virtually every game. If you want to save the volume data then write the sound volumes into VS values each time you update them. On change to options menu, set the sound volumes to the stored integer field of the values you created. Then immediately call the config.ini script or execute a script with the read_ini() function or whatever you called it or the function you created for updating the sliders.

    Imperator

    6842 Posts

  • #7, by ke4Saturday, 19. August 2017, 09:53 3 years ago
    I just can't get it to work. Nothing after the load action part gets executed.

    Key Killer

    810 Posts

  • #8, by sebastianSaturday, 19. August 2017, 09:59 3 years ago
    Could you try the other way around and execute this after the save Action part ? 

    Thread Captain

    2337 Posts

Write post