I have been creating a game launcher with settings that saves into an .ini setup.
this version has check-boxes and lists to skip through.
It wil save the settings, and load them as well, but it does not apply the settings, you need to make that in your game blend yourself (example in the screenshot and an adjusted script below).
If i did not forget anything, “everything” is explained in the script.
(It is python based, meaning python handles the buttons, etc)
And here is a video to see it in action:
make a text file and copy/paste these settings into it, and save it as settings.ini at the same location as the blend file
(forum don’t let me upload .ini files, Keep the settings as is, change it through the launcher)
[graphics] difficulty = Normal mipmap = 2 af = 16 lights = 10 resolution = 1920x1200 fullscreen = True vsync = False [filters] bloom = True dof = False fxaa = True ssao = False [launcher] difficulty_index = 1 mipmap_index = 2 af_index = 4 lights_index = 9 resolution_index = 20
Load and set the settings in your game blend:
from configparser import ConfigParser from bge import logic, render def set_settings(cont): own = cont.owner parser = ConfigParser() parser.read(logic.expandPath('//') + "settings.ini") render.showMouse(False) for section in parser: if section == 'graphics': render.setAnisotropicFiltering(parser.getint(secti on, 'af')) render.setMipmapping(parser.getint(section, 'mipmap')) render.setFullScreen(parser.getboolean(section, 'fullscreen')) reso = parser.get(section, 'resolution').split('x') render.setWindowSize(int(reso), int(reso)) if parser.getboolean(section, 'vsync') == True: render.VSYNC_ON else: render.VSYNC_OFF elif section == 'filters': for filter in parser[section]: own[filter] = parser.getboolean(section, filter)
Here is my working example on how to load the settings (only the open bricks and properties are needed)
game_laucher.blend (679 KB)
* Filters are not included, look in the resource section of the forum, lots of filters there *
Have fun with it,