Jump to content

Recommended Posts

Here's what I'm using to detect if the DLC is enabled (IsDLCEnabled and the REIGN_OF_GIANTS constant are defined in dlcsupport.lua):

 

local is_rog_enabled = IsDLCEnabled ~= nil and IsDLCEnabled(REIGN_OF_GIANTS)
So, you won't need to make 2 different versions of the mod, but instead use different logic based on whether or not the DLC is enabled. It'll definitely make mods more complicated to support, especially after there have been a few DLCs.

Here's an example of what I do in my Trick-or-Treat mod to support both RoG's 4 seasons and the standard 2 seasons:

local hasfourseasons = IsDLCEnabled ~= nil and IsDLCEnabled(REIGN_OF_GIANTS)if (hasfourseasons and seasonmanager:IsAutumn()) or (not hasfourseasons and seasonmanager:IsSummer()) then  -- do stuffend
Edited by squeek
  • Developer

We're hoping to add a way for modders to specify in the modinfo file if it's a main-game-only mod or a DLC-only mod or a mod that works with both! Even once we do add that flag, you'll quite possibly need to do some special casing using a IsDLCEnabled(REIGN_OF_GIANTS) call, as @squeek mentioned.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...