DarkXero Posted August 12, 2015 Share Posted August 12, 2015 @EulenMarie:local function IcySanity(inst) if not GLOBAL.TheWorld.ismastersim then return end if inst.prefab == "iceking" then inst:AddComponent("sanityaura") local function LadyDrainer(inst, observer) local obs_gender = GLOBAL.GetGenderStrings(observer.prefab) if obs_gender == "FEMALE" then return -GLOBAL.TUNING.SANITYAURA_HUGE end return 0 end inst.components.sanityaura.aurafn = LadyDrainer else local inst_gender = GLOBAL.GetGenderStrings(inst.prefab) if inst_gender == "FEMALE" then if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old_aura = inst.components.sanityaura.aurafn local NewAura if old_aura then NewAura = function(inst, observer) local ret = old_aura(inst, observer) if observer.prefab == "iceking" then return ret + GLOBAL.TUNING.SANITYAURA_MED end return ret end else NewAura = function(inst, observer) if observer.prefab == "iceking" then return GLOBAL.TUNING.SANITYAURA_MED end end end inst.components.sanityaura.aurafn = NewAura end endendlocal function BeakyLove(inst) if not GLOBAL.TheWorld.ismastersim then return end if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old_aura = inst.components.sanityaura.aurafn local NewAura if old_aura then NewAura = function(inst, observer) local ret = old_aura(inst, observer) if observer.prefab == "iceking" then return ret + GLOBAL.TUNING.SANITYAURA_SMALL_TINY end return ret end else NewAura = function(inst, observer) if observer.prefab == "iceking" then return GLOBAL.TUNING.SANITYAURA_SMALL_TINY end end end inst.components.sanityaura.aurafn = NewAuraendAddPlayerPostInit(IcySanity)AddPrefabPostInit("penguin", BeakyLove) 1 Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 12, 2015 Author Share Posted August 12, 2015 @EulenMarie:local function IcySanity(inst) if not GLOBAL.TheWorld.ismastersim then return end if inst.prefab == "iceking" then inst:AddComponent("sanityaura") local function LadyDrainer(inst, observer) local obs_gender = GLOBAL.GetGenderStrings(observer.prefab) if obs_gender == "FEMALE" then return -GLOBAL.TUNING.SANITYAURA_HUGE end return 0 end inst.components.sanityaura.aurafn = LadyDrainer else local inst_gender = GLOBAL.GetGenderStrings(inst.prefab) if inst_gender == "FEMALE" then if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old_aura = inst.components.sanityaura.aurafn local NewAura if old_aura then NewAura = function(inst, observer) local ret = old_aura(inst, observer) if observer.prefab == "iceking" then return ret + GLOBAL.TUNING.SANITYAURA_MED end return ret end else NewAura = function(inst, observer) if observer.prefab == "iceking" then return GLOBAL.TUNING.SANITYAURA_MED end end end inst.components.sanityaura.aurafn = NewAura end endendlocal function BeakyLove(inst) if not GLOBAL.TheWorld.ismastersim then return end if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old_aura = inst.components.sanityaura.aurafn local NewAura if old_aura then NewAura = function(inst, observer) local ret = old_aura(inst, observer) if observer.prefab == "iceking" then return ret + GLOBAL.TUNING.SANITYAURA_SMALL_TINY end return ret end else NewAura = function(inst, observer) if observer.prefab == "iceking" then return GLOBAL.TUNING.SANITYAURA_SMALL_TINY end end end inst.components.sanityaura.aurafn = NewAuraendAddPlayerPostInit(IcySanity)AddPrefabPostInit("penguin", BeakyLove) Wooow thank you!!! Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 12, 2015 Author Share Posted August 12, 2015 (edited) Something went wrong. Did I add it in the wrong line? Oh, and how I change the lua that he drain sanity at day?And how to change it that he can't use the ice fingers without wearing the crown? sorry for so much questions.iceking.lua Edited August 12, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
DarkXero Posted August 12, 2015 Share Posted August 12, 2015 @EulenMarie:What I posted goes all in modmain.lua. Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 13, 2015 Author Share Posted August 13, 2015 @EulenMarie:What I posted goes all in modmain.lua. Oh.. ^^ I'll try Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 13, 2015 Author Share Posted August 13, 2015 @EulenMarie:What I posted goes all in modmain.lua. I 've been thinking about the character .it makes more sense when the crown gains live and drain sanity.and that he gets health near females and females lose sanity.would you help me? Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 13, 2015 Author Share Posted August 13, 2015 Hey again,now I'll try to change the crown, drain sanity, gain health.It works, but when I put the crown on the ground comes this error message: icecrown.lua Link to comment Share on other sites More sharing options...
DarkXero Posted August 13, 2015 Share Posted August 13, 2015 @EulenMarie, the crown crashes because the task keeps running when you unequip it and drop it. inst.components.inventoryitem is never nil, and owner is nil when it's on the ground.And you tried to index the components to a nil value, thus crash.icecrown.lua Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 14, 2015 Author Share Posted August 14, 2015 @EulenMarie, the crown crashes because the task keeps running when you unequip it and drop it. inst.components.inventoryitem is never nil, and owner is nil when it's on the ground.And you tried to index the components to a nil value, thus crash. nice to know, thx a lot! but now it doesn't work. no sanity drain and gain health. Link to comment Share on other sites More sharing options...
DarkXero Posted August 14, 2015 Share Posted August 14, 2015 @EulenMarie, ah, yes, replaceinst.healTask = inst:DoPeriodicTask(5, healingArmor)forinst.healTask = inst:DoPeriodicTask(5, healingArmor, owner) Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 14, 2015 Author Share Posted August 14, 2015 @EulenMarie, ah, yes, replaceinst.healTask = inst:DoPeriodicTask(5, healingArmor)forinst.healTask = inst:DoPeriodicTask(5, healingArmor, owner) @DarkXero Oh... Link to comment Share on other sites More sharing options...
DarkXero Posted August 14, 2015 Share Posted August 14, 2015 @EulenMarie, I'm just stupid.icecrown.lua Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 14, 2015 Author Share Posted August 14, 2015 @EulenMarie, I'm just stupid. Youre not youre r great! Thanx Can you change the IcySanity that he gain health near females? Link to comment Share on other sites More sharing options...
DarkXero Posted August 14, 2015 Share Posted August 14, 2015 Can you change the IcySanity that he gain health near females? He gets both health and sanity or only health? Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 14, 2015 Author Share Posted August 14, 2015 (edited) He gets both health and sanity or only health? sanity and heatlh near females but females only lose sanity. sanity near pengulls. that is it I think Edited August 14, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
DarkXero Posted August 14, 2015 Share Posted August 14, 2015 @EulenMarie, local inst_gender = GLOBAL.GetGenderStrings(inst.prefab) if inst_gender == "FEMALE" then if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old_aura = inst.components.sanityaura.aurafn local NewAura if old_aura then NewAura = function(inst, observer) local ret = old_aura(inst, observer) if observer.prefab == "iceking" then observer.components.health:DoDelta(0.5, true, "Love") -- Here return ret + GLOBAL.TUNING.SANITYAURA_MED end return ret end else NewAura = function(inst, observer) if observer.prefab == "iceking" then observer.components.health:DoDelta(0.5, true, "Love") -- And here return GLOBAL.TUNING.SANITYAURA_MED end end end inst.components.sanityaura.aurafn = NewAura end Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 14, 2015 Author Share Posted August 14, 2015 (edited) @EulenMarie, local inst_gender = GLOBAL.GetGenderStrings(inst.prefab) if inst_gender == "FEMALE" then if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old_aura = inst.components.sanityaura.aurafn local NewAura if old_aura then NewAura = function(inst, observer) local ret = old_aura(inst, observer) if observer.prefab == "iceking" then observer.components.health:DoDelta(0.5, true, "Love") -- Here return ret + GLOBAL.TUNING.SANITYAURA_MED end return ret end else NewAura = function(inst, observer) if observer.prefab == "iceking" then observer.components.health:DoDelta(0.5, true, "Love") -- And here return GLOBAL.TUNING.SANITYAURA_MED end end end inst.components.sanityaura.aurafn = NewAura end @DarkXero,Sorry, in which line? Replace?modmain.lua Edited August 14, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
DarkXero Posted August 14, 2015 Share Posted August 14, 2015 @EulenMarie:modmain.lua Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 15, 2015 Author Share Posted August 15, 2015 (edited) @EulenMarie: @DarkXero Nice! Thank you!Which line I must change that he gain slower/faster health/sanity? ^^I've tried something but I don't figure it out. Edited August 15, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 15, 2015 Author Share Posted August 15, 2015 Another idea is, that the crown is only for ice king unbreakable.Use other peoples the crown, they will break fast. (prevents the crowns lying around) Link to comment Share on other sites More sharing options...
DarkXero Posted August 15, 2015 Share Posted August 15, 2015 @EulenMarie: Replace inst:AddComponent("armor") inst.components.armor:InitCondition(10000000000, 0.5)for inst:AddComponent("armor") inst.components.armor:InitCondition(20, 0.5) local old_TakeDamage = inst.components.armor.TakeDamage inst.components.armor.TakeDamage = function(self, damage_amount) local owner = self.inst.components.inventoryitem.owner if owner and owner.prefab == "iceking" then damage_amount = 0 end old_TakeDamage(self, damage_amount) end Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 15, 2015 Author Share Posted August 15, 2015 @EulenMarie: Replace inst:AddComponent("armor") inst.components.armor:InitCondition(10000000000, 0.5)for inst:AddComponent("armor") inst.components.armor:InitCondition(20, 0.5) local old_TakeDamage = inst.components.armor.TakeDamage inst.components.armor.TakeDamage = function(self, damage_amount) local owner = self.inst.components.inventoryitem.owner if owner and owner.prefab == "iceking" then damage_amount = 0 end old_TakeDamage(self, damage_amount) end Thank you, I'll try it soon Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 15, 2015 Author Share Posted August 15, 2015 @DarkXero: Did u know why my dedicated server crashes very often? We think, it is maybe the "IceSanity" it's crashed if females or pengulls near my friend (guts). log.txt Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 15, 2015 Author Share Posted August 15, 2015 (edited) @DarkXero: In not dedicated server Same Problem, I think he has enable Ice King.http://forums.kleientertainment.com/topic/57095-server-crash-game-crashes-when-seeing-corrupted-pengulls/?p=663658 Edited August 15, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
Doctor Donna Posted August 15, 2015 Author Share Posted August 15, 2015 (edited) Test with Ice King, Wilson, Pengulls (ice king enable) = crashTest with Elsa, Wilson, Pengulls (ice king disable) = no crashTest with Wigfrid, Pengulls (ice king enable) = crash it is the ice king Edited August 15, 2015 by EulenMarie 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