Rock type characters help: Running and shooting animations

Started by RedDragonCats17, May 21, 2019, 08:29:55 PM

Previous topic - Next topic

RedDragonCats17

If you don't know what Rock type characters are, they are the characters that rely on long range combat and have the ability to run and shoot. I need help in making the running and shooting frames match the standard running frames.

This is going to be tricky to explain, but I'll try my best.

Let's say that you're running around the arena and you start firing. If you're on a specific frame, like frame 3, and you shoot, the running and shooting animation will start on that specific frame. Some good examples of characters doing this would be Fusion's MegaMan X, Ahuron's Ultimate Armor, N64Mario's Vent and Aile, and Ahuron's NES MegaMan.

I want to start with my NES MegaMan (secret character) and Model X first, because they're not as hard as what MegaMan and MegaMan X are going to be. Model X is going to be a little more difficult, primarily because she has 2 running and shooting animations. (It is a she in this case, because I'm using Aile right now)





They may look the same at first glance, but if you had the character SFF and you zoomed up to the sprites, there is a difference.

That aside, how can I make the running and shoot animations work on any of the frames of the running animation?

altoiddealer

When you ChangeAnim, you can change to a specific animelem by using the "Elem" parameter.

So, what you should do is have one Shooting anim (the full anim), and use a Var to change to the correct elem value.
You can apply this logic to any animations that you want to jump into depending on what frame you were just on.

In your walk state, you can set the Var using a Null controller like so

[State 20, Log the current animelem]
type = Null
trigger1 = Time = 0 || animtime = 0
trigger1 = var(1) := 0
trigger2 = anim = 20 && AnimElem = 1
trigger2 = var(1) := 1
trigger3 = anim = 20 && AnimElem = 2
trigger3 = var(1) := 2
trigger4 = anim = 20 && AnimElem = 3
trigger4 = var(1) := 3

etc

Then in your attack state

[State 200, Shoot]
type = ChangeAnim
trigger1 = time = 0
elem = var(1)


If you want to use this same behavior for various movements like walkback, jumping, etc, you could stick the Null controller in State -3 and just factor those anims into the triggers.


You can also just have your attacks in the same state as your movement (so you never leave the state).  Just be sure to use StateTypeSet, you can change to a specific animelem by using the "Elem" parameter.


RedDragonCats17

Okay, so it does work on NES MegaMan, the thing is he's not moving, he's just statically walking. How do I keep him moving?

