Jump to content

[Solved] How to make character do groggy walk without groggy tag?


Recommended Posts

Hello, I have a problem if someone can help me that would really be nice :)!

So, I'm wondering if I can make my character use groggy walk anims without adding tag "groggy" to him? Since it causes glitches when he's supposed to become groggy by mandrake & stuff.

That's it :), have a great day/night :D!

Edited by SuperDavid
Link to comment
Share on other sites

I just finally found out the fire that spawns on character is called "character_fire" so I can make my own magical fire prefab!

Now all I need help with now is how is how can I make my character do groggy walk without the groggy tag

Edited by SuperDavid
Link to comment
Share on other sites

If you buy both sets of jammies and both fuzzy rol skins you get both the /yawn emote and the /sleepy emote. It uses the same animations your character normally makes when under the groggy effect so it's ALMOST the same. Almost.

Link to comment
Share on other sites

13 minutes ago, SuperDavid said:

What I mean is I want my character to walk/run like like while under the groggy effect without using the "groggy" tag to do so, sorry if I wasn't clear enough!

groggy walk.gif

That is not a such a big problem, for example, you got a third arm to worry about.

Link to comment
Share on other sites

Sounds to me like you want to change the running sprites. I don't really know how to find these things, but what you want to do is locate the drowsy walking sprites, copy them, locate the normal running sprites, and replace them with the drowsy ones. Easier said than done.

Link to comment
Share on other sites

Well so far I got this code in modmain.lua which replaces the run anims with groggy anims, the only problem is it doesn't let the anim finish & keeps replaying it half-way, I don't really have any idea what I'm doing...hopefully someone can nudge me in the correct way :).

Spoiler

AddStategraphPostInit("wilson", function(sg)
	local _run_onenter = sg.states.run.onenter
	
	local function GetRunStateAnim(inst)
    return (inst.sg.statemem.heavy and "heavy_walk")
        or (inst.sg.statemem.sandstorm and "sand_walk")
        or (inst.sg.statemem.groggy and "idle_walk")
        or (inst.sg.statemem.careful and "careful_walk")
        or "run"
	end
	
	sg.states.run.onenter = function(inst)
		_run_onenter(inst)
	
		if inst.prefab == "wilson" and inst.AnimState:IsCurrentAnimation(GetRunStateAnim(inst).."_pst") then
			inst.AnimState:PlayAnimation("idle_walk_pst")
		elseif inst.prefab == "wilson" and inst.AnimState:IsCurrentAnimation("run") or inst.AnimState:IsCurrentAnimation("run_loop") then
			inst.AnimState:PlayAnimation("idle_walk")
		elseif inst.prefab == "wilson" and inst.AnimState:IsCurrentAnimation(GetRunStateAnim(inst).."_pst") then
			inst.AnimState:PlayAnimation("idle_walk_pre")
		end
		
	end
end)

 

 

Link to comment
Share on other sites

why do you have

 

if inst.prefab == "wilson" and inst.AnimState:IsCurrentAnimation(GetRunStateAnim(inst).."_pst") then inst.AnimState:PlayAnimation("idle_walk_pst") elseif inst.prefab == "wilson" and inst.AnimState:IsCurrentAnimation("run") or inst.AnimState:IsCurrentAnimation("run_loop") then inst.AnimState:PlayAnimation("idle_walk") elseif inst.prefab == "wilson" and inst.AnimState:IsCurrentAnimation(GetRunStateAnim(inst).."_pst") then inst.AnimState:PlayAnimation("idle_walk_pre") end

 

Shouldn't one be _pre then _pre instead of _pst then _pre ?

Not sure it will solve your problem.

Link to comment
Share on other sites

Oh, I didn't notice that, but it didn't really affect anything:wilson_dorky:.. I think I'll just use the groggy tag & add some checks if he's groggy or not to remove/add the groggy tag then he can get the actual groggy tag. Since I noticed even if he does groggy walk, he doesn't do groggy idle without the tag.

Link to comment
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
 Share

×
  • Create New...