Sign in to follow this  
Toonic

Transforming into Goose Moose....

Recommended Posts

Toonic    0

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!

Share this post


Link to post
Share on other sites
DrSmugleaf    61

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,
},

 

 

Share this post


Link to post
Share on other sites
Aquaterion    821

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

Share this post


Link to post
Share on other sites
Toonic    0
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 by Toonic

Share this post


Link to post
Share on other sites
Toonic    0

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. 

Share this post


Link to post
Share on other sites
DarkXero    2893
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.

Share this post


Link to post
Share on other sites
Toonic    0
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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this