iWitch Posted April 7, 2014 Share Posted April 7, 2014 (edited) trying to detect RoG in modmain.lua :if GLOBAL.IsDLCEnabled and GLOBAL.IsDLCEnabled(1) then-- something to do print ("RoG support enabled")else print ("RoG support disabled")end but when i creating new game with RoG enabled or without its always return "true", i.e. prints "support enabled" i am missed something or what the way to detect RoG? Edited April 7, 2014 by iWitch Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/ Share on other sites More sharing options...
DevilXD Posted April 7, 2014 Share Posted April 7, 2014 It should be:od GLOBAL.IsDlcEnabled(GLOBAL.REGIN_OF_GIANTS) then... Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446712 Share on other sites More sharing options...
iWitch Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) GLOBAL.REGIN_OF_GIANTS is 1, its dont make any changes so far i found problem - when you creating new world with disabled RoG, IsDLCEnabled shows truebut if you exit and load it again it will be false and there other (but not good at all) way to detect enabled/disabled RoG :if GLOBAL.SEASONS.AUTUMN then Edited April 7, 2014 by iWitch Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446719 Share on other sites More sharing options...
debugman18 Posted April 7, 2014 Share Posted April 7, 2014 GLOBAL.REGIN_OF_GIANTS is 1, its dont make any changes so far i found problem - when you creating new world with disabled RoG, IsDLCEnabled shows truebut if you exit and load it again it will be false and there other (but not good at all) way to detect enabled/disabled RoG :if GLOBAL.SEASONS.AUTUMN then This is what we're using for U&A.local is_rog_enabled = VarExists("IsDLCEnabled") and VarExists("REIGN_OF_GIANTS") and IsDLCEnabled(REIGN_OF_GIANTS) Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446728 Share on other sites More sharing options...
iWitch Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) isnt its similar toGLOBAL.IsDLCEnabled and GLOBAL.IsDLCEnabled(1)if IsDLCEnabled not exists then function doesnt calls, anyway if in some magic way it will be called (while not exists) - it crash game. Anyway there no problem with IsDLCEnabled, problem is that TheSim:IsDLCEnabled() returns true right after world creation when RoG disabled... Edited April 7, 2014 by iWitch Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446732 Share on other sites More sharing options...
debugman18 Posted April 7, 2014 Share Posted April 7, 2014 isnt its similar toGLOBAL.IsDLCEnabled and GLOBAL.IsDLCEnabled(1)if IsDLCEnabled not exists then function doesnt calls, anyway if in some magic way it will be called (while not exists) - it crash game.As far as I know, it does work. I'd be surprised if it didn't. It makes sure that IsDLCEnabled exists, then it makes sure that RoG exists, then it checks to see if RoG is enabled. Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446735 Share on other sites More sharing options...
iWitch Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) As far as I know, it does work. I'd be surprised if it didn't. It makes sure that IsDLCEnabled exists, then it makes sure that RoG exists, then it checks to see if RoG is enabled.i understand what this code means and btw if you want to be bit more paranoid you have to check data types also IsDLCEnabled must be a function, REIGN_OF_GIANTS - number. anyway try to make new game with RoG disabled and use some assets from iti guess game can crash after world creation... since your is_rog_enabled will be "true", thats what i am talking about... Edited April 7, 2014 by iWitch Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446740 Share on other sites More sharing options...
debugman18 Posted April 7, 2014 Share Posted April 7, 2014 (edited) i understand what this code means and btw if you want to be bit more paranoid you have to check data types also IsDLCEnabled must be a function, REIGN_OF_GIANTS - number. anyway try to make new game with RoG disabled and use some assets from iti guess game can crash after world creation... since your is_rog_enabled will be "true", thats what i am talking about...That's odd, I haven't had that happen. I use it for magic beans, among other things. If RoG is enabled, I use the buryable component (which only exists within RoG) and if it is disabled, I use the trader and tradable components. Could you share your log? Edit: Hmm, I may have to check into this further tomorrow. Maybe I can recreate the crash. Although checking for autumn is a pretty clean way to do it, as well. Couldn't you also just do a check for a DLC only file? Edited April 7, 2014 by debugman18 Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446746 Share on other sites More sharing options...
DeathDisciple Posted April 7, 2014 Share Posted April 7, 2014 It seems to be working proper for me too - right after world creation in modmain... are you checking in modmain or worldgen before the creation itself takes place or? Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446751 Share on other sites More sharing options...
iWitch Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) damn i just tested on Wilson and no problems, but with custom character its works like i wrote ... modmain.lua if GLOBAL.IsDLCEnabled and GLOBAL.IsDLCEnabled(1) then print ("TEST : RoG support enabled")else print ("TEST : RoG support disabled")endif GLOBAL.SEASONS.AUTUMN then print ("TEST : Season support enabled")else print ("TEST : Season support disabled")end with Wilson its shows disabled with custom character shows enabled :/ Edited April 7, 2014 by iWitch Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446752 Share on other sites More sharing options...
iWitch Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) Well nwm guys, problem isnt global, its something to do with my mod.But atm i dont understand why its works like this i deleted log.txt, then run game and create new world with disabled RoGhere a log Edited April 7, 2014 by iWitch Link to comment https://forums.kleientertainment.com/forums/topic/34380-isdlcenabled/#findComment-446755 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