Does anybody have a link to a useful tutorial that would help me with using external data files for my game? I’m planning on having an external loader app which will be able to set several things, such as resolution, bit depth, refresh rate, maybe graphical quality, as well as controls for both keyboard and gamepads. This program would store these settings in an external ini file which I want my game to be able to load. Now, the screen settings aren’t as important as I can have my external app set those in the command line (as well as hiding the command window) but I’d like my game to be able to load the ini file in python, read the control settings, and assign those controls to sensors I already have placed in my game for those controls.
I’m on a night shift and I’m too shattered to begin to think of the python needed to load and read .ini files. But it’s pretty straight forward. Google for a module called configparser - a python module designed for working with .ini files. With that module you can load variables into python and apply them to sensor settings or anything else to that matter. I would post up a short example, but I’m too tired, so here’s a link instead
Hope this helps.
thanks, that sounds like exactly what I need!
No worries. It’s been a few weeks since I’ve posted up any support, and given all the resources I’ve been using on here lately I must remember to frequently give back what I can to the community.