Jump to content

Altering Guerilla Ops rewards? Dark Event counters?


TheRealSFlo

Recommended Posts

I'm attempting to generate a Guerilla Ops missions or otherwise alter some existing ones that have been scheduled so that they do not counter Dark Events. The entire counter appears to be managed by the GiveGuerillaOpReward() function in X2StrategyElement_DefaultRewards.uc, but overriding the class seems like a haphazard approach to the problem.

 

Also, what about reducing the number of Ops that show up at once? Or modifying the material rewards (Engineers, Supplies, Intel, etc.) that these ops provide? I can't seem to find where those are governed in the code anywhere.

Edited by TheRealSFlo
Link to comment
Share on other sites

This mod is highly related:

http://forums.nexusmods.com/index.php?/topic/3896370-new-mod-make-neutralize-all-enmies-objective-optional/

 

It all seems to happen in X2...DefaultMissionSources.uc. I'm going to go poking around in here to add a quest reward which is an alien soldier (see the playable advent mod) and maybe even to allow the alien soldiers as targets of a rescue operation. This will be configurable so if you don't want to rescue a chryssalid, you can disable each race individually.

 

Some technical discussion here:

http://forums.nexusmods.com/index.php?/topic/3901270-referring-to-nonstatic-functions-from-another-class/

Link to comment
Share on other sites

Allright, I dug around for a while and I'm still deeply confused by this.

 

The code you linked was mostly just an example of template modification. What I'm having trouble with is actually understanding what the hell is going on with the templates themselves.

 

Looking through the source code, there's a ton of references to GetRewardStringFn, but I can't track down where the actual rewards are being drawn from when the mission itself is generated and scheduled (which happens far in advance of the mission at the beginning of each month). Tracking down the functions themselves in the default rewards code just referenced some kind of rewards deck. I found a reference to reward types in the configuration files, but it didn't help at all.

 

Example:

arrSourceRewardMissionTypes=(MissionSource="MissionSource_GuerillaOp", RewardType="Reward_Supplies", MissionFamily="Recover")
arrSourceRewardMissionTypes=(MissionSource="MissionSource_GuerillaOp", RewardType="Reward_Engineer", MissionFamily="Recover")

Removing a line tying engineers to the recovery op don't remove the mission reward as an option for the game. Instead, missions still try and generate with an Engineers as a reward, but throw a redscreen error when they can't find the template that they're looking for.

 

Still very much confused. Can anyone point out where in the name of hell the game is actually randomly grabbing a resource type for a reward?

Edited by TheRealSFlo
Link to comment
Share on other sites

This is interesting code to study. I have been able to figure out bits of it. I think I can answer your particular question, but it may just lead to more questions. In CreateGuerillaOpTemplate, it is filling a RewardDeck with 3+3+3+1+2=12 cards, so that 3/12 = 1/4 of the rewards will be a scientist, etc. Then in SelectGuerillaOpRewardType, I suppose it is selecting from that deck, and doing some cheating if needed (first mission is guaranteed to have an engineer, it will check through IsScientistRewardNeeded whether you badly need a scientist, etc).

 

It seems the guerilla op reward structure is the most complicated. If you want to prevent engineers, it isn't enough to remove them from the deck. You also need to remove all the ways that this cheating code can decide you need one.

 

I think I will probably start out adding simple missions based on the supply raid, which seems to have the fewest possible outcomes.

Link to comment
Share on other sites

I saw your long explanation on /r/xcom2mods which was really helpful. This mod recently popped up on steam which is also highly related. It pushes a new guerilla mission directly into the calendar.

 

http://steamcommunity.com/sharedfiles/filedetails/?id=646124583

 

I've been digging into the code and I think I can hijack all the reward templates, but nothing ready to publish yet.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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