(I wasn't paying attention about the other post, my bad)

altoiddealer

The walk state should have a VelSet controller, so you just need to adjust the triggers so that it continues applying forward velocity when you change to the shooting anim.


RedDragonCats17

So should I use the variable for a trigger or stateno != 200 or something?

Cyanide

No. You should use the button you press or hold to make him do that. Otherwise hes going to do it when you don't want him to. Please think about the situations not just the sodding outcome its going 5o help you so much.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

RedDragonCats17

Like this?

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
trigger2 = command = "x"
x = const(velocity.walk.fwd.x)


The reason why I use a trigger 2 is because pressing X is not required to even move, it is required to walk while shooting, though.

Odb718

So you still dont know how triggers work?
Quote from: RedDragonCats17 on May 22, 2019, 08:04:35 AMtrigger2 = command = "x"
because pressing X is not required to even move
When trigger 2 happens, the velset happens.

----
First off, I'm not sure where/what state you're using for this. But why aren't you setting the velocity in the StateDef????
What ever you have to do to get into the state, walking or whatever, you've done it.
Now,
If you stop doing it?
You'll switch states.
1 velset should suffice

This isn't even a question man.
vVv Gouken718 vVv SabreTooth718 vVv


RedDragonCats17

#8
Well what am I supposed to do then? Just saying "I just need to adjust the triggers" and "I should use the button I press or hold" helps me none.

Odb718

Quote from: Odb718 on May 22, 2019, 10:01:45 AMFirst off, I'm not sure where/what state you're using for this. But why aren't you setting the velocity in the StateDef????
You should be able to answer this question. It's to get you to realize what you actually need to do. You want the velocity set for the entire time you're in the state right???
Spoiler (click to show)
setting it in the statedef wont work because it should have standing physics. because you want it to work 100% of the time, you just need time = 1.

Why do you think you need TWO triggers for your velset?
vVv Gouken718 vVv SabreTooth718 vVv


RedDragonCats17

Answering your question real quick, I'm doing this for the standard shot, which is state 200. Some MegaMan characters have a separate state for walking and shooting, but idk if it'll be the case here, based on altoiddealer's instructions.

I never use the velset in the state def. The velset state controller gives me more freedom on when I want a character to move when doing a certain action. I honestly don't know what you have in mind for the velset in the statedef.

As of now, the statedef looks like this:

;---------------------------------------------------------------------------
; Standard Shot
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 0                  ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

Odb718

You seem to have jumbled up what Altoid said and thinks you did.

Quote from: altoiddealer on May 21, 2019, 09:47:32 PMYou can also just have your attacks in the same state as your movement (so you never leave the state).  Just be sure to use StateTypeSet, you can change to a specific animelem by using the "Elem" parameter.
Quote from: altoiddealer on May 22, 2019, 03:52:17 AM
The walk state should have a VelSet controller, so you just need to adjust the triggers so that it continues applying forward velocity when you change to the shooting anim.

The way you seem to be doing it, probably isn't how any of us imagined to do it. But it does make sense.
All you need to do is check if P1 is holding forward to change the animation to walking. Nothing else needs to affect it walking right?
You're going to run into a few problems using a state that usually stands still.
#1, what happens if P1 presses forward in the middle of the regular state 200 animation???
#2, what happens if P1 lets go of forward in the middle of the walking shoot animation???

Because you want this one state to be loaded 2 different ways, through 2 different ways of loading it, You're going to need to be able to check which way you came in.
PrevStateNo
is an obvious choice. It has it's weak points.

To cut a lot of headaches out, Duplicate your 200 state, rename it, and switch to that while walking.
Make sure you reset the variable right above your changestate when you leave the state. You dont want to cause issues with it not knowing what sprite to load up because it didn't start at 0 the 2nd time around.

Is
physics = N 
How you originally had the state? Or did you switch it because of what I mentioned? Mega Man has some odd physics, but usually a standing attack has
physics = S
because it's standing.
vVv Gouken718 vVv SabreTooth718 vVv


RedDragonCats17

It was originally S, but you were right, I switched it because of what you mentioned.

I duplicated the state, and I remade everything in the original to how it originally was. How do I make the changestate (or whatever you have in mind) to switch to this new state while walking? I know about the variable reset, but I don't have a clear vision on what I have to put in the switch, aside from prevstateno.

altoiddealer

#13
Sorry if I just added confusion heh :)  This is not a particularly simple problem to solve.

I'm going to add some code to default walk state and Kung Fu Man's State 200 and paste it below, so you can see what I was thinking of.

Spoiler: Default Walk State that logs your current animelem to a Var (click to show)

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;***KFM HAS 16 ELEMS IN HIS WALK FWD ANIMATION, BUT WE WILL PRETEND HE HAS ONLY 4**
[State 20, Log the current animelem]
type = Null
trigger1 = Time = 0 || animtime = 0
trigger1 = var(1) := 0 ;Sets var(1) to 0 if the above condition is true
trigger2 = anim = 20 && AnimElem = 1
trigger2 = var(1) := 1 ;Sets var(1) to 1 if the above condition is true
trigger3 = anim = 20 && AnimElem = 2
trigger3 = var(1) := 2 ;Sets var(1) to 1 if the above condition is true
trigger4 = anim = 20 && AnimElem = 3
trigger4 = var(1) := 3 ;Sets var(1) to 3 if the above condition is true
trigger5 = anim != 20 ;CHANGED TO TURNING OR WALK BACK ANIM
trigger5 = var(1) := 0 ;RESET THE COUNTER


Spoiler: KFM State 200 that recognizes the AnimElem from Walk State (click to show)

