MidrealmDM Posted December 13, 2015 Share Posted December 13, 2015 [00:00:46]: [string "../mods/workshop-381565292/scripts/prefabs/..."]:42: variable 'GLOBAL' is not declaredLUA ERROR stack traceback: =[C]:-1 in (global) error © <-1--1> =-=-=-I've made several changes and still can't get it to work. if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) or GLOBAL.TheSim:GetGameID()=="DST" then inst.components.edible.temperaturedelta = TUNING.COLD_FOOD_BONUS_TEMP else end Link to comment Share on other sites More sharing options...
DarkXero Posted December 13, 2015 Share Posted December 13, 2015 If you are outside modmain, GLOBAL means nothing.You are already in the global environment.if IsDLCEnabled(REIGN_OF_GIANTS) or TheSim:GetGameID()=="DST" then inst.components.edible.temperaturedelta = TUNING.COLD_FOOD_BONUS_TEMPelseend 1 Link to comment Share on other sites More sharing options...
Kzisor Posted December 13, 2015 Share Posted December 13, 2015 @DarkXero, I want to expand and clarify this statement. If your code resides in the scripts folder or a sub folder of the scripts folder you're inside the global environment already, however, all other files will reside outside the global environment. This distinction is needed because certain mods use modimport and all files which use modimport resides outside the global environment. 1 Link to comment Share on other sites More sharing options...
MidrealmDM Posted December 13, 2015 Author Share Posted December 13, 2015 @DarkXero, I want to expand and clarify this statement. If your code resides in the scripts folder or a sub folder of the scripts folder you're inside the global environment already, however, all other files will reside outside the global environment. This distinction is needed because certain mods use modimport and all files which use modimport resides outside the global environment. Ahh - ok, that makes sense.And it worked ! Thanks Link to comment 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