Jump to content

Working on a little mod at the moment. Minor issue. Help please?


UltraBacon

Recommended Posts

Recently started a little project that aims to simply match the averages for the Second Wave option Hidden potential to more or less equal the averages of not having the option enabled. While I'm certain I've got the hp and aim gains down pat, I stumbled across some interesting findings during my escapades.

 

I've found that while while Xcomgame.upk has an object called TacticalGameCore.LevelUpStats which HAS code for the second wave option, it doesn't appear to do anything on the randomized level gain front... Despite having an entry for MECs. Though this might be because of the SoldierStatProgression in XGTacticalGameCore within XComGame.upk

 

What actually seems to handle this is the XcomStrategyGame.upk object XGStrategySoldier.LevelUpStats - Which unfortunately doesn't include mobility boosts at all - which also explains why i've NEVER seen a soldier gain a mobility in all the time i've played Enemy Within.

 

I want to add the probability for mobility gain for each class back in - but I'm at a loss as to how to do that with PatcherGUI. I'm pretty novice with code, and while I can read the default code of Xcom in UE explorer without issue, the code for Patcher is something I've yet to really decipher. I can do simple digit hex edits using the program, but anything more advanced like pseudocode I have yet to figure out, despite my efforts. The readme included hasn't been of much help, and I've gotten farther looking at examples written already - but the vast majority are beyond my scope.

 

So. I ask you guys - how would I add a %chance to gain a mobility on level up for a class inside XGStrategySoldier.LevelUpStats? I've been trying for most of yesterday to no avail. Nothing has compiled yet.

 

Link to comment
Share on other sites

It looks like the tactical versions are never used, at least not in the normal game (maybe mostly a leftover from EU except multiplayer?) Not sure the history behind it.

 

But, level up stats are awarded in the geoscape, so XGStrategySoldier.LevelUpStats is the right place. As for how to do it, it'll be a little tricky and will depend if you want the mod to work on vanilla EW or LW as LW changes this function extensively.

 

You don't need to write the entire function by hand, there is a tool that comes with upkutils called HexToPseudoCode that will dump an entire function into a pseudocode patch file ready for you to modify. That's the first step. Then, you are gonna have to learn some of that hex code to be able to make the necessary changes to add mobility, and you're unfortunately going to have to suffer the pain of the limitations of patch files, which is you can't introduce any new local variables, so you can only use the ones that are already there in creative ways. You also can't easily introduce any new ini entries, so you'll need to reuse the ones that are already there (and LW already has done this if you're using LW).

 

The wiki entry for hex values (http://wiki.tesnexus.com/index.php/Hex_values_XCOM_Modding) will be a good reference, I always have this open in a browser tab when I'm working on patches. If you're working on LW, you can probably just copy and paste a line that handles aim or hp and make the minor changes needed to apply mobility. You can pack your new values into iHP, for example, and use a similar formula: e.g. change xxyy to zzxxyy, where zz is a % chance to add one mobility.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...