LeaderEnemyBoss Posted April 13, 2016 Share Posted April 13, 2016 Hey everyone, I am planning an update for my existing enemy mod, that adds a corpse item, an autopsy an a new item. After a long struggle I got everything working smoothly. However when i want to test this mod in my ongoing campaign, the autopsy and the corpse dont show up. I am pretty sure that i have to tinker with X2DownloadableContentInfo and the OnLoadedSavedGame() function, but so far the only thing i managed to do is to get the new item to show up and being buildable without the autopsy being there (basically copy pasted the code of the draco mod). The mod seems to work fine in campaigns that didnt have the mod before, but since my savegame already had the old version of the mod (without corpse, tech and item) the new stuff doesnt show up correctly. Is there any definitive solution to this problem? Thanks in advance. Link to comment Share on other sites More sharing options...
Deleted32045420User Posted April 13, 2016 Share Posted April 13, 2016 you probably want to set up a UIListener for a specific screen and add it to the templates there, because the OnLoadedSavedGame() only activates on saves that didnt have the mod prior to that moment Link to comment Share on other sites More sharing options...
LeaderEnemyBoss Posted April 13, 2016 Author Share Posted April 13, 2016 Good idea!Got it working now with an AvengerHudListener. Oddly enough the corpse item is working now without any further modifications, in my first try it didnt work. Seems like the best way to add techs to existing mods are screenlisteners. Link to comment Share on other sites More sharing options...
zingfharn Posted April 13, 2016 Share Posted April 13, 2016 Yep! But make sure you check the tech is there before you add it ; ) I ended up with a very broken game when I forgot to do that. Items will just get loaded in fine, because they depend on techs, so need to refresh each time (or something ; ) Link to comment Share on other sites More sharing options...
LeaderEnemyBoss Posted April 13, 2016 Author Share Posted April 13, 2016 Yeah. As I said i mainly copy pasted from the draco mod, that already includes a check if the tech is already part of the game. Works perfectly, logs show it correctly determines, whether it needs to add to tech or not. Link to comment Share on other sites More sharing options...
Recommended Posts