Toonic Posted May 27, 2016 Share Posted May 27, 2016 Hey again! I decided to make a different topic. I'm trying to give my friend a "Hidden Perk" based on his username (Which contains the word Goose...) so I want to turn him into the Goose/Goose during full moons. I know how to do the night check/full moon check. However its the transforming part that is bothersome.I used to have it working, but I had like.. a stategraph? And a bunch of other stuff that I feel like was probably unneeded. The main goal is to just turn him into the Goose/Goose for the night, make him small, and thats really about it. Just something fun/silly. The small, speed, and so forth I can handle, its just the transforming part that I'm slightly confused on. Thanks in advance for all your help! Link to comment Share on other sites More sharing options...
DrSmugleaf Posted May 27, 2016 Share Posted May 27, 2016 From woodie.lua, line 367: inst:PushEvent("transform_werebeaver") Line 364: inst:PushEvent("transform_person") From SGwilson.lua, line 494-499: EventHandler("transform_werebeaver", function(inst, data) if inst.TransformBeaver ~= nil and not inst:HasTag("beaver") then inst.sg:GoToState("transform_werebeaver") end end), Line 734-799: State{ name = "transform_werebeaver", tags = { "busy", "pausepredict", "transform", "nomorph" }, onenter = function(inst) inst.Physics:Stop() if inst.components.rider ~= nil and inst.components.rider:IsRiding() then inst.sg:AddStateTag("dismounting") inst.AnimState:PlayAnimation("fall_off") inst.SoundEmitter:PlaySound("dontstarve/beefalo/saddle/dismount") else inst:SetCameraDistance(14) inst.AnimState:PlayAnimation("transform_pre") inst.components.inventory:DropEquipped(true) end inst.components.inventory:Close() inst:PushEvent("ms_closepopups") if inst.components.playercontroller ~= nil then inst.components.playercontroller:RemotePausePrediction() inst.components.playercontroller:Enable(false) end end, events = { EventHandler("animover", function(inst) if inst.AnimState:AnimDone() then if inst.sg:HasStateTag("dismounting") then inst.sg:RemoveStateTag("dismounting") if inst.components.rider ~= nil then inst.components.rider:ActualDismount() end inst:SetCameraDistance(14) inst.AnimState:PlayAnimation("transform_pre") inst.components.inventory:DropEquipped(true) elseif inst.TransformBeaver == nil or inst:HasTag("beaver") then inst.sg:GoToState("idle") else inst:TransformBeaver(true) inst.AnimState:PlayAnimation("transform_pst") SpawnPrefab("werebeaver_transform_fx").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst:SetCameraDistance() inst.sg:RemoveStateTag("transform") end end end), }, onexit = function(inst) if inst.sg:HasStateTag("dismounting") then --interrupted if inst.components.rider ~= nil then inst.components.rider:ActualDismount() end elseif inst.sg:HasStateTag("transform") then --interrupted inst:SetCameraDistance() end if inst.components.playercontroller ~= nil then inst.components.playercontroller:Enable(true) end end, }, Link to comment Share on other sites More sharing options...
Aquaterion Posted May 27, 2016 Share Posted May 27, 2016 I tried changing my build, bank and sg to the Goose/Goose's it does work, but walking is very wonky and attacking doesnt work, so making a similar stategraph is probably best to make sure u dont break anything in the normal sg, but u can add/edit states I guess to check for a certain tag for ur character Link to comment Share on other sites More sharing options...
Toonic Posted May 27, 2016 Author Share Posted May 27, 2016 (edited) 17 minutes ago, Aquaterion said: I tried changing my build, bank and sg to the Goose/Goose's it does work, but walking is very wonky and attacking doesnt work, so making a similar stategraph is probably best to make sure u dont break anything in the normal sg, but u can add/edit states I guess to check for a certain tag for ur character In the end of things, thats fine. Its more so as a cosmetic thing thats for fun and thats also what I had working. Edited May 27, 2016 by Toonic Link to comment Share on other sites More sharing options...
Toonic Posted May 28, 2016 Author Share Posted May 28, 2016 I ended up getting something working, however when the player dies as Goose, they don't turn back into human/ghost and the game just crashes. Link to comment Share on other sites More sharing options...
DarkXero Posted May 28, 2016 Share Posted May 28, 2016 http://steamcommunity.com/sharedfiles/filedetails/?id=622471256 Link to comment Share on other sites More sharing options...
Toonic Posted May 28, 2016 Author Share Posted May 28, 2016 31 minutes ago, DarkXero said: http://steamcommunity.com/sharedfiles/filedetails/?id=622471256 I actually came across that and was looking into it. I pulled the SGmooseplayer from it for the time being. However I believe on death its making a call to drop random items (Similar to that of regular mobs) So now I'm looking into this. Link to comment Share on other sites More sharing options...
DarkXero Posted May 28, 2016 Share Posted May 28, 2016 25 minutes ago, Toonic said: However I believe on death its making a call to drop random items (Similar to that of regular mobs) You are right. It's easy to dodge though. You can add a lootdropper component to your character, and leave the loot empty. Link to comment Share on other sites More sharing options...
Toonic Posted May 28, 2016 Author Share Posted May 28, 2016 2 minutes ago, DarkXero said: You are right. It's easy to dodge though. You can add a lootdropper component to your character, and leave the loot empty. That's what I assumed and was about to check, but then I got distracted attempting to get a full moon checker working. (Pulling from Woodies) I tried to throw it into my day/night checker, but that didn't work so I ended up re-writing a few things. Link to comment Share on other sites More sharing options...
Toonic Posted May 28, 2016 Author Share Posted May 28, 2016 Thanks @DarkXero and @DrSmugleaf for the help! I ended up getting it all working! Hopefully the last character I need to make I won't have anymore questions at that point. After that its just artwork. 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