Mod Dependencies

For technical discussions and help
Post Reply
eXecator
Posts: 3
Joined: Mon Feb 01, 2016 9:47 am

Mod Dependencies

Post by eXecator »

Hi,

this question was asked on reddit without much success.

Is there a way for mods to declare dependencies on other mods? Lets say my super-leader-mod obviously depends on the leader-mod being installed to properly work. Maybe it wont even compile without the leader-mod (is this even possible?).

How to handle this?
lyravega
Posts: 10
Joined: Thu Feb 11, 2016 8:58 pm

Re: Mod Dependencies

Post by lyravega »

I am not really sure to be honest. For general compilation and stuff, I guess you can use dependson(), but I have no idea what will happen on runtime if these dependency classes do not exist at all. On Steam Workshop and Nexus, you can set up dependencies though. Nexus just prompts the user to download those as well, never seen or used the one for Steam though - maybe it enforces you to subscribe to that mod as well. If this is the case, I don't think you'll have any problems on Steam.

Aside from that, for manual detection and stuff, I guess I'd try something like this: I'd make a UIListener for the screen class UIScreen_Shell (or UIScreen_ShellFinal for the normal game I think). Via this listener's OnInıt() function, I'd check if a change of another mod has been made.

Leader Pack adds a new upgrade template for example. I believe these new additions are already added to the game by the time you get to see the Shell menus, but I never checked it out. Assuming that they are added before the shell menu, you can set up a strategy template manager, try to retrieve this new upgrade, and if not found, display an error, and set a variable to false. You can stop there and display an error, or take it further by using that false variable. This false will prevent other classes from making their changes, which may result in weird stuff as the base mod is not there.

Of course, this is brainstorming at this point. If UnrealScript supported some of the Lua features, it'd be a lot easier, but it does not :P Just writing these here as a general idea anyway.
Post Reply