Mythrell Posted August 5, 2016 Share Posted August 5, 2016 Hey all, just a quick question, is there a way to override another mods class to fix some mod compatibility issues? I suppose you need to copy it's source code to your project to be able to compile against it, so you would need a permission at least. Other thing which comes to mind is that you might be able to compile using the other mods compiled package as a some kind of library, but I don't know if there's a way to do that either. So yeah, if anyone has a clue about this, let me know. :) Link to comment Share on other sites More sharing options...
robojumper Posted August 11, 2016 Share Posted August 11, 2016 You can place the source code of the mod into SrcOrig, and add [UnrealEd.EditorEngine] +EditPackages=Mod_To_Compile_Against to your XComEngine.ini. After that, you can simply reference their code in your mod. The compiled mod will neither have the source code nor the compiled package of Mod_To_Compile_Against included, so it will crash when reaching any code referenced unless the user has the Mod_To_Compile_Against installed. You can, however, just check before you execute any critcal code: function DoStuff() { // Do things //... // now hande mod specific workaround if (ModInstalled('SpecificMod')) { // Compatibility hack // if mod isn't installed, this section won't be reached // and can't crash the game } } function bool ModInstalled(name ModName) { local XComOnlineEventMgr EventManager; local int i; EventManager = `ONLINEEVENTMGR; for(i = EventManager.GetNumDLC() - 1; i >= 0; i--) { if(EventManager.GetDLCNames(i) == ModName) { return true; } } return false; } Link to comment Share on other sites More sharing options...
Mythrell Posted August 13, 2016 Author Share Posted August 13, 2016 Ah, perfect, thanks. I was missing that ini option, I did try to copy that source before. Link to comment Share on other sites More sharing options...
Recommended Posts