bunnytrain Posted May 16, 2016 Share Posted May 16, 2016 (edited) After a bunch more work, I wanted to take this moment to announce that MCM is now publicly available both here and on Steam Workshop! We've been working on this for a while, so it's an honest sigh of relief to finally say "yes, you can download it now!" Nexus: http://www.nexusmods.com/xcom2/mods/573/Steam Workshop: http://steamcommunity.com/sharedfiles/filedetails/?id=667104300 It's a soft launch because this mod is only as good as the mods that use it. So I want to offer my help here to any modder who is interested in building an in-game configuration menu for their own mod. I've already written a bunch of documentation here, but of course I can't anticipate every question. The features, in short:- MCM handles (almost) all of the UI code for you!- It's an optional dependency, meaning your mod will still work even when MCM isn't installed.- You compile directly against the API, so you'll know that you're making the right API calls.- Built-in versioning mechanism so that stuff doesn't break when your mod version and MCM version are out of sync.- Laundry list of advanced capabilities. So what now? Bug fixes and improvements. Some things still have bugs. Also, we want to add more types of settings and other capabilities. You can see the plans in the issue tracker. Many thanks to: Super-d22, Blue_Raja, and Abeclancy for their help in designing, coding, and testing. Edited May 16, 2016 by bunnytrain Link to comment Share on other sites More sharing options...
Zyxpsilon Posted May 16, 2016 Share Posted May 16, 2016 Excellent.. means we (now) have a good alternative to LWS-ToolBox system. I've got nothing against them.. except maybe being forced into "activating" a few features we just don't want or that we already had solid solutions for with other mods. Trick (for me) will be to actually make proper use of certain coding principles as to implement particular stuff. I really hope to get some timely help from the community (and the MCM coders) for these attempts -- eventually! Many thanks for that completed device. :D Link to comment Share on other sites More sharing options...
bunnytrain Posted May 18, 2016 Author Share Posted May 18, 2016 (edited) So it's been a whirlwind couple days dealing with the various bugs. Two major updates to add: 1. Now compatible with LW Toolbox. It overrides the options screen, so we had to change how we hook into it. 2. Dealing with the mess of INI's that make in-gave saving of settings possible is... messy and has some serious gotchas. I added an extra section of the tutorial on how to do it properly. Also, I have two requests for help: - I'm looking for a way to hook into the game at a point before templates start being loaded. Any ideas?- Got a mysterious report of Xbox controller buttons showing up in the UI. Huh? Anybody know what this might be? Edited May 18, 2016 by bunnytrain Link to comment Share on other sites More sharing options...
fxsjosh Posted May 18, 2016 Share Posted May 18, 2016 Templates get loaded during the engine startup, before you even hit the shell screen. What do you need to do before then? Link to comment Share on other sites More sharing options...
Zyxpsilon Posted May 18, 2016 Share Posted May 18, 2016 - Got a mysterious report of Xbox controller buttons showing up in the UI. Huh? Anybody know what this might be? This mainly happens when you load a Tactical Save right after activating new Mods. Link to comment Share on other sites More sharing options...
bunnytrain Posted May 19, 2016 Author Share Posted May 19, 2016 fxsjosh: One of the mods using MCM is using config variables as a flag for loading/not loading certain templates. Since the INI file (in My Games vs. mods folder) might or might not exist by that point, I was curious about whether there would be an elegant way to check for and possibly create the INI file. There's an alternative that works fine, it's just a bit verbose. Link to comment Share on other sites More sharing options...
fxsjosh Posted May 19, 2016 Share Posted May 19, 2016 Config files should all be existent and read in by the game by the time templates are being created - otherwise setting values based on config data would not work correctly. Link to comment Share on other sites More sharing options...
bunnytrain Posted May 19, 2016 Author Share Posted May 19, 2016 (edited) Hey fxsjosh! Yeah, I get the rule for doing that. However, in order to let mods save configuration changes to INI from in-game, you currently have to break a few rules in a few specific ways. (Wrote up the exact method here.) It's because SaveConfig() doesn't work to write settings back to INI files located in the mods folder, but it does work to write settings to INI files located in the My Games/XCOM2 folder. So if you want to be able to save settings to INI files in-game, it leaves you with a few limited options, all of which seem to involve calling SaveConfig() or StaticSaveConfig() on an INI file that should exist but currently doesn't. One other alternative is to save the data into the game state, but that doesn't persist across different campaigns whereas INI stuff does. Now that I mention it, I don't suppose you know of a way to do this that doesn't involve trying to be clever about breaking INI/config handling in just the right places? Edited May 19, 2016 by bunnytrain Link to comment Share on other sites More sharing options...
fxsjosh Posted May 19, 2016 Share Posted May 19, 2016 The game uses XComOnlineProfileSettings and XComOnlineProfileSettingsDataBlob to store info outside of individual campaigns. Unfortunately I don't believe there's any access for modders to make use of in there. Your solution looks acceptable to me, given the constraints of the handling of config files. Link to comment Share on other sites More sharing options...
jgbaxter Posted May 19, 2016 Share Posted May 19, 2016 I like this, I was planning on making a version of LW TB for Partisan War, maybe this is another option. In any case, kudos for the mod, it's a nice idea. :) Link to comment Share on other sites More sharing options...
Recommended Posts