[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
;anim = 200 ***DO NOT CHANGE ANIM VIA STATEDEF**;
poweradd = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, Change to the correct Anim AND Elem]
type = ChangeAnim
trigger1 = Time = 0
value = 200 ;Shoot anim
elem = var(1) ;The frame you left off on from Walk State

[State 200, Reset the Var that was keeping track of your Walking anim elem]
type = VarSet
trigger1 = Time = 0
var(1) = 0 ;Back to ZERO


[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -76               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 15                 ;Time before opponent regains control in airz

[State 200, 2]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



*Edit* so, if you understand the above and manage to make it work for you, you will notice that when you switch to the Shooting anim that the animelem will play slightly longer than expected.  This is b/c your animelems are several ticks in duration, and you are essentially changing to the same animelem from the first tick.
To solve this problem, you can duplicate the frames in your Walk and Shoot anims so that every frame of animation is only 1-tick in duration (and add more triggers to the Null controller). So like if the first elem is 4 ticks long, duplicate this so you have 4 frames @ 1-tick each.
You will then be keeping track of every tick of animation, and it will look much smoother.


RedDragonCats17

#14
Should I add command = holdforward to the change anim? Rock will automatically go to the walk and shoot anim immediately if I keep it as it is.

-----

Actually, Odb, what do you think about this method?

-----

Okay, so I tried to take matters into my own hands and try to make the walk and shoot state by myself using N64Mario's MMZX characters as a reference.

Here's the changestate for going into 201:

[State 200, 3]
type = ChangeState
triggerall = Time >= 0 ;This was part of N64Mario's code, but I adjusted it because Rock will shoot more than 1 projectile in seconds.
trigger1 = command = "holdfwd" ;Obviously.
value = 201
ctrl = 1


And here's the state itself:

Spoiler (click to show)
;---------------------------------------------------------------------------
; Standard Walking Shot
[Statedef 201]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air                      ;Change animation (Def: no change)
poweradd = 0                  ;Power to add (Def: 0)         ;Set p1's sprite layering priority to 2 (in front)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S200,0

[State 200, Change to the correct Anim AND Elem]
type = ChangeAnim
triggerall = anim = 20
trigger1 = Time = 0
value = 201
elem = var(1)

[State 200, Reset the Var that was keeping track of your Walking anim elem]
type = VarSet
trigger1 = Time = 0
var(1) = 0

[State 20, 1]
type = VelSet
trigger1 = anim = 201
x = const(velocity.walk.fwd.x)

[State 200, Projectile]
type = Projectile
trigger1 = time = 0
ProjID = 2000
projanim = 2000
projscale = 1,1
projremove = 1
projremovetime = -1
velocity = 5,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projpriority = 1
projsprpriority = 3
projedgebound = 40
projstagebound = 40
offset = 18,-11
postype = p1         ;p2,front,back,left,right
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = S, NA
animtype  = Medium
damage    = 23
guardflag = MA
pausetime = 12,12
sparkno = -1
sparkxy = -10,-70
hitsound   = S5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 2
ground.hittime  = 16
ground.velocity = -5.5
air.velocity = -2.5,-4
forcenofall = 1
getpower = 0,0
givepower = 0,0

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 20
ctrl = 1

To Odb: Yes, I am using a projectile for Rock, and this particular version of Rock is not going to be ported to regular MUGEN because there are already versions of him that are just like this and one of them is technically fighting game friendly, and we don't know when KingPepe will port his version from Famicom Fighters, but when he does, that's a instantly better version of him since he's fighting game friendly. So this version of Rock is an exclusive along with the bosses.

Anyway, I've had some success, but Rock goes into his shooting walking animation for about half a second, as you can see here.

https://streamable.com/uy18t

If there's any way you guys could help me out and fix these things, I'd appreciate it big time. Idk how I'll repay you, but I'll go as far as to stay silent on the Discord.

altoiddealer

How many Elems are in the walking anim, and in the shooting anim?

Can you upload the 2 anims as well?


RedDragonCats17


altoiddealer

#17
I have time on my hands, so how about just copy/paste your code for State 20 and any other states that have to do with running (If anything else other than what you've already shared).  I'm going to solve most of this for you, but don't worry you'll still have a few things to do :)


RedDragonCats17

Spoiler (click to show)
;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = N
sprpriority = 0

[State 20, Log the current animelem]
type = Null
trigger1 = Time = 0 || animtime = 0
trigger1 = var(1) := 0 ;Sets var(1) to 0 if the above condition is true
trigger2 = anim = 20 && AnimElem = 1
trigger2 = var(1) := 1 ;Sets var(1) to 1 if the above condition is true
trigger3 = anim = 20 && AnimElem = 2
trigger3 = var(1) := 2 ;Sets var(1) to 1 if the above condition is true
trigger4 = anim = 20 && AnimElem = 3
trigger4 = var(1) := 3 ;Sets var(1) to 3 if the above condition is true
trigger5 = anim = 20 && AnimElem = 4
trigger5 = var(1) := 4
trigger6 = anim = 20 && AnimElem = 5
trigger6 = var(1) := 5
trigger7 = anim != 20 ;CHANGED TO TURNING OR WALK BACK ANIM
trigger7 = var(1) := 0

[State 20, 1]
type = VelSet
triggerall = command = "holdfwd"
trigger1 = time = 1
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, turn]
type = turn
trigger1 = command = "holdback"

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

