dreadylein Posted November 14, 2012 Share Posted November 14, 2012 mother of batch script :D seems like a bunch of work and pretty much explainse the limitations :) Thanks for this prevwie And thanks for your time explaining of couse :) Link to comment Share on other sites More sharing options...
FMod Posted November 15, 2012 Author Share Posted November 15, 2012 Well, most limitations come from how the XComGameCore format itself is a mix of proper settings and sequential lists. Using shell script adds a few obscure ones, like how ini files can't contain empty lines. Most can be worked around, but I would rather spend effort broadening the functionality than polishing it. The idea is, in the end, when used as a mod installer, that you would have a mod zip package containing a ruleset with options, upk tweaks, text (int) edits, etc, and install it as a package via one interface with the ability to pick options.Why I think options are needed is because XCOM as a strategy game calls for them, and because every good overhaul for seriously moddable games like TES or FO3 includes strong customization. Anyway, file uploaded:http://xcom.nexusmods.com/mods/80/v.0.45, little changed really, other than a backup system added. Link to comment Share on other sites More sharing options...
FMod Posted November 16, 2012 Author Share Posted November 16, 2012 Update: Patching functionality works now. I just automatically converted warspace into a human-readable patch (i.e. changed lines only, not a diff), applied that patch to the vanilla ruleset, got a modified ruleset. There still are some kinks to be worked out. For one, the process is done line by line, so it can take several seconds for large patches. Still not all things are patchable. Automatic patch creation doesn't ignore whitespace yet, but that's low priority, because 1) you'll usually make patches manually, 2) most mods don't mess with whitespace anyway.Queued patches (in ruleset selection) are not yet implemented. On the upside, I found a way to make everything patchable without risking breaking the ruleset. Unfortunately it will require manually checking for content type, so I'll work with it later, if anyone actually wants that functionality. Version 0.50 uploaded. It's pretty much usable now.Right now my primary concern is reliability and stability - to see if it works and if anything breaks it. Link to comment Share on other sites More sharing options...
FMod Posted November 17, 2012 Author Share Posted November 17, 2012 (edited) 4 versions in and the first major bump in the road. I made most patching work, but line block patches (several settings with the same name) are still a problem. Just lost an hour implementing a solution, and it didn't work; broke existing functionality too. That's not the end of the line, tomorrow I'll try another, and if that doesn't work, insert a vbs code, or, if nothing else helps, a compiled cpp piece. Right now I'm too close to the major milestone, being able to patch a whole ruleset, to put internal uniformity above end results. It's hard to overstate said milestone; basically, at that point, and once it's tested and glitch-free, there will be very little reason left to apply GameCore.ini mods any other way. You'll be able to arrange mod files any way you like, edit out lines that aren't needed, etc, and to that adds the ability to insert int patches right in the text. For instance, right next to a modded grenade entry to put in the exe you'll have a line going like:;XcomGame.int: [eItem_FragGrenade] =... Does 4 damage to all targets in blast area..., which will be applied to the int on patch processing. Commented out in case someone applies it with modpatcher directly (the game ignores comments). Since I'll have to cut out the new code, the next version will be delayed a little, and will probably include the ability to do everything except line block patches. Not perfect yet, but short of a move to patch-only mod distribution, int patches are a more useful function to add. The next step will be another stab at line blocks, and then probably UPK patch integration. It will just call the existing program from within a patch, not replace it, of course. Edited November 20, 2012 by FMod Link to comment Share on other sites More sharing options...
FMod Posted November 20, 2012 Author Share Posted November 20, 2012 Limited progress. I got a very pretty linear code with which pretty much everything works and which safely ignores poisonous lines such as this:SAT_NEARBY_HELP_DEFECT=0.7 ;Else If continent has one or more satellite, "Chance of Leaving"*SAT_NEARBY_HELP_DEFECTNote how evil it is. You have a comma; else and if; quote characters; and finally a second copy of SettingID at the end. Unfortunately said code is excruciatingly slow: it takes several seconds even for small patches, and probably half an hour for a total ruleset install - I didn't even track it. It takes about 2 million calls in total (because it checks everything) and maybe a few billion ops; could in theory be under a second, but, Windows scheduling.For comparison the old code took only a couple seconds to patch a complete ruleset (skipping a few things). But both the file being patched and the patch had to be completely clean. Fortunately its level of paranoia is unnecessary; I'll start cutting out unnecessary checks to make a hybrid code that should work much faster. Alternatively I might just translate that code to cpp, where it will indeed work much faster, but that's if the former doesn't work. Link to comment Share on other sites More sharing options...
FMod Posted November 20, 2012 Author Share Posted November 20, 2012 It works. I'm not ready to write a proper announcement, because it will be pretty significant, but all patching features work now. Multi-lines were tricky, but they work. There are just two or three settings that don't work - and they're easy to fix. Even then, what doesn't work, is simply ignored. All I need now, before making more out of it, is for others to test if it indeed works, tell if it does. And if you can find a way to break it with a legitimate-looking patch. And if yes, how specifically. By breaking I mean not just rejection, but wrong output. Except for inserting something bad inside a multiline block; that's intentionally left for this version (to test for guaranteed failure), and now that I've written it I won't forget to fix it. Reminding, a patch is gamecore.ini with only the lines you want changed left in it. It can be 700 lines long or 1 line, in any order, and is applied to a ruleset (complete gamecore.ini). Patches are put in the Mods subfolder.Any components that are there can also be used as patches. A patch (rather crude one) can also be made using the built-in feature. Link to comment Share on other sites More sharing options...
Recommended Posts