TheRealSFlo Posted March 20, 2016 Share Posted March 20, 2016 I'm specifically referring to the function SelectGuerillaOpRewardType() in X2StrategyElement_DefaultMissionSources.uc. Trying to limit the reward types, but running into an issue with the deck not repopulating. I basically just wanted to make the material reward either Intel or Supplies based off of a 50% chance, so I overrode the function and stripped out all the stuff that checks for things like how much the player needs Engineers/Scientists. Basically: local int SourceIndex; SourceIndex = CalendarState.MissionRewardDecks.Find('MissionSource', 'MissionSource_GuerillaOp'); if(SourceIndex == INDEX_NONE || CalendarState.MissionRewardDecks[SourceIndex].Rewards.Length == 0) { CreateGuerillaOpRewards(CalendarState); } if(Rand(2) == 1) { return 'Reward_Intel'; }else{ return 'Reward_Supplies'; } I also overrode the CreateGuerillaOpTemplate() function to only have a deck populated with Intel and Supplies. Problem is that the deck seems to empty out after a few ops take place, and they cannot generate properly anymore. I assumed that the limited deck would empty out and repopulate, but I was apparently wrong. Can I just pop CreateGuerillaOpRewards(CalendarState) into the code without any logic preventing it from being called and call it a day? Or is there something I'm missing here. Link to comment Share on other sites More sharing options...
CaveRat Posted March 21, 2016 Share Posted March 21, 2016 Problem is that the deck seems to empty out after a few ops take place, and they cannot generate properly anymore. I assumed that the limited deck would empty out and repopulate, but I was apparently wrong. Maybe I'm missing something, but as far as I can see, you are no longer drawing rewards from a deck. Your function just returns one of the two reward names based on Rand outcome. CreateGuerillaOpRewards() is meaningless in this case. What happens in the game exactly? Link to comment Share on other sites More sharing options...
TheRealSFlo Posted March 21, 2016 Author Share Posted March 21, 2016 (edited) That's what I meant. After enough ops have taken place, the game starts generating ops with no rewards, then freaking out and canceling said ops after they've appeared on the Geoscape. I'm assuming that the game is still looking at what I returned and removing from the deck even though I'm not really referencing it anymore. Edited March 21, 2016 by TheRealSFlo Link to comment Share on other sites More sharing options...
CaveRat Posted March 21, 2016 Share Posted March 21, 2016 That's odd. What method did you use to "override" these functions? Link to comment Share on other sites More sharing options...
Recommended Posts