How to reduce the amount of walking frames in a custom character?

Status
Not open for further replies.
There's this custom character i'm making, but it only has 7 sprites, making it so the 7th frame has to be repeated, making it look weird
is there a way i can remove the 8th frame so it only goes to 1-7?
 
You could use Lua to skip the last state in the walking animation automatically. Last I remember, I made my own Brak Eggman character skip every 3rd frame, so possibly you could refer to that? (There may be other custom characters that do it without depending on custom actions though, I don't remember offhand)
 
Here, put this code into a Lua lump in your wad, replacing "sonic" with your character's skin name:

Code:
addHook("MobjThinker", function(mo)
	if mo and mo.skin == "sonic" and mo.state == S_PLAY_RUN8
		mo.state = S_PLAY_RUN1
	end
end, MT_PLAYER)
In English, this tells the game that for every player object (MT_PLAYER), if the player is playing as Sonic and is on the eighth run frame, switch to the first run frame before he is displayed on screen.
 
Here, put this code into a Lua lump in your wad, replacing "sonic" with your character's skin name:

Code:
addHook("MobjThinker", function(mo)
	if mo and mo.skin == "sonic" and mo.state == S_PLAY_RUN8
		mo.state = S_PLAY_RUN1
	end
end, MT_PLAYER)
In English, this tells the game that for every player object (MT_PLAYER), if the player is playing as Sonic and is on the eighth run frame, switch to the first run frame before he is displayed on screen.
Holy crap THANK YOU SO MUCH
also, is it the same for extending animations? (like making walking frames from 8 to 10?)
 
If you check the list of states you can see that only walking states S_PLAY_RUN1 through S_PLAY_RUN8 exist. If you wanted to extend the walking animation from the natural one, you'd have to write out new states and program the extended animation with Lua. Personally I think at that point it would be better to program your own animation from scratch, or set up a player counter variable through Lua that determines which frame to show.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top