user019 Posted May 5, 2020 Share Posted May 5, 2020 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 Link to comment https://forums.kleientertainment.com/forums/topic/118013-mod-question-how-to-make-a-mod-actually-compatible-with-the-dlc/ Share on other sites More sharing options...
Ultroman Posted May 6, 2020 Share Posted May 6, 2020 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. Link to comment https://forums.kleientertainment.com/forums/topic/118013-mod-question-how-to-make-a-mod-actually-compatible-with-the-dlc/#findComment-1331333 Share on other sites More sharing options...
user019 Posted May 6, 2020 Author Share Posted May 6, 2020 thanks Link to comment https://forums.kleientertainment.com/forums/topic/118013-mod-question-how-to-make-a-mod-actually-compatible-with-the-dlc/#findComment-1331362 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now