Menu
Login
Language
DE EN FR ES IT CZ
Back

Config.ini script

  • #1, by nelsonc Sunday, 01. February 2015, 06:35 11 years ago Quote
    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-gerum Sunday, 01. February 2015, 10:45 11 years ago Quote
    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 afrlme Sunday, 01. February 2015, 13:34 11 years ago Quote
    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

    7290 Posts

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

    Newbie

    43 Posts

  • #5, by nelsonc Sunday, 01. February 2015, 18:07 11 years ago Quote
    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 nelsonc Sunday, 01. February 2015, 18:22 11 years ago Quote
    Found it : had space and 'é' in my project name. File explorer doesn't like them.

    Newbie

    43 Posts

  • #7, by nelsonc Sunday, 01. February 2015, 18:27 11 years ago Quote
    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 nelsonc Sunday, 01. February 2015, 18:34 11 years ago Quote
    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 afrlme Sunday, 01. February 2015, 18:36 11 years ago Quote
    actually I believe it should probably be...
    for lines in io.lines(fr) do
    


    Typo mistake.

    Imperator

    7290 Posts

  • #10, by nelsonc Sunday, 01. February 2015, 18:42 11 years ago Quote
    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 nelsonc Sunday, 01. February 2015, 18:46 11 years ago Quote
    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