Jump to content

Trouble getting character to walk after Transformation


Toonic

Recommended Posts

Basically, I'm trying to make a mod for a friend of mine which will have him turn into the Moose Goose on a full moon.

 

The problem is, once he turns into the Moose Goose, you're unable to control him.

 

Heres the code for the player.

local MakePlayerCharacter = require "prefabs/player_common"local assets = {        Asset( "ANIM", "anim/player_basic.zip" ),        Asset( "ANIM", "anim/player_idles_shiver.zip" ),        Asset( "ANIM", "anim/player_actions.zip" ),        Asset( "ANIM", "anim/player_actions_axe.zip" ),        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),        Asset( "ANIM", "anim/player_actions_shovel.zip" ),        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),        Asset( "ANIM", "anim/player_actions_eat.zip" ),        Asset( "ANIM", "anim/player_actions_item.zip" ),        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),        Asset( "ANIM", "anim/player_actions_fishing.zip" ),        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),        Asset( "ANIM", "anim/player_bush_hat.zip" ),        Asset( "ANIM", "anim/player_attacks.zip" ),        Asset( "ANIM", "anim/player_idles.zip" ),        Asset( "ANIM", "anim/player_rebirth.zip" ),        Asset( "ANIM", "anim/player_jump.zip" ),        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),        Asset( "ANIM", "anim/player_teleport.zip" ),        Asset( "ANIM", "anim/wilson_fx.zip" ),        Asset( "ANIM", "anim/player_one_man_band.zip" ),        Asset( "ANIM", "anim/shadow_hands.zip" ),        Asset( "SOUND", "sound/sfx.fsb" ),        Asset( "SOUND", "sound/wilson.fsb" ),        Asset( "ANIM", "anim/beard.zip" ),		-- Don't forget to include your character's custom assets!        Asset( "ANIM", "anim/wod.zip" ),        Asset( "ANIM", "anim/goosemoose_build.zip" ),        Asset( "ANIM", "anim/goosemoose_basic.zip" ),}local prefabs = {}local function BecomeGoose(inst)    --local inst = CreateEntity()	local trans = inst.entity:AddTransform()	local anim = inst.entity:AddAnimState()	--local sound = inst.entity:AddSoundEmitter()	--local shadow = inst.entity:AddDynamicShadow()        MakeCharacterPhysics(inst, 5000, 1)        trans:SetScale(0.5,0.5,0.5)        inst.AnimState:SetBuild("goosemoose_build")    inst.AnimState:SetBank("goosemoose")    inst:SetStateGraph("SGmoose")        inst.components.talker:IgnoreAll()        inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED        local brain = require("brains/wilsonbrain")    inst:SetBrain(brain)        endlocal fn = function(inst)		-- choose which sounds this character will play	inst.soundsname = "wolfgang"	-- a minimap icon must be specified	inst.MiniMapEntity:SetIcon( "wilson.png" )	-- todo: Add an example special power here.        inst:ListenForEvent("nighttime", function(global, data)	    if GetClock():GetMoonPhase() == "full" then            BecomeGoose(inst)	    end	end, GetWorld())endreturn MakePlayerCharacter("wod", prefabs, assets, fn)

Any help would be great. I don't need him to attack, or anything else. Just to turn into it.

Link to comment
Share on other sites

Does the Moose change orientation when a direction key is pressed? Or does it just sit there and do nothing at all? If the former, try commenting out the MakeCharacterPhysics and see if it works then.

 

If the later, it's possible that there are differences between the wilson and Moose stategraphs in how they handle character movement. Check those and the playercontoller component as well.

Link to comment
Share on other sites

Thanks. It was the first one! Though he's a bit slow walking.

 

The other problem is (Which could be because I'm spamming GetClock():NextPhase() ) is when he turns into the Moose, he doesn't shut up and just keeps talking.

 

The other issue is when he eats or picks anything up he disappears/stops walking. 


Thanks. It was the first one! Though he's a bit slow walking.

 

The other problem is (Which could be because I'm spamming GetClock():NextPhase() ) is when he turns into the Moose, he doesn't shut up and just keeps talking.

 

The other issue is when he eats or picks anything up he disappears/stops walking. 


Thanks. It was the first one! Though he's a bit slow walking.

 

The other problem is (Which could be because I'm spamming GetClock():NextPhase() ) is when he turns into the Moose, he doesn't shut up and just keeps talking.

 

The other issue is when he eats or picks anything up he disappears/stops walking. 


Thanks. It was the first one! Though he's a bit slow walking.

 

The other problem is (Which could be because I'm spamming GetClock():NextPhase() ) is when he turns into the Moose, he doesn't shut up and just keeps talking.

 

The other issue is when he eats or picks anything up he disappears/stops walking. 

Link to comment
Share on other sites

Right, so I attempted to just make a Null/Empty ActionButton to not be able to pick up anything, however pressing Space causes the game to crash.

Anyone have any idea how to fix this? Also attempting to increase the walk speed doesn't appear to do anything...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...