Jump to content

TheRealSFlo

Members
  • Posts

    21
  • Joined

  • Last visited

Nexus Mods Profile

About TheRealSFlo

TheRealSFlo's Achievements

Explorer

Explorer (4/14)

0

Reputation

  1. 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.
  2. 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.
  3. Nope. GameState classes cannot be overridden short of entirely recompiling XComGame.upk and replacing it with your mod. Thing's stuck as-is unless there's an ultra-clever workaround someone can come up with. Pisses me off a bit. I get that they restricted access to GameStates to keep mods from breaking the game, but what in the hell is up with the if-then logic for slot stat assignments? I thought they said they were going to stop hardcoding stuff.
  4. Is it possible to add a third utility slot to soldiers? It seems like Firaxis hard-coded it and I'm beyond frustrated. You see, there is a stat tied to soldiers that governs the number of items they carry: eStat_UtilityItems. However, instead of doing something sensible like just tying that stat to an integer value on armor, each piece of armor has a flag named bAddsUtilitySlot attached to it. The game appears to check that flag in 'XComGameState_Unit.uc' and assign the eStat_UtilityItems stat a value of either 1.0f or 2.0f based on that armor flag in the AddItemToInventory(), RemoveItemFromInventory(), and ValidateLoadout() functions. So yeah. Instead of being a simple value we can easily modify, utility items seem to be assigned based off of an if statement in a class that we cannot override. There something I'm missing here? Is there actually a way to modify this number that the game won't immediately switch back over?
  5. Is there a way to implement custom behavior in the presence of other mods? And can you override a class from another mod if it's present? One of my mods bugs out a bit during Squad Selection if the Long War Leadership Pack is installed. I know what the issue is and I'd like to simply override the functions in their class that's causing the issue and replace it with a bit of code that would allow both mods to work in tandem, but I'm not entirely sure how to actually do this.
  6. 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?
  7. Thanks! Also, you're on top of everything on this forum, and that's awesome. Just wanted to let you know it's appreciated.
  8. 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.
  9. Wait, is that a thing? I was under the impression that we're more or less out of luck in this instance if we can't get any of UIScreenListener's events to trigger.
  10. Well crap... What about using a UIScreenListener to just watch UISquadSelect_ListItem without modifying it? Or do I absolutely have to override OnClickedDismissButton() to run things when it's called?
  11. I'm using a UIScreenListener to draw additional data to the Squad Select screen from 'UISquadSelect.uc' and I can't seem to find an event that takes place whenever a unit is removed from the squad that I can hook into. OnInit(), OnReceiveFocus(), & OnLoseFocus() all serve most of my needs, but when a unit is removed from the current squad the additional data I drew to the screen lingers since I cannot call the event that checks for and wipes the unneeded visuals until the screen loses focus again. I couldn't find a function in 'UISquadSelect.uc' to really hook into when I looked through it. Anyone know what event I'm missing?
  12. How..... How did I miss that? I'll just crawl back into my corner....
  13. Obviously the class is there to return data about how much in-game time has passed and whatnot, but it uses some kind of object or type named TDateTime that I can't find the definition for. So yeah. What exactly is TDateTime supposed to be? How does calculating time in XCOM 2 actually work? I'm also a bit fuzzy on what the precise differences in the time variables used in Firaxis's code are (.m_iYear is pretty straightforward, but .m_fTime is vague), although I'm pretty sure I can suss it if I had access to wherever the definition was. Sorry in advance if this turns out to be a dumb question.
  14. Huh, hadn't thought of that. Should be a better approach. Time to figure out how to reference the time, I suppose.
  15. As the title suggests, I need to run a small bit of code once at the top of every hour while scans are taking place in the Geoscape and I'm looking for help on how to actually approach this. I don't need to actually modify anything in the Geoscape or hook into any events taking place on it. I just need to be able to run an unrelated function on a consistent in-game timescale. Thus far I've been unable to find a built-in hook for this and can't seem to figure out if UIScreenListener can handle this. Any help is appreciated!
×
×
  • Create New...