dungdodger Posted October 5, 2015 Share Posted October 5, 2015 (edited) Hey all. I'm having some issues with my fullmoon transformation it was working in DS put cant seem to get it working in DST And another thing i noticed is when I'm in the caves it just stays on night setting even while standing under light where the clock is showing Day,dust and night. Is this just buged atm or am i missing something here also Thanks Here is what i gotlocal function updatestats(inst)if TheWorld.state.isday theninst.AnimState:SetBuild("wou")inst.components.talker:Say ("Oink light ball... Shhh!!! another day of this!")inst.components.sanity.maxsanity = 100inst.components.sanity.dapperness = .07elseif TheWorld.state.isdusk theninst.AnimState:SetBuild("wou")inst.components.talker:Say ("I can feel it pulling at me")inst.components.sanity.dapperness = -.16elseif TheWorld.state.isnight thenif TheWorld.state.isfullmoon theninst.components.talker:Say ("Ooh NOO... It feels like..... is it looking at us")inst.components.sanity.maxsanity = 50inst.components.sanity.dapperness = -.05inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.3)inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3)inst.AnimState:SetBuild("were_wou")--inst.components.health.maxhealth = 200endinst.AnimState:SetBuild("wou")inst.components.talker:Say ("ahhh. No full moon in sight")inst.components.sanity.dapperness = .20endendlocal function master_postinit(inst)--inst.components.inventory:GuaranteeItems(prefabs)inst:WatchWorldState("startday", function() updatestats(inst) end , TheWorld)inst:WatchWorldState("startdusk", function() updatestats(inst) end , TheWorld)inst:WatchWorldState("startnight", function() updatestats(inst) end , TheWorld)updatestats(inst)-- Stats--inst.components.eater:SetCarnivore(true)inst.components.health:SetMaxHealth(100)inst.components.hunger:SetMax(200)inst.components.sanity:SetMax(100)inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE*1.2)inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)inst.components.sanity.neg_aura_mult = 1.5return instend wou.lua Edited October 5, 2015 by dungdodger Link to comment Share on other sites More sharing options...
Neu7ral Posted October 5, 2015 Share Posted October 5, 2015 I think if was because you putifelseifelseifif I think if would beifelseifelseifelse Link to comment Share on other sites More sharing options...
DarkXero Posted October 5, 2015 Share Posted October 5, 2015 I'm having some issues with my fullmoon transformation it was working in DS put cant seem to get it working in DST It is working, except that during the full moon night, what happens is if TheWorld.state.isfullmoon then inst.components.talker:Say ("Ooh NOO... It feels like..... is it looking at us") inst.components.sanity.maxsanity = 50 inst.components.sanity.dapperness = -.05 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.3) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3) inst.AnimState:SetBuild("were_wou") --inst.components.health.maxhealth = 200 end inst.AnimState:SetBuild("wou") inst.components.talker:Say("ahhh. No full moon in sight") inst.components.sanity.dapperness = .20The SetBuild("wou") happens regardless of the full moon because it isn't inside an ELSE. And another thing i noticed is when I'm in the caves it just stays on night setting even while standing under light where the clock is showing Day,dust and night. Is this just buged atm or am i missing something here also Correct. Caves have constant world night. What you see in the caves are the cavephases: caveday, cavedusk and cavenight. Link to comment Share on other sites More sharing options...
dungdodger Posted October 5, 2015 Author Share Posted October 5, 2015 (edited) I think if would be if elseif elseif else OK ITS WORKING THANKS DarkXero It Was the order i see now i think what you meant I tried replacing the if with else i got an error saying expecting a = near then I tried a few things with else but nothing seemed to work. The SetBuild("wou") happens regardless of the full moon because it isn't inside an ELSE elseif TheWorld.state.isnight thenif TheWorld.state.isfullmoon theninst.components.talker:Say ("Ooh NOO... It feels like..... is it looking at us")inst.components.sanity.maxsanity = 50inst.components.sanity.dapperness = -.05inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.3)inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3)inst.AnimState:SetBuild("were_wou")--inst.components.health.maxhealth = 200endinst.AnimState:SetBuild("wou")inst.components.talker:Say ("ahhh. No full moon in sight")inst.components.sanity.dapperness = .20 This doesn't count "wou" as being in a else? the elseif TheWorld.state.isnight then This is just the order i see on another mod I did some rearranging trying to figured out why "wou" wasn't in a else.And the strangest thing I get the Text and - dapperness but not the -sanity if i log off and back on under a full moonThen when morning phase starts i get the Build change but still no -sanitythen i log off and back on and its back to the normal cycle Any ideas I'm sure yall can tell im pretty new to this coding moding stuffHere is new orderlocal function updatestats(inst) if TheWorld.state.isday then inst.AnimState:SetBuild("wou") inst.components.talker:Say ("Oink light ball... Shhh!!! another day of this!") inst.components.sanity.maxsanity = 100 inst.components.sanity.dapperness = .07 elseif TheWorld.state.isdusk then inst.AnimState:SetBuild("wou") inst.components.talker:Say ("I can feel it pulling at me") inst.components.sanity.dapperness = -.16 elseif TheWorld.state.isnight then inst.AnimState:SetBuild("wou") inst.components.talker:Say ("ahhh. No full moon in sight") inst.components.sanity.dapperness = .20 end if TheWorld.state.isfullmoon then inst.components.talker:Say ("Ooh NOO... It feels like..... is it looking at us") inst.components.sanity.maxsanity = 50 inst.components.sanity.dapperness = -.05 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.3) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3) inst.AnimState:SetBuild("were_wou") --inst.components.health.maxhealth = 200 end end Edited October 5, 2015 by dungdodger Link to comment Share on other sites More sharing options...
DarkXero Posted October 5, 2015 Share Posted October 5, 2015 @dungdodger:local function updatestats(inst) -- If it is day then if TheWorld.state.isday then inst.AnimState:SetBuild("wou") inst.components.talker:Say ("Oink light ball... Shhh!!! another day of this!") inst.components.sanity.maxsanity = 100 inst.components.sanity.dapperness = .07 -- It wasn't day, so, if it is dusk then elseif TheWorld.state.isdusk then inst.AnimState:SetBuild("wou") inst.components.talker:Say ("I can feel it pulling at me") inst.components.sanity.dapperness = -.16 -- It wasn't dusk either, so, if it is night then elseif TheWorld.state.isnight then -- If this night has a full moon then if TheWorld.state.isfullmoon then inst.components.talker:Say ("Ooh NOO... It feels like..... is it looking at us") inst.components.sanity.maxsanity = 50 inst.components.sanity.dapperness = -.05 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.3) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3) inst.AnimState:SetBuild("were_wou") --inst.components.health.maxhealth = 200 -- There isn't a full moon inside this night, so, then else inst.AnimState:SetBuild("wou") inst.components.talker:Say ("ahhh. No full moon in sight") inst.components.sanity.dapperness = .20 end endend Link to comment Share on other sites More sharing options...
dungdodger Posted October 7, 2015 Author Share Posted October 7, 2015 @DarkXero Thank you!!! I see how else works now the code did start working right. Even without the else i had the end for fullmoon to high up And the Info for caves fixed that need an or 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