Config.ini script

  • #10, by nelsoncSunday, 01. February 2015, 18:46 8 years ago
    Still getting the error :

    12:44:47: [string "readWriteConfig"]:46: call to setValue on object  (eGame,-1) failed
    Line : 
     if line == "fullscreen = no" then wm:setValue(VConditionValue, false); print("window mode is currently set to Windowed") end
    

    Newbie

    43 Posts


  • #11, by nelsoncSunday, 01. February 2015, 19:02 8 years ago
    Needed to create conditions cfg_wm, cfg_subs, cfg_cbm and values cfg_res and cfg_fx. It was written in the wiki but they were not listed in bold :p .

    Thanks for your help, AFRLme !

    Newbie

    43 Posts

  • #12, by afrlmeSunday, 01. February 2015, 19:34 8 years ago
    Yeah er sorry. I wrote the page a while back & the script.

    The script is more of a template for you to write your own. I don't expect everyones menu to be the same, not contain the same options. Some people might even add additional options to their menu.

    Imperator

    7138 Posts

  • #13, by nelsoncSunday, 01. February 2015, 23:06 8 years ago
    Your script is great actually. For someone like me who never made an adventure game it does the job really well.

    Newbie

    43 Posts

  • #14, by afrlmeSunday, 01. February 2015, 23:38 8 years ago
    The script is geared more towards commercial releases where it's more important that game options should be remembered. You could use the same method for writing data to other files too, such as game achievements & bonus unlocks etc, but I would recommend using some kind of encoding when writing that sort of stuff.

    Imperator

    7138 Posts

  • #15, by afrlmeMonday, 02. February 2015, 14:06 8 years ago
    I think I will rewrite this at some point so that it uses the new shorthand code instead. It is quite a large, bulky script in comparison to what I normally write, but there wasn't much of a way around it as you do need to create each line in the config.ini. You was right about replacing: fn with localAppDir .. fn. I think when I wrote it that the config.ini was still being created in the game root folder which is why it worked back when I wrote it.

    Imperator

    7138 Posts

  • #16, by LebosteinWednesday, 22. April 2015, 11:11 7 years ago
    Here on Mac OS I see two "config.ini" files for one game. One in the game data and one in the user datas:

    1.) /Users/Username/Applications/Game.app/Contents/Resources/config.ini
    2.) /Users/Username/Library/Application Support/Company/Game/config.ini

    How does ist work? Can I overwrite parameters in the first ini (should be untouched) with parameters in the second one? How I get the path of the second one to modify it with lua?

    Key Killer

    620 Posts

  • #17, by afrlmeWednesday, 22. April 2015, 11:21 7 years ago
    David told me that the one in the game folder is the initial config.ini that is used for the first launch of the game - in case there isn't one available in the users... folder. The ones you write to will be in the users... folder.

    I think it's just a fallback thing.

    Imperator

    7138 Posts

  • #18, by LebosteinThursday, 23. April 2015, 08:23 7 years ago
    Can you add to the turorial (http://wiki.visionaire-tracker.net/wiki/Read/Write_Config.in...) how I can find the local user config.ini? Is there a variable with the path to this directory?

    Key Killer

    620 Posts

  • #19, by afrlmeThursday, 23. April 2015, 12:10 7 years ago
    If you want to find out where your projects local user folder is...

    a. run the game through the vs editor.

    b. hit TAB key to bring up the developer console.

    c. type...
    exec print(localAppDir)
    

    ... & then hit enter.

    d. type: PRINT LOG & then hit enter. It should display all entries printed to the messages.log file. PG UP & PG DOWN will allow you to change page index.

    e. Use this to locate the path to your local user folder. All saves, log files & the config.ini will be located there.

    Imperator

    7138 Posts

  • #20, by LebosteinThursday, 23. April 2015, 12:34 7 years ago
    Thanks. More questions:

    1. How I save the text speed in a non-speech adventure?
    2. Why the volume parameters are saved automatically? Why the other settings of a game are not automatically saved?

    Key Killer

    620 Posts