Fidooop Posted May 2, 2014 Share Posted May 2, 2014 like it says, I MUST know this code!(debugman gave me some code for it but I couldn't figure out how to use it correctly) I need the ability to change absolutely anything in the mod at all how the hat gives sanity, what powers that sword has, and even add a prefab that is only available to you if you enable RoG I need to learn how to take full control of this! so please tell me how to check for DLC RoG thanks Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/ Share on other sites More sharing options...
Fidooop Posted May 3, 2014 Author Share Posted May 3, 2014 anyone? I really need this Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-469181 Share on other sites More sharing options...
debugman18 Posted May 3, 2014 Share Posted May 3, 2014 anyone? I really need this GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-469189 Share on other sites More sharing options...
squeek Posted May 3, 2014 Share Posted May 3, 2014 For inside modmain.lua:GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS)For outside modmain.lua:IsDLCEnabled(REIGN_OF_GIANTS) Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-469201 Share on other sites More sharing options...
Fidooop Posted May 3, 2014 Author Share Posted May 3, 2014 thankyou I'll test it out right away! Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-469205 Share on other sites More sharing options...
Fidooop Posted May 3, 2014 Author Share Posted May 3, 2014 (edited) GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) For inside modmain.lua:For outside modmain.lua:IsDLCEnabled(REIGN_OF_GIANTS)ok to test this I did this in the modmain: if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then AddPrefabPostInit("nightmarehelmet", function(inst)inst:AddTag("dlc_on")end) elseif not GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then AddPrefabPostInit("nightmarehelmet", function(inst)inst:AddTag("dlc_off")end)end and this in the nightmarehelmet: if (inst:HasTag("dlc_on")) then inst.AnimState:SetBank("hat_football")inst.AnimState:SetBuild("hat_football") elseif (inst:HasTag("dlc_off")) then inst.AnimState:SetBank("hat_feather")inst.AnimState:SetBank("hat_feather")end just to see if it is different in a nondlc world (it stayed a football helmet in both RoG and vanilla worlds)so I am obviously using it incorrectly or something... any ideas? Edited May 3, 2014 by Fidooop Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-469790 Share on other sites More sharing options...
squeek Posted May 3, 2014 Share Posted May 3, 2014 Well, for one, you don't need those tags at all. In nightmarehelmet, just do:if IsDLCEnabled(REIGN_OF_GIANTS) then inst.AnimState:SetBank("hat_football") inst.AnimState:SetBuild("hat_football")else inst.AnimState:SetBank("hat_feather") inst.AnimState:SetBank("hat_feather")endAdd print statements like so if you want to make sure it's doing what you expect it to:if IsDLCEnabled(REIGN_OF_GIANTS) then print("setting nightmarehelmet to hat_football") inst.AnimState:SetBank("hat_football") inst.AnimState:SetBuild("hat_football")else print("setting nightmarehelmet to hat_feather") inst.AnimState:SetBank("hat_feather") inst.AnimState:SetBank("hat_feather")endand then look in the console log after spawning one to see what it says (CTRL+L or ~). Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-469868 Share on other sites More sharing options...
Rincevvind Posted May 4, 2014 Share Posted May 4, 2014 Fidooop, imho whole point of this DLC detection is to use DLC assets/features or not. but if you don't use them, so why you need such detection? hat_football and hat_feather is available in original game. Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-470060 Share on other sites More sharing options...
simplex Posted May 4, 2014 Share Posted May 4, 2014 ok to test this I did this in the modmain: if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then AddPrefabPostInit("nightmarehelmet", function(inst) inst:AddTag("dlc_on") end) elseif not GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then AddPrefabPostInit("nightmarehelmet", function(inst) inst:AddTag("dlc_off") end) end and this in the nightmarehelmet: if (inst:HasTag("dlc_on")) then inst.AnimState:SetBank("hat_football") inst.AnimState:SetBuild("hat_football") elseif (inst:HasTag("dlc_off")) then inst.AnimState:SetBank("hat_feather") inst.AnimState:SetBank("hat_feather") end just to see if it is different in a nondlc world (it stayed a football helmet in both RoG and vanilla worlds) so I am obviously using it incorrectly or something... any ideas? A prefab post init is a prefab post init. It runs after the prefab's "fn". But I don't see the point in these tags, just do the IsDLCEnabled test in the prefab's fn itself. Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-470064 Share on other sites More sharing options...
Fidooop Posted May 4, 2014 Author Share Posted May 4, 2014 Fidooop, imho whole point of this DLC detection is to use DLC assets/features or not. but if you don't use them, so why you need such detection? hat_football and hat_feather is available in original game.This was just to test it! I really needed this so that I can get a hat to work in and out of DLC(since their sanity giving/taking codes are different between vanilla and RoG) Link to comment https://forums.kleientertainment.com/forums/topic/35835-how-to-make-a-mod-change-depending-on-whether-dlc-is-enabled-or-not/#findComment-470067 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