Optional dependancies

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

wmcdannell
Posts: 15
Joined: Thu, 23. Mar 23, 21:23
x4

Optional dependancies

Post by wmcdannell »

If I set an optional dependency in my mod, will that cause my mod to be loaded after the dependency if the dependency is found to be present?

I'm trying to figure out a way to add support for other mods to some of my mods but some of those mods will get loaded after mine based on what little I know about mod load order.

Thank you!
AKA Toazd on Nexus mods and Steam
sprIder
Posts: 134
Joined: Sat, 3. Jul 10, 23:23
x4

Re: Optional dependancies

Post by sprIder »

wmcdannell wrote: Mon, 24. Apr 23, 17:42 If I set an optional dependency in my mod, will that cause my mod to be loaded after the dependency if the dependency is found to be present?
That is correct.
wmcdannell
Posts: 15
Joined: Thu, 23. Mar 23, 21:23
x4

Re: Optional dependancies

Post by wmcdannell »

sprIder wrote: Mon, 24. Apr 23, 18:04
wmcdannell wrote: Mon, 24. Apr 23, 17:42 If I set an optional dependency in my mod, will that cause my mod to be loaded after the dependency if the dependency is found to be present?
That is correct.
Excellent. That is exactly what I want. Thank you!
AKA Toazd on Nexus mods and Steam
Realspace
Posts: 1637
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Optional dependancies

Post by Realspace »

There is also the 'optional' tag. If I understand correctly, setting to false is needed in case a mod requires another otherwise can't be used. For instance I set my xrsge dependant and optional 'false' from my other stars mod because the latter contains all the new materials used by it. But if you just wish to make a mod load after another that changes the same stuff, but they don't share resources, than optional can be set on 'true'.
wmcdannell
Posts: 15
Joined: Thu, 23. Mar 23, 21:23
x4

Re: Optional dependancies

Post by wmcdannell »

Realspace wrote: Tue, 25. Apr 23, 14:52 There is also the 'optional' tag. If I understand correctly, setting to false is needed in case a mod requires another otherwise can't be used. For instance I set my xrsge dependant and optional 'false' from my other stars mod because the latter contains all the new materials used by it. But if you just wish to make a mod load after another that changes the same stuff, but they don't share resources, than optional can be set on 'true'.
Thank you! That's what we're discussing, I think.

Here's an example from one of my mods content.xml that modifies another mod and the DLC if they are present (and if any or all of them are found I want to ensure that my mod loads after them):

Code: Select all

 
 <dependency id="ego_dlc_boron" optional="true" name="Kingdom End"/>
 <dependency id="ego_dlc_pirate" optional="true" name="Tides of Avarice"/>
 <dependency id="ego_dlc_split" optional="true" name="Split Vendetta"/>
 <dependency id="ego_dlc_terran" optional="true" name="Cradle of Humanity"/>
 <dependency id="recycleshipsandstations" optional="true" name="RecycleShipsAndStations"/>
 
AKA Toazd on Nexus mods and Steam
Realspace
Posts: 1637
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Optional dependancies

Post by Realspace »

I'd set the dependency from dlc as optional="false" because their resources are needed. But I suppose it won't make any difference. I tried making a dlc dependent from my mod (because it is an overhaul) but this option is not allowed by the engine. So I suppose that the dlcs are always loaded first. They can have dependency from each other thou, as the boron dlc does.

Return to “X4: Foundations - Scripts and Modding”