rainbuni Posted June 26, 2022 Share Posted June 26, 2022 (edited) Hi all, I'm just starting out with making mods, and this is my first one, so please bear with my inexperience. I tried to create a vampire-like custom character who grows stronger at night and can transform into a monster during the full moon phrase.(still making his monster form sprites tho) I'm able to change other stats like health, sanity, and attack damage thanks to this community. However, I'm not sure why it didn't trigger the changes for the full moon phrase. I'm using if phase == "night" then if TheWorld.state.isfullmoon then << But it's not working T T. Could you please tell me what the problem could be? I would be appreciate. attached the code! here -- stat/apperance differences night/day local function updatestats(inst, phase) if inst:HasTag("playerghost") or inst.components.health:IsDead() then return end if phase == "night" then if TheWorld.state.isfullmoon then inst.components.talker:Say ("The moon shall grant me more power") inst.components.locomotor.runspeed = 2 * TUNING.WILSON_RUN_SPEED inst.components.health.absorb = 1.2 inst.components.combat.damagemultiplier = 3 inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE inst.nightregen = inst:DoPeriodicTask(2, function()--2 seconds to do the below function if not inst.components.health:IsDead() then inst.components.health:DoDelta(6, true, "regen")--heal 1hp end end) if inst.duskregen then inst.duskregen:Cancel() inst.duskregen = nil end else inst.components.locomotor.runspeed = 1.8 * TUNING.WILSON_RUN_SPEED inst.components.health.absorb = 0.6 inst.components.combat.damagemultiplier = 1.5 inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE inst.nightregen = inst:DoPeriodicTask(2, function()--2 seconds to do the below function if not inst.components.health:IsDead() then inst.components.health:DoDelta(3, true, "regen")--heal 1hp end end) if inst.duskregen then inst.duskregen:Cancel() inst.duskregen = nil end end elseif phase == "dusk" then inst.components.locomotor.runspeed = 1.3 * TUNING.WILSON_RUN_SPEED inst.components.health.absorb = 0.4 inst.components.combat.damagemultiplier = 1.2 inst.components.hunger.hungerrate = 1.1 * TUNING.WILSON_HUNGER_RATE inst.duskregen = inst:DoPeriodicTask(4, function()--4 seconds to do the below function if not inst.components.health:IsDead() then inst.components.health:DoDelta(1, true, "regen")--heal 1hp end end) if inst.daydamage then inst.daydamage:Cancel() inst.daydamage = nil end elseif phase == "day" then inst.components.locomotor.runspeed = 1.0 * TUNING.WILSON_RUN_SPEED inst.components.health.absorb = 0.2 inst.components.combat.damagemultiplier = 0.9 inst.components.hunger.hungerrate = 0.8 * TUNING.WILSON_HUNGER_RATE if inst.nightregen then inst.nightregen:Cancel() inst.nightregen = nil end inst.daydamage = inst:DoPeriodicTask(3, function()--3 seconds to do the below function if not inst.components.health:IsDead() then inst.components.health:DoDelta(-3, true, "regen")--damage hp end end) end end Edited June 26, 2022 by rainbuni it's got solved :) Link to comment https://forums.kleientertainment.com/forums/topic/141233-solved-need-help-with-changing-the-stats-in-the-full-moon-phrase/ Share on other sites More sharing options...
-LukaS- Posted June 26, 2022 Share Posted June 26, 2022 Checking for the full moon can be done like this: TheWorld.state.moonphase == "full" You can also do it using WatchWorldState("moonphase", your_function) 1 Link to comment https://forums.kleientertainment.com/forums/topic/141233-solved-need-help-with-changing-the-stats-in-the-full-moon-phrase/#findComment-1579911 Share on other sites More sharing options...
rainbuni Posted June 26, 2022 Author Share Posted June 26, 2022 Thank you so much! it's working now Link to comment https://forums.kleientertainment.com/forums/topic/141233-solved-need-help-with-changing-the-stats-in-the-full-moon-phrase/#findComment-1579919 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