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 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 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 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 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 Share on other sites More sharing options...
Fidooop Posted May 3, 2014 Author Share Posted May 3, 2014 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? Link to comment 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 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 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 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 Share on other sites More sharing options...
Recommended Posts
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.