Jump to content

Mods crashing: variable 'CAPY_DLC' is not declared


Recommended Posts

(Sorry if I mess something up here, I never post on forums)


 


So, uh, I'm using two mods (always on status and cute survival plushes) that are currently having the same issue. I go onto my mods page, try to enable one, and then don't stave promptly crashes with different error messages depending on the mod enabled.


 


Always On Status Error



The following mod(s) have caused a failure: Always On Status


../mods/workshop-180843799/modmain.lua:186: variable 'CAPY_DLC' is not declared


LUA ERROR stack traceback:


=[C] in function 'error'


scripts/strict.lua(23,1)


../mods/workshop-180843799/modmain.lua(186,1) in main chunk


=[C] in function 'xpcall'


scripts/util.lua(439,1) in function 'RunInEnvironment'


scripts/mods.lua(208,1) in function 'InitializeModMain 



 


Cute Survival Plushes Error



The following mod(s) have caused a failure: Cute Survival Plushies


../mods/workshop-565379372/modmain.lua:35: variable 'CAPY_DLC' is not declared


LUA ERROR stack traceback:


=[C] in function 'error'


scripts/strict.lua(23,1)


../mods/workshop-565379372/modmain.lua(35,1) in function 'IsSW'


../mods/workshop-565379372/modmain.lua(42,1) in main chunk


=[C] in function 'xpcall'


scripts/util.lua(439,1) in function 'RunInEnvironment' 


 

 


After going into always on status' modmain.lua I find this:  



if GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then


AddClassPostConstruct("widgets/containerwidget", BoatBadgeFix)


end 



 


And cute survival plushies' modmain.lua shows this:



function IsSW()


if not IsDST() and is_sw == nil then --DST lacks the API variables...


is_sw = G.IsDLCEnabled(G.CAPY_DLC) and true or false


end


return is_sw


end



 


This is probably happening because I don't have shipwrecked, but if that's the case I'd like to make it so these mods don't require shipwrecked (considering the content of the mods themselves they really should work fine with DS/ROG only). I'm no modder and my knowledge of code is pretty limited, so I really have no idea what to do here. I've tried messing around with them in various ways, but no luck. I suppose I should bring this up on the mods' pages but I would like to fix this myself instead of waiting who knows how long for the mod maker to fix it. So, my question: how would someone declare this CAPY_DLC variable?


Link to comment
Share on other sites

Anyway better to check variable itself before applying it into function

if variable not defined it's pretty clear that DLC isn't here.

like this paranoid checks which i do since RoG beta

local IsDLC1 = GLOBAL.IsDLCEnabled and GLOBAL.REIGN_OF_GIANTS and GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS)
since standlone version is often not updated, better to check variable and function IsDLCEnabled at all
Link to comment
Share on other sites

After trying several times to get steam to update don't starve, I think I figured out the issue. I use a mac, and since there's no shipwrecked for mac (yet) there's no update for my version of don't starve (yet). I guess the only thing I can do here is wait patiently for the mac version of shipwrecked to be a thing that exists, which is fine by me.


Link to comment
Share on other sites

I had this issue too for Wormhole Marks under Linux (presumably the update hasn't been rolled out there yet either), found this thread when googling the error.

 

One hacky workaround is to browse to the directory of the mod causing the issue, open up the offending .lua file (probably modmain.lua) and search (ctrl+f) for CAPY_DLC. Replace anything that looks like "GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC)" with "false" (the GLOBALs may be omitted). E.g.

if GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then

should become something like (note, original line is commented out so it's easier to change back if need be):

--if GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) thenif false then

The mod should enable without failing after that. This is really for those who are playing DS on Mac/Linux and don't want to wait for the update to use offending mods. You'll likely need to remember to change it back when the game updates, use at your own risk etc.

Link to comment
Share on other sites

I had this issue too for Wormhole Marks under Linux (presumably the update hasn't been rolled out there yet either), found this thread when googling the error.

 

One hacky workaround is to browse to the directory of the mod causing the issue, open up the offending .lua file (probably modmain.lua) and search (ctrl+f) for CAPY_DLC. Replace anything that looks like "GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC)" with "false" (the GLOBALs may be omitted). E.g.

if GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then

should become something like (note, original line is commented out so it's easier to change back if need be):

--if GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) thenif false then

The mod should enable without failing after that. This is really for those who are playing DS on Mac/Linux and don't want to wait for the update to use offending mods. You'll likely need to remember to change it back when the game updates, use at your own risk etc.

 

 

I add this to "modmain.lua" first line, and work fine without change anything else.

GLOBAL.CAPY_DLC = 2
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...