There is a way to have a control on read/write on config.ini in viosionaire?

  • #1, by MortoAllegroSaturday, 07. March 2015, 12:53 9 years ago
    There is a way to have a control on save/write on config.ini in visionarie?
    i already try this: http://wiki.visionaire-tracker.net/wiki/Read/Write_Config.ini_(CMS)#Resources

    but seems audio write/read function are not working, Plus there is no .ved file on the resource.
    there is an working example?

    Newbie

    44 Posts


  • #2, by afrlmeSaturday, 07. March 2015, 14:12 9 years ago
    was there not a .ved included? oops.

    audio reads / writes automatically. why I didn't need to check or update them. They are automatically added to the end of the config.ini, if not already included in the config.ini file.

    * edit: ah there is no resource file available yet. I intended to include one when I get round to sorting out a new menu template.

    Imperator

    7278 Posts

  • #3, by MortoAllegroSaturday, 07. March 2015, 14:22 9 years ago
    audio reads / writes automatically ?
    when i quit my game and then reopen it, the audio settings are back to normal value...i suppose 100.
    there's no way to have it work without Lua scripting?

    Newbie

    44 Posts

  • #4, by afrlmeSaturday, 07. March 2015, 15:12 9 years ago
    It should automatically set the audio on game launch to whatever is written in the config.ini file, unless you are updating the values before quitting or on game launch.

    To set volume of audio it's as simple as...
    setVolume(eGlobalVolume, 80)
    setVolume(eMusicVolume, 50)
    -- etc...
    

    Imperator

    7278 Posts

  • #5, by MortoAllegroSaturday, 07. March 2015, 16:28 9 years ago
    yes, i know that code, but with that code you change that value at game start, or during the game.

    when you quit the game, the value is back to 100..

    i mean i need, when player change the volume control(that i have made in my config screen) that control save the value on the config.ini file, than whenever you restart the game, the audio setup is always the same.

    i use increase and decrease volume on visionaire to change volume settings.
    but VIsionaire remember that only during the game. Not when i quit.


    Newbie

    44 Posts

  • #6, by MortoAllegroSaturday, 07. March 2015, 16:35 9 years ago
    Sorry.. don't need to answer me..
    i was wrong, there is a setup that i have forgot that setup my audio up to 100 whenever the game start.
    my mistake.

    sorry ^^

    Newbie

    44 Posts

  • #7, by afrlmeSaturday, 07. March 2015, 16:58 9 years ago
    Ai sus! What did I say? grin

    Imperator

    7278 Posts

  • #8, by MortoAllegroSaturday, 07. March 2015, 18:22 9 years ago
    you are a sniper! grin

    Newbie

    44 Posts

  • #9, by MortoAllegroSaturday, 07. March 2015, 20:07 9 years ago
    sorry for bothering you but i try to change a value stored in a sceneMenu
    i try this code

    getObject("Scenes[optionMenu].SceneValues[Music_Volume]").Int = 0
    or this
    getObject("Scenes[optionMenu].SceneValues[Music_Volume]"):setValue(0)
    


    what's the correct syntax?

    Newbie

    44 Posts

  • #10, by afrlmeSaturday, 07. March 2015, 21:43 9 years ago
    Neither.

    You have used incorrect syntax for both. If you want to use getObject method then you should fully use getObject, getLink & setValue syntax.

    getObject...
    getObject("Scenes[optionMenu].SceneValues[Music_Volume]"):setValue(VValueInt, 0)
    

    shorthand...
    Scenes["optionMenu"].SceneValues["Music_Volume"].Int = 0 -- or...
    Scenes["optionMenu"].SceneValues["Music_Volume"].ValueInt = 0 -- or...
    Values["Music_Volume"].Int = 0 -- why bother direct linking if you probably only have one value with that name?
    


    P.S: it is possible that you may be able to mix & match shorthand Lua with the getObject method, but for sake of consistency it's better to stick with one or the other. In the next release, shorthand is a lot more complete & you can access pretty much all data structure fields & tables with it, unlike the current public build.

    Imperator

    7278 Posts

  • #11, by MortoAllegroSunday, 08. March 2015, 17:37 9 years ago
    ok.
    i have this object into "optionMenu" scene that i move to mark the position of the music level.

    move object works fine when i'm on the scene it goes up and down, but whenever i restart the game, the initial position of my object is restored to the original position of the object.

    how i can tell visionaire to save the last position of that object even when i quit?

    example:

    music : - -------||--- +

    i use move obj to change marker position and decrease music level.
    but as i say, whenever i leave the scene the position is restored

    may i need to use Lua?


    Newbie

    44 Posts