Spoiler (click to show)
;---------------------------------------------------------------------------
; Standard Walking Shot
[Statedef 201]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air                      ;Change animation (Def: no change)
poweradd = 0                  ;Power to add (Def: 0)         ;Set p1's sprite layering priority to 2 (in front)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S200,0

[State 200, Change to the correct Anim AND Elem]
type = ChangeAnim
triggerall = anim = 20
trigger1 = Time = 0
value = 201
elem = var(1)

[State 200, Reset the Var that was keeping track of your Walking anim elem]
type = VarSet
trigger1 = Time = 0
var(1) = 0

[State 20, 1]
type = VelSet
trigger1 = anim = 201
x = const(velocity.walk.fwd.x)

[State 200, Projectile]
type = Projectile
trigger1 = time = 0
ProjID = 2000
projanim = 2000
projscale = 1,1
projremove = 1
projremovetime = -1
velocity = 5,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projpriority = 1
projsprpriority = 3
projedgebound = 40
projstagebound = 40
offset = 18,-11
postype = p1         ;p2,front,back,left,right
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = S, NA
animtype  = Medium
damage    = 23
guardflag = MA
pausetime = 12,12
sparkno = -1
sparkxy = -10,-70
hitsound   = S5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 2
ground.hittime  = 16
ground.velocity = -5.5
air.velocity = -2.5,-4
forcenofall = 1
getpower = 0,0
givepower = 0,0

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 20
ctrl = 1

This is all I got for now. I have played the GB MegaMan games, and I only remember the metal blade being a useful weapon.

altoiddealer

#19
Here's what I think you should do, at least for this more basic Mega Man character... follow along closely.
If there is any code you do not understand, you should refer to the State Controllers and Triggers docs.

Back up your character (CONSTANTLY back up your character)

1.There should only be 4 elems in the running anim.
-The first elem of the Run anim is probably your idle anim, yes?  It should not be in the walk anim at all.
-The first sprite in your attack anim should only be in its own unique anim, because this sprite is only correct when he is standing still and shooting, yes?  Assign this sprite to Anim 202, and give it an 8-tick duration.
-You can simply delete Anim 201.  You'll see why in the following instructions.

2. I am recommending that you use ONE Player Anim that does not have the arm(s) in the animation, and then overlay the arms as Explods.
-The body will be the player anim 20 (and 21).  You can use whatever duration for the elems (you are using 8 ticks per frame, yes?)
-The Arms (running) will be anims 17, 18 and 19.  These anims must be 1-tick in duration (the code will control them).
-The Arms (run/shooting) will be anims 22 and 23.  These anims must be 1-tick in duration (the code will control them).
Spoiler: preview anims (click to show)


Spoiler: The Sprites (click to show)

Anim 20

(4th frame is a dupe of Sprite 2)

