Crispy on 23/8/2005 at 06:36
Could you perhaps generalize the INI file handling so that GarrettLoader can "patch" any values in any INI file? Just as an example, say there's a file called garrett.ini that I want to modify. (It isn't a real file, I'm just using it to illustrate the idea.)
The user has a garrett.ini file that looks like this:
Code:
[SectionA]
Something = 45
GarrettAwesomeness = 100
[SectionB]
SomethingElse = 2
But the FM author wants to increase Garrett's awesomeness by changing the value of GarrettAwesomeness in SectionA to 555. The FM author would create a file called "garrett_patch.ini" containing this change:
Code:
[SectionA]
GarrettAwesomeness = 555
When GarrettLoader finds the file "garrett_patch.ini" in the FM's zip file, it backs up the user's old garrett.ini and changes garrett.ini to have any settings from garrett_patch.ini. The resulting garrett.ini file would be:
Code:
[SectionA]
Something = 45
GarrettAwesomeness = 555
[SectionB]
SomethingElse = 2
That way you wouldn't have to worry about special cases and releasing new versions of GL every time a useful INI file setting is discovered; the FM author just creates the appropriate file and away they go.
It shouldn't be too hard to implement, assuming you have a decent INI file parser.
potterr on 26/8/2005 at 21:19
I think I can do that, ok what are the possible ini files that can be used (I know there are a certain amount in the shipped game but are there any extra that are introduced via the editor?
Crispy on 28/8/2005 at 01:41
Couldn't you just make it take off the "_patch" bit and then look for an INI file by that name? (So you wouldn't have to hardcode all the INI names; in fact you wouldn't even need to know what they were. The FM author would just name their _patch.ini file appropriately, and it would automagically figure out which INI file to patch.)
*shrug* Anyway, in case you do actually need them, here are all the INI files in my single-folder installation:
editorprefs.ini
user.ini
system\default.ini
system\FacialExp.ini
system\MotionTags.ini
system\reverbstyles.ini
system\T3AutoTag.ini
system\T3Camera.ini
system\T3Hud.ini
system\T3InputMem.ini
system\T3ItemGrid.ini
system\T3Menu.ini
system\T3PhysicsSound.ini
system\T3PlayerAnims.ini
system\T3Rumble.ini
system\T3UI.ini
system\T3UILights.ini
system\T3UISoup.ini
potterr on 28/8/2005 at 08:53
Quote Posted by Crispy
Couldn't you just make it take off the "_patch" bit and then look for an INI file by that name? (So you wouldn't have to hardcode all the INI names; in fact you wouldn't even need to know what they were. The FM author would just name their _patch.ini file appropriately, and it would automagically figure out which INI file to patch.)
I asked more as a case there are any new ini files needed to be created.
The way I was going to do it (which would respect people original ini file settings) was to query the patch file and update or add to the users ini file (after backing up of course) anyhing that needed to be updated rather than a complete file replacement. That way if an ini file is not found in the original install, it is then added for the FM.