Jump to content

Recommended Posts

[00:00:46]: [string "../mods/workshop-381565292/scripts/prefabs/..."]:42: variable 'GLOBAL' is not declared
LUA 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
 

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
  • Big Ups 1

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

  • Big Ups 1

@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

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