Config.ini script

  • #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


  • #21, by afrlmeThursday, 23. April 2015, 13:17 7 years ago
    1. Not sure what you mean by this. Could you provide me with a few more details please?

    2. To be honest I'm not sure why the audio is automatically read & written to the config.ini file. It just seems to add the values to the end of the file. I'm not sure what happens if you try adding the values manually to the config.ini, at some point higher up.

    Fullscreen & window mode haven't been runtime optional until lately. In the next build you will be able to toggle between window mode & fullscreen with alt+enter or with a lua function. However I don't think the value will be written to the config.ini file automatically; same goes for language & window resolution.

    The general idea behind the config.ini was to provide developers with an option for generating custom parameters for their games. It doesn't just have to be used for your game options either. You could use it for storing game score, overall playtime or game completion percentage etc.

    Imperator

    7138 Posts

  • #22, by EinzelkämpferThursday, 23. April 2015, 14:40 7 years ago
    1.
    I had done something like that some years ago. I hope it still works:

    Get the current text speed value:
    val = game:getInt(VGameTextSpeed)
    


    Set the text speed value:
    game:setValue(VGameTextSpeed, val)
    

    Newbie

    81 Posts

  • #23, by LebosteinThursday, 23. April 2015, 14:51 7 years ago
    @ARFLme: Textspeed? The "Set speed for text output" action part? This setting was an important setting in the pre-talkie-age of graphic adventures.... My adventure is a non-talkie adventure and I want to use this function to allow the user to match the text speed with the reading rate...

    I use a coupled variable with this action part.

    @einzelk. Thanks for the hint. I want to save this variable inside the config.ini now.

    Key Killer

    620 Posts

  • #24, by LebosteinThursday, 23. April 2015, 15:09 7 years ago
    Ah! The textspeed is saved within the savegames. Very good.

    Key Killer

    620 Posts

  • #25, by LebosteinTuesday, 26. May 2015, 09:57 7 years ago
    I am very confused about the config.ini keywords. I am not sure which keywords are interpreted by the visplayer and which keywords are only placeholders for reading/writing via script. It is right, that "TextLanguage" and "SpeechLanguage" are no official supported settings? Are these keywords only for the special read/write config.ini script from the wiki?

    PS: Is this a complete list of all supported keywords of the visplayer?
    http://wiki.visionaire-tracker.net/wiki/Ini_File
    If yes: If I use LANGUAGE = English in the ini file, the game starts with english language, but the system value GameStandardLanguage returns "German" nevertheless. How I can find out which is the current language of the running game?

    Key Killer

    620 Posts

  • #26, by afrlmeTuesday, 26. May 2015, 12:48 7 years ago
    The page you linked should contain all the officially accepted keywords / parameters for the config.ini.

    I changed Language to TextLanguage & SpeechLanguage because since 4.x you have been able to set different languages for text & speech so that you could for example have character speak in English but display text in German.

    To check current game language...
    print( game.StandardLanguage, game:getName(), game.SpeechLanguage:getName() ) 
    

    Then check log via console or by browsing to where the messages.log file is.

    P.S: what is & what are not official keywords is irrelevant as you can always manually set them yourself in the editor via Lua script when reading from the config.ini file.

    Imperator

    7138 Posts

  • #27, by LebosteinTuesday, 26. May 2015, 14:06 7 years ago
    Ok, then it could be a bug. My game has two languages at the moment: "german" and "english". If I set the language in the ini file to "english", then the StandardLanguage returns "german" but english texts are shown. It seems the variable game.StandardLanguage is not updated if you set the language from the ini file.

    But my question is not answered. I think the player don't accept the "TextLanguage" and "SpeechLanguage" by default. These parameters are only useful if you write a script that reads the config.ini (in other words: these parameters are self defined and can have arbitrary names). The only official and supported parameter is "Language". Or is this an oudated ini parameter from 3.x and should not be used?
    LANGUAGE = {German|English...}
    Choose in which language the game is to be started. Type in the exact name of the language as configured in the editor.

    As I said, it works. But with that ini parameter the game.StandardLanguage is not updated...

    Key Killer

    620 Posts

  • #28, by afrlmeTuesday, 26. May 2015, 14:42 7 years ago
    I said they were what I created. They are not officially supported. Also I believe the language name has to be written the same as however you wrote it in the languages section of the editor.

    The keywords bit themselves are not case sensitive. I'm not sure about the values section.

    If it's not automatically registering Language = English then it could be a bug in the build. I've always manually set it with Lua script when I read from the config.ini, so I couldn't say for sure.

    By the way have you created a config.ini in the localAppDir... folder? or whichever folder it should be created in based on your OS.

    When you build / compile your game, it gives you a config.ini file which can be read from the initial time your game is launched. This should only contain the basic minimum as the config.ini script will not read from that. It only reads the config.ini located in localAppDir folder.

    Remember that you can find out where the localAppDir folder is located on your machine by opening up the console with TAB, then typing...
    exec print( localAppDir )
    

    press enter, then type...
    print log
    

    press enter again to show the messages.log information & locate your localAppDir.

    Imperator

    7138 Posts

  • #29, by LebosteinTuesday, 26. May 2015, 14:54 7 years ago
    I forgot to mention: I don't read or write the ini file from inside the game. The only thing I do is to add some parameters (documented here: http://wiki.visionaire-tracker.net/wiki/Ini_File) to the config.ini in my localAppDir folder.

    Key Killer

    620 Posts

  • #30, by afrlmeTuesday, 26. May 2015, 15:35 7 years ago
    Ah sorry then, I don't really know what to tell you. It is recommended to manually read the file & update the settings yourself as only the volume settings are read & updated automatically, even though some of the settings such as fullscreen, resolution, resizeable, language & data etc are supposedly read automatically by the engine.

    The config.ini script I wrote was just one example, & quite a complex one at that. The script itself & the parameters don't have to be so complicated. You don't even have to add the #comment lines to the config.ini file, as this (below) would also be perfectly acceptable...
    file = data.vis
    fullscreen = yes
    resolution = auto
    resizeable = yes
    language = English
    

    the audio parameters would get added & updated automatically.

    Imperator

    7138 Posts