Jump to content

PSA: did your mod suddenly stop working?


davidlallen

Recommended Posts

At least one other modder besides myself has had this problem. When switching between multiple mods under development, suddenly one mod which used to work, stops working and it doesn't take any effect in the game.

 

If this happens to you, try this. In your modded XcomEngine.ini you probably have some ModClassOverride lines. Open your local XcomEngine.ini file, under My Games\XCOM2\XComGame\Config. At the end of the engine.engine section, which is long, check for unwanted ModClassOverride lines. It seems when writing this local file, sometimes the game keeps leftover lines. For me, I had two different mods overriding the same class, and I found the *wrong one* in this local file. I deleted the unwanted ModClassOverride lines, restarted the mod, and it magically worked again. This has happened more than one time.

 

Link to comment
Share on other sites

I had the same issue. A mod override worked on Saturday, didn't work on Monday. I tried your advice but it didn't help in my case - the Override still doesn't work, though my issue may be different. I do have a question. I have a line which says "TemplateOverridesPackageNames=TemplateOverrides". What does that mean and should it be there?

 

Also for the record - what can I override and what can I not? I've seen a few references to not overriding static functions but I was able to do that just fine in one class, but not another.

Link to comment
Share on other sites

well i try as much as i can to not use class overrides, even went ahead and overwritten the medikit template on each game to get a trigger event for my red fog mod instead of making a class override- it's so unreliable and so easily broken i just took it upon myself to never use them if i can, it also improves compatibility with other mods

Edited by Guest
Link to comment
Share on other sites

Here's the funny thing. I have this in my XcomEngine.ini:

ModClassOverrides=(BaseGameClass="X2Item_DefaultWeapons", ModClass="X2Item_DefaultWeapons_BE")
ModClassOverrides=(BaseGameClass="X2Ability_RangerAbilitySet", ModClass="X2Ability_RangerAbilitySet_BE")

The first one fails, the second one works. Why? In both cases I'm overriding Static functions, but in one case it works while in the other it doesn't.

 

*edit*

Never mind. My issue is different, it turns out.

Edited by SteelRook
Link to comment
Share on other sites

@Steelrook, when you say one fails and one works, what exactly do you mean? Do you get compile errors? Or does the function you modded just not take effect? There are multiple possible reasons for that. I am not an expert but I see problems when obscuring a static variable or when extending vs replacing the class.

 

@Eladdv202, if you do not use class overrides, what is the mechanism you use? I am a little hesitant to put in something that triggers on each frame.

Link to comment
Share on other sites

There's definitely more to this issue than simply junk left over in ini files. I've had overrides just stop working for me even after completely clearing out ini files and working from scratch. The mechanism is either faulty or has undocumented quirks.

@Eladdv202, if you do not use class overrides, what is the mechanism you use? I am a little hesitant to put in something that triggers on each frame.

UIScreenListeners : http://forums.nexusmods.com/index.php?/topic/3775625-discussion-about-how-do-i-change-xxx-in-the-game/&do=findComment&comment=34306880

Link to comment
Share on other sites

I'm not too concerned about the performance of UIScreenListeners - They don't fire all that often (a few times per Screen-change, depending on which events you respond to) and the code that handles dispatching of events to UIScreenListeners appears to be native, so it's going to be fast anyway. Unless you're doing something crazy in the OnInit event with ScreenClass set to 'none' I don't think it's likely to be a problem.

That said, I'd advise trying to avoid using UIScreenListeners with ScreenClass = none wherever possible though. When you can, you should specify a specific screen to listen to.

Edited by Kvalyr
Link to comment
Share on other sites

Slightly off-topic, but can anyone confirm or deny the screen listeners stop working when another mod overrides the ui class? I am getting a random small smattering of comments on the workshop about mods not working, and all of mine are ui listener based, typically for the tactical HUD. If someone out there overrides it and breaks all listener mods, that's pretty crappy and the only workaround I can see is to set the screen to none and test it in my code, which would be both unfortunate and slow.

 

OTOH this could all just be the usual low signal-to-noise ratio on the workshop. Installed your mod and my dog got hit by a car. Downvoted. WHY DO YOU HATE DOGS?

Link to comment
Share on other sites

Slightly off-topic, but can anyone confirm or deny the screen listeners stop working when another mod overrides the ui class?

I really hope not - Or else mod compatibility is really going to turn into an absolute shitshow. If my overrides would reliably work, I'd test it. :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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