Config.ini script

  • #1, by nelsoncSunday, 01. February 2015, 06:35 10 years ago
    Hi all,

    The script for reading and writing to config.ini as available here http://wiki.visionaire-tracker.net/wiki/Read/Write_Config.ini_(CMS) uses a variable localAppDir. Where is it defined ?

    Newbie

    43 Posts


  • #2, by richard-gerumSunday, 01. February 2015, 10:45 10 years ago
    I think it is autimatically defined by the engine, you can just use it. It referes to the directory your game files (savegames, message.log, and config.ini) are stored.

    Newbie

    15 Posts

  • #3, by afrlmeSunday, 01. February 2015, 13:34 10 years ago
    Aye, the localAppDir is defined by the engine, sorry. You used to be able to include the config.ini file in your .ved root folder in 3.7.1 but since 4.x most things such as save games, log files & the config.ini are stored in a separate folder in c:/users/username/appdata/local/game-company-ved-name/ -- obviously not that exact path, but you get the idea.

    Imperator

    7285 Posts

  • #4, by nelsoncSunday, 01. February 2015, 17:57 10 years ago
    Also, if company name not set, the config.ini file's folder is the game name.

    Newbie

    43 Posts

  • #5, by nelsoncSunday, 01. February 2015, 18:07 10 years ago
    I'm getting the following error message while launching the game by doing "Save and run":
    [string "readWriteConfig"]:92: attempt to index local 'fw' (a nil value)
    Any idea ?

    Newbie

    43 Posts

  • #6, by nelsoncSunday, 01. February 2015, 18:22 10 years ago
    Found it : had space and 'é' in my project name. File explorer doesn't like them.

    Newbie

    43 Posts

  • #7, by nelsoncSunday, 01. February 2015, 18:27 10 years ago
    There is a bug in the script file :
    for lines in io.lines(fn) do
    

    should be
      for lines in io.lines(localAppDir .. fn) do
    

    Newbie

    43 Posts

  • #8, by nelsoncSunday, 01. February 2015, 18:34 10 years ago
    I am now getting the error :

    12:28:07: [string "readWriteConfig"]:46: call to setValue on object  (eGame,-1) failed
    

    Newbie

    43 Posts

  • #9, by afrlmeSunday, 01. February 2015, 18:36 10 years ago
    actually I believe it should probably be...
    for lines in io.lines(fr) do
    


    Typo mistake.

    Imperator

    7285 Posts

  • #10, by nelsoncSunday, 01. February 2015, 18:42 10 years ago
    I think the lines function expects a filename. I'm getting the error :

    12:41:31: [string "readWriteConfig"]:41: bad argument #1 to 'lines' (string expected, got userdata)
    


    on that line now, reverting to

    for lines in io.lines(localAppDir .. fn) do
    

    Newbie

    43 Posts

  • #11, by nelsoncSunday, 01. February 2015, 18:46 10 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