Anims 17, 18 and 19 (1-Tick duration each)

(4th frame is a dupe of the 2nd Sprite - the code will use anim 18)

Anims 22 and 23 (1-Tick duration each)

(3rd and 4th frames are dupes of sprites 1 and 2 - the code will use anims 22 and 23)

-Do not ChangeAnim when going into State 201 from state 20.  Allow the "body" animation to just continue.
-Only changeanim from State 0, for the one I mentioned first (anim 202).

Alright, now here's the code.
So long as you add the sprites and create the various anims as described above, this will work exactly as you want it to.
Spoiler: The Code (click to show)


;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = N
sprpriority = 0

[State 20, 1]
type = VelSet
triggerall = command = "holdfwd"
trigger1 = time = 1
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)


[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, turn]
type = turn
trigger1 = command = "holdback"

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, Walking Arms - Frame 1]
type = Explod
triggerall = anim = 20 || anim = 21 ;Only for anims 20 and 21
trigger1 = AnimElem = 2, < 0 ;Whenever Animelem 1 is active
anim = 17

[State 20, Walking Arms - Frames 2 & 4]
type = Explod
triggerall = anim = 20 || anim = 21 ;Only for anims 20 and 21
trigger1 = AnimElem = 2, >= 0 && animelem = 3, < 0 ;Whenever Animelem 2 is active
trigger2 = AnimElem = 4, >= 0 ;Whenever Animelem 4 is active
anim = 18

[State 20, Walking Arms - Frame 3]
type = Explod
triggerall = anim = 20 || anim = 21 ;Only for anims 20 and 21
trigger1 = AnimElem = 3, >= 0 && animelem = 4, < 0 ;Whenever Animelem 3 is active
anim = 19


;---------------------------------------------------------------------------
; Standard Walking Shot
[Statedef 201]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air                      ;Change animation (Def: no change)
poweradd = 0                  ;Power to add (Def: 0)         ;Set p1's sprite layering priority to 2 (in front)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S200,0

[State 200, Change to Standing Still Shooting Anim]
type = ChangeAnim
triggerall = anim = 0 ;If you changed from Idle anim
trigger1 = time = 0
value = 202 ;The "standing still and shooting" anim

[State 20, Shooting Arms - Frames 1 & 3]
type = Explod
triggerall = anim = 20 || anim = 21 ;Only for anims 20 and 21
trigger1 = AnimElem = 2, < 0 ;Whenever Animelem 1 is active
trigger2 = AnimElem = 3, >= 0 && animelem = 4, < 0 ;Whenever Animelem 3 is active
anim = 22

[State 20, Shooting Arms - Frames 2 & 4]
type = Explod
triggerall = anim = 20 || anim = 21 ;Only for anims 20 and 21
trigger1 = AnimElem = 2, >= 0 && animelem = 3, < 0 ;Whenever Animelem 2 is active
trigger2 = AnimElem = 4, >= 0 ;Whenever Animelem 4 is active
anim = 23

[State 20, 1]
type = VelSet
trigger1 = anim = 20 || anim = 21
x = const(velocity.walk.fwd.x)

[State 200, Projectile]
type = Projectile
trigger1 = time = 0
ProjID = 2000
projanim = 2000
projscale = 1,1
projremove = 1
projremovetime = -1
velocity = 5,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projpriority = 1
projsprpriority = 3
projedgebound = 40
projstagebound = 40
offset = 18,-11
postype = p1         ;p2,front,back,left,right
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
; HitDef
attr = S, NA
animtype  = Medium
damage    = 23
guardflag = MA
pausetime = 12,12
sparkno = -1
sparkxy = -10,-70
hitsound   = S5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 2
ground.hittime  = 16
ground.velocity = -5.5
air.velocity = -2.5,-4
forcenofall = 1
getpower = 0,0
givepower = 0,0

[State 200, 3]
type = ChangeState
trigger1 = Time >= 9
value = 20
ctrl = 1



Let me know if you have any questions.

*Edit* if you want the .PSD with running sprites split up, you can download it here.  It might be easier for you to save the sprites yourself, to set up your palettes.