Jump to content

Recommended Posts

I know that we can set the compatibility in modinfo.lua but I am just curious how to actually make a mod compatible with the dlc regarding the logic.

For example, I would like to change the tuning value TUNING.WOODLEGSBOAT_SPEED. This tuning value does not exist in the don't starve vanilla tuning file which is located at data/scripts/tuning.lua. Instead, it exists in the tuning file of the shipwrecked dlc which is located at  data/DLC00002/scripts/tuning.lua.

In my modinfo.lua, I set shipwrecked compatibility to true and in my modmain.lua. should I just have the line 

TUNING.WOODLEGSBOAT_SPEED = some number

or 

if (shipwrecked_compatible = true, some condition to check for shipwrecked world idk) then
  TUNING.WOODLEGSBOAT_SPEED = some number
end

Thanks

In this case, you can just leave the variable for all versions.

I grabbed this from the game code. I believe it is the best way to check for each kind of DLC. I think there's some difference between how to check for RoG compared to SW and Hamlet, and I don't know why.

if SaveGameIndex:IsModePorkland() then
	-- Do Hamlet code
elseif SaveGameIndex:IsModeShipwrecked() then
	-- Do SW code
elseif IsDLCInstalled(REIGN_OF_GIANTS) then
	-- Do RoG code
else
	-- Do original DS code
end

You can translate those if-statements to bool-variables if you prefer.

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...