-
Did this at another forum. But there's no real point keeping it locked up and i may as well put it out there. Starting here.
This little exercise is designed for people who have the really simple basics of creating changestates and animations and making an sff sorted out.
I wanted to pick a really simple looking sheet with enough in it that you can be challenged a wee bit
As such
Terry Bogard from Neo Geo Pocket
Ripped by Bonzai, as the sheet says, give credit people
http://sdb.drshnaps.com/sheets/SNK/SNKvsCapcom/Terry-motm.gif
Play style, your choice.
You can retain the game and set it up with lights close and heavy when further away or go to KoF and use 4 buttons. He has enough sprites for either to be viable
Top row
Stand = 5, Walk = 4, crouch = 1, backdash = 2, turn = 1, standguard = 1, crouchguard = 1, guardcrush = 1
row 2
Lightpunch = 2, hard punch = 3, light kick = 2, hard kick = 6, run = 4
row 3
near heavy kick = 4, jump = 5, light punch = 1, heavy punch = 2, light kick = 1, light kick = 2
row 4
C light punch = 2, C hard punch = 2, C light kick = 3, C hard kick = 4
Row 5
Ground wave = 7, rising tackle = 5
row 6
burning knuckle = 6, fire kick = 8
row 7
power dunk = 9
row 8
Crack shoot = 7, throw = 5, not sure about the next 3 ignore unless you know
row 9
Power geyser = 11, high angle geyser = 4
Row 10
Gethits = 8, intro = 4, win = 6
Set up your sff file as follows
Stand, crouch, walk, jump, run, intro, winpose, block, gethits,
basics (standing, crouching, jumping attacks)
specials (power wave, rising tackle, burning knuckle, crack shoot, fire kick, power dunk)
supers (power geyser, high angle geyser)
Recommended numbers for basic attacks in sff, follow them over to the .air file. You'll have [begin action 200] [begin action 210] etc
200, 210, 220, 230, 240
400, 410, 420, 430
600, 610, 620, 630
Recommended numbers for specials
1000, 1010, 1020, 1030, 1040, 1050
Recommended numbers for supers
3000, 3010
FX
6000, 6001, etc
Along with using the image numbers as animation numbers you'll also be using them as state numbers. I find this best if you ever need a helper or a couple of extra states for an attack, 10 is a nice number and should be enough for just about every move.
Total freedom on how you time your attacks and i'll be giving you some options later on.
Once you have all that sorted out in your mind, and in your sff and .air file you can move on to the next phase.
Don't forget to add the required sprites. They're talked about in spr.txt and spr.gif in your mewgen docs folder. If you don't have quite enough you can reuse and flip the ones you have. Sprite 4 would make a pretty good "hit up" and "hit up going down" sprite if you rotated it for eg. Sprite 5 would also make a good hit low sprite.
-
Basic attacks
Standing series.
For each of these attacks you will need
Changestate in the .cmd required triggers, command, statetype = S and ctrl
In the cns you will need Type and Physics on the attack set up to be S and movetype should be A. Set velset to 0,0, set ctrl = 0
Required sctrls. Hitdef, changestate and posadd (for heavy kick only). Playsnd should also be used in both heavy attacks but should not play every time you do one.
Required triggers. Time, animtime, animelem, random
Crouching attacks
In the cmd you will need a changestate. These attacks should be defined above your standing attacks. Required triggers, command, ctrl, statetype = C
In the CNS
Type and physics should be C. Movetype should be A. Set velset to 0,0, set ctrl = 0
Required sctrls, changestate, hitdef, playsnd
Required triggers. Time, animtime, random.
Both heavy attacks should contain sound but it should not play every time.
Air attacks
Giving you a choice here. You can make each air attack short or stay active. This is set partially via your .air file. If you set the animation up so the attack itself finishes on a -1 time terry will stay in that pose until he reaches ground level. If you set it up so the animation finishes (or loops...) you'll want to drop him into the jumping state again.
In the CMD, changestate, required triggers, ctrl, command, statetype = A
CNS. type and physics should be set to A. Movetype should be A as well. Do not add the parameter velset here. set ctrl = 0
Required sctrls, hitdef, changestate (only if you're doing the short attack)
Required triggers. Time, animtime (if you're doing the short attack)
If you plan to use the short attack you must use a changestate and go back to state 50 If not don't use the changestate sctrl at all and physics = A will allow you to land as if you'd just jumped. In addition set ctrl = 0 in this changestate so you can't do extra moves on your way down.
Helpful bits and pieces
Heavy kick, align frame 3's foot on the axis and posadd on that frame to where terry's foot was in frame 2.
If you set velset in air attacks it either adds or overrides your jumping velocity. Can cause some very strange behaviour.
Physics = A allows you to accelerate downwards. In addition physics = A will allow you to enter your jump land state (52) when you are at or below ground level.
-1 on an animation means, do not time out.
When setting up animations remember 60 ticks (time) is 1 second.
Next post special moves.
-
Starting out with
Power Wave
If you remember this was sprites 1-7 of row 5.
Details. Terry punches the ground and a projectile travels from his fist.
In the CMD. You will need a changestate. This should be ABOVE all your basic attacks.
Required triggers
Command, ctrl, statetype = S, numproj = 0
In the CNS
type and physics should be S, movetype should be A. Ctrl = 0, velset = 0,0
Required sctrls, playsnd, projectile, changestate
required triggers, time, animelem, animtime.
Here is a stripped down projectile sctrl to use. You will have to define the values yourself. I've only set a couple. Velocity should cause the projectile to travel forwards. Remember a positive value is forwards and negative is back. If using a Y velocity, negative is UP and positive is DOWN.
type = Projectile
trigger1 =
ProjID =
projanim =
projhitanim = -1
projremanim = -1
projcancelanim = -1
projremove = 1
projremovetime = -1
velocity =
projpriority = 1
offset =
damage =
sparkno =
sparkxy =
hitflag =
guardflag =
attr =
animtype =
pausetime =
hitsound =
guardsound =
ground.type = low
ground.slidetime =
ground.hittime =
Your final changestate should return you to state 0 and return control. You should NOT be able to do another power wave until the current one has hit or gone off screen.
There are extra parameters within the projectile sctrl that you can use for additional effects. You may read up on them within sctrls.html and see if any are actually useful.
Rising tackle
Sprites 8-12 on row 5.
Suggestions for the animation: loop frames 10-12 twice and add in a back flip at the end of the animation.
Attack details, terry flips upside down and spins while travelling upwards
CMD, you will need a changestate. Required triggers. statetype = S, ctrl and command. Once more this changestate should be ABOVE your basic moves.
CNS (gets interesting and clever here)
Type and Physics should be S. Movetype should be A. Velset = 0,0 and ctrl = 0
Required sctrls
Hitdef, changestate, playsnd velset, veladd and statetypeset (see)
Required triggers
time, animtime, animelemtime and Pos.
Statetypeset allows you to change your physics, type and movetype when and as you wish. We need statetype to be S at the start as we are on the ground and if hit we should play a ground gethit sprite. As soon as we leave the ground though we want to have it play air gethits so we need to change statetype to A.
Parameters you will need statetype = A and Physics = N. Your trigger will be pos Y< 0
We are using physics = N as we don't want Terry affected by gravity while he goes up.
In addition, add 3 triggers to your hitdef so Terry can hit 3 times.
trigger1 =
trigger2 =
trigger3 =
Set your velocity on frame 2 at a suitable point, like when you think Terry should leave the ground. Remember a negative velocity is up.
velsets look like this
type = velset
trigger1 = pos Y< 0
y = -40
x = 10
You do not need to use both x and y parameters. If you don't want to use x just leave it out and you will retain whatever velocity you had at that time.
use animelemtime with veladd to slow terry down in the last 2-4 frames.
animelemtime is set up like this
animelemtime(frame) = time of frame. You can use > and < to extend how long something will last. For example animelemtime(5) < 0 will cause it to trigger over frames 1-4 and stop triggering when you hit frame 5+.
Veladd is set up exactly the same way as velset. You do not need to use both parameters if you don't want to.
Changestate back to 50 and set ctrl to 0 when the attack is finished
What have we learned
We've learned about the projectile, statetypeset, veladd and velset.
We've also learned the triggers numproj, animelemtime and Pos
We've discovered that you don't need to use every part of an sctrl in order for it to work.
We've learned how to make a hitdef hit more than once.
We've found out how to make a trigger last over a period of time (thats the veladd remember)
-
Next attack
Burning Knuckle
Row 6, sprites 1-6
Suggestion for animation, add the blank no effect fist and the first effect fist again to lengthen it slightly.
Move details, Terry holds still for a couple of frames and then leaps forward and up slightly. He should then land again.
I won't define the command this time, only info you'll get is once more this must be ABOVE your basic attacks.
CNS: Once more less detail. This move is similar in requirements to rising tackle You will be able to alter that code to fit this move. Just remember you're going forwards this time so you will need X velocity, and you aren't going up so much.
The biggest clue i'll be giving you is you must include a velset when pos Y> 0 and set both X and Y velocities back to 0. You must also use a changestate to state 52 when pos Y>= 0 and enough time has actually elapsed.
Remember it's hitdef, playsnd, statetypeset, velset, veladd, animelemtime and changestate.
You should be able to get through this one by checking any problems you're having back with rising tackle as the 2 are so similar.
Fire Kick
Row 6, sprites 7-14.
Move details, Terry slides forwards and when he stops stands up and deals a heavy launcher kick.
We're going to do something interesting here and this will be a 2 part move. Your initial command will enter you into the slide state. Doing it again will allow you to do the heavy kick.
You will need to set up 2 animations and 2 states for this. Add a decent amount of time to the sliding kick part and include Terry's crouch animation at the very end of the animation. Terry's crouching frame should be frame 5.
We'll get the slide kick working first. Set up the changestate as you normally would.
CNS. Type in this instance should really be C as he is down so low. Physics is going to be N. Make sure both velset and ctrl are set to 0,0 and 0 respectively.
Required sctrls. Velset, veladd, changestate, makedust and changestate.
Required triggers, animelem, animelemtime, animtime and Vel.
When Terry reaches the sliding kick frame, set him travelling forwards. After a few ticks he should begin to slow down. To do this but prevent him going backwards we're going to change the way we trigger the veladd.
Lets say you've made the sliding kick frame (frame 3) 20 ticks in length. Thats quite a bit but will do for the example. You don't want him to start slowing down as soon as he starts and you don't want him to continue slowing down (ie going backwards) once he should have stopped.
To achieve this we're going to use 3 triggers
trigger1 = animelemtime(3) >= 10
trigger1 = animelemtime(4) < 0
trigger1 = vel X> 0
As you can see this time they all use trigger1. That means all the triggers must be true for this particular peice of code to be in effect.
Velset his X velocity to 0 when you reach frame 4.
Makedust will just be for fun. You'll be using the velocity trigger this time as well as a parameter every sctrl can use which is persistent.
Makedust looks like this
type = makedust
trigger1 =
pos = x,y
Also add the line persistent = 4, that will cause 1 dustpuff to occur every 4 ticks. Tweak your pos setting to make the dust show up in the correct place. Use Vel X> 0 to trigger the dust. Don't want it happening while he's not moving right?
Set him to changestate out when the animation is finished.
Set up his heavy kick state in the .CNS as you would any other basic attack. It has no special features whatsoever. Uses a hitdef and a changestate.
The CMD however shall be where the magic happens.
Set yourself up a changestate (put it near the last one, above would be best)
In this changestate you will be using the triggers animelemtime, stateno and you will be checking that ctrl = 0 rather than 1. You will also be reusing the command you used for the initial sliding kick.
Stateno will be the value of the sliding kick state.
Using my previous example with a time of 20 for the sliding kick.
animelemtime(3) > 15
animelemtime(5) < 0
Check ctrl = 0
What have we learned
Well hopefully
We've learned that the underlying code for 2 very different attacks can be similar and almost interchangeable once we modify some values.
We've learned about using multiple conditions to activate an effect.
We've learned about the makedust sctrl
We've discovered the use of the Vel trigger.
We've learned how to make a multi stage attack.
That should do for the moment. We'll add some more stuff in when it comes to power dunk and crack shoot. They're pretty similar to rising tackle and burning knuckle but we can add a couple of things that make them a bit smoother and nicer to deal with as they have actual landing animations specific to them.
-
Power Dunk
Row 5, everything.
Move details. Terry leaps up and just as he reaches the peak throws a punch and drops to the floor.
Animation setup. Frame 6 should never time out (-1) The final 3 sprites should be their own animation.
Changestate. Same as normal. Standing attack you need ctrl set.
CNS: Type and physics are S, movetype = A, ctrl and velset are both zeroed.
Required sctrls. velset, statetypeset, posset, gravity, changeanim, changestate, hitdef, playsnd.
Required triggers: Pos, time, animtime and anim.
This one will contain some new stuff for you. You don't always need a new state for everything and it's kind of annoying to set up a new state just so something can land on the ground, especially if it's going to blow up right afterwards. Terry won't do that but as an analogy goes it will do.
As per our previous attacks. Use statetypeset to put your type to A and your physics to N while you aren't on the ground (pos Y!= 0)
You will however need another one that sets both statetype and physics to S while pos Y= 0 however. Do both in 2 seperate controllers.
Your velset should trigger very fast, only a couple of ticks in. Make it go a nice hieght like your jump. -8 or -9 for the Y vel should work.
Use gravity while pos Y!= 0.
Use both velset and posset when pos Y>= 0 and while statetype = A
For the velset you want both X and Y set to 0.
Posset is a new controller for us. X is taken from the center of the screen. -160 is the left edge and 160 is the right edge. For Y 0 is classed as floor level.
Posset looks like this
type = posset
trigger1 = movecontact
x = -50
y = -90
Once more like velset you do not need to use both parameters if you don't want to. You can just use X if you so require.
Set your Y pos to 0.
Now for the changeanim.
Changeanim will change your animation. Change your animation to the second one you set up, those last 3 frames. You will be triggering it to change when pos Y= 0 and when animelemtime(6) > 0.
The last bit is your changestate. You will changestate when animtime = 0 however you need to set up an extra trigger this time so he'll change state when the second animation finishes rather than any reliance on the first.
trigger1 = animtime = 0
trigger1 = anim = second animation.
Crack shoot
Row 8, sprites 1-7
Move details, this is basically the same as power dunk, it just doesn't go so high and the leg can hit basically throughout the move.
Animation. Last sprite is it's own animation.
This is essentially the same as above, change your velocities and use the posset in the same place. You'll get a working move out of it. Yes i'm being lazy but i'd do the same thing in mewgen. Lets move onto the throw, cos it's more difficult and more interesting in it's own annoying way.
What have we learned?
We've learned about posset
We've learned about gravity
we've learned about changeanim
We've also learned about pos and anim as triggers.
-
Throws
This will possibly take you out of your comfort zone a little. Involves custom states. You can do a LOT with custom states but you have to be prepared for a little more effort.
Row 6, sprites 8-12
Move details. As far as throws go, terry's is actually pretty simple, he just grabs them and punches them away.
You will need 3 states for this. Throws are normally within the 800 states. I suggest 800 for the start of it. 801 for the actual move and 802 will be the opponents state.
You will also need 3 animations. The first one (800) should just be a single sprite, it will be the first sprite in the throw animation. It just has a red hitbox and a blue one. Make it about 2 ticks long.
The second part of the animation will be terry hitting p2 and knocking him away.
The final animation will actually be player 2. For this we have to use a couple of required sprites. In this case, 5000,0 and 5000,10. Set the 5000,10 frame to never time out.
Required sctrls, changestate, selfstate, changeanim2, hitdef, targetlifeadd and targetvelset
Required triggers. Animtime, gethitvar(isbound), time, p2bodydist X, p2dist Y
In the CMD, set this changestate above your basics but below your specials. The command will be using 1 button + "holdfwd"
You need to check that player 2 is right in front of you and not jumping or anything because your throw can't be blocked and throwing a jumping opponent with a standing throw isn't very nice.
You'll be statetype = S and ctrl = 1 here as well.
To check how close p2 is you should use something like
trigger1 = p2bodydist X< 100
trigger1 = p2dist Y= 0 (this will make sure he's on the ground)
100 is probably a little much, you want him to actually get hit before you do it, trying to do it when noone is there is a bit annoying. (for you)
Onto the .cns.
State 800
This is a pretty simple state. Changestate when animtime = 0.
Your hitdef will be the wierd bit. Add the following lines to it
priority = 0,miss (this is neccessary, wierd behaviour otherwise)
p1stateno = 801
p2stateno = 802
State 801
First step, until you punch you must use targetbind. Do this with a time trigger. Targetbind looks like this
type = targetbind
trigger1 = time = 0
time = 40
pos = 10,0
That will bind player 2 10 pixels in front of you for 40 ticks.
Lets run with that and assume that terry's punch occurs 40 ticks in, thats frame 4 of his throw.
So at time = 40 we want to apply 2 different sctrls. Type = targetlifeadd and type = targetvelset.
Targetlifeadd looks like this
type = targetlifeadd
trigger1 = time = 40
value = -80
Targetvelset will be what allows us to send p2 flying without using a hitdef. Having him with blue boxes would allow an opponent to hit him in simul, which is stupid.
type = targetvelset
trigger1 = time = 41
x = -10
y = -5
changestate out when animtime = 0
Last state 802
important bits and pieces. Make sure type and physics are S, movetype should be H (getHit). Velset and ctrl should both be 0.
First we have him use the animation we defined specially for him. To do this we use changeanim2, changeanim2 gives your opponent access to animations in your air file when he's in a custom state.
type = changeanim2
trigger1 = time = 0
value = 802 (or at least i hope you labeled it this)
Now we need to let player 2 OUT of this state. If we were to use changestate it would lock off any and all of his moves. We'd like those to continue working so we use selfstate instead. Heres how we'll set that up.
type = selfstate
trigger1 = gethitvar(isbound) = 0
value = 5050
ctrl = 1
I should probably explain gethitvar. It detects parts of what p1 is doing in an attack. In this case it's detecting whether targetbind is in use or not. If it's found to be not, player 2 will drop into state 5050 which is the falling animation. If you remember we're gonna punch him backwards as well so it'll be good if he goes to 5050 in that situation too.
So we've covered both our bases. If for any reason, terry gets hit he'll drop player 2 who will fall over. If he's allowed to finish player2 will go flying with the right animation.
Ow my fingers.
What have we learned
We've learned about 1 method of putting p2 into a custom state.
We've learned how to go to a specific state when a hitdef connects (hey, it doesn't HAVE to be a throw)
We've learned how to control what the target does (these work without the custom state too)
We've learned how to maneuver p2 when he's in a custom state. Any triggers that work for you will work for player 2. As will any sctrls. Just don't use varset. It's REALLY bad to overwrite another players variables.
We've learned about gethitvar(there's a LOT more about this)
We've learned about the p2bodydist and p2dist triggers. These both work with X and Y.
-
Ok time for some supers.
Power Geyser
Row 9, sprites 1-5
Effect, Row 9 sprites 6-11
Animation suggestions. The flare effect is going to be an animation by itself.
Move details. Terry punches the ground and a large flare fires up and dissipates.
Required sctrls: Helper, hitdef, changestate, superpause, destroyself.
Required triggers: animtime, power, time.
For the CMD, set up the command as you normally would. As this will be a slightly more complex command than your special moves this attack should be placed ABOVE the special changestates in your cmd.
Set it all up the way you normally would except for the fact this move will need power to use. Therefore we'll also add
trigger1 = power >= 1000
This means you'll need at least 1 powerbar to pull the move off.
In the CNS create 2 states. 1 for terry and one for his helper. 3000 for terry and 3001 for the helper will do nicely.
Terry's state. Terry has no hitdef. type and physics should be S, Movetype should be A, velset and ctrl as usual will be 0.
We also want the move to use power and do a neat effect and stuff like that. So we'll use superpause
type = superpause
trigger1 = appropriate trigger
pos = X,Y
darken =
time =
anim = 30
poweradd =
Ok lets explain these, pos is where the effect will show up. Darken causes the BG to go a kinda transparent black. Time is how long the pause will last. Anim = 30 is just a default setting, it'll play anim 30 from the fightfx. We'll stick with that for the moment. Poweradd causes terry to lose the power he needed to do this move. He needed 1000 so how must should we minus to remove that?
Have him changestate when animtime = 0 back to his stand.
However we have to add a helper to let him actually pull this move off. Heres a stripped down helper creation sctrl.
type = helper
trigger1 = appropriate trigger
helpertype = normal
pos = X,Y
stateno =
ID =
name = "helper"
ownpal = 1
keyctrl = 0
Helpertype should ALWAYS be normal. The other option is player. Don't use it. pos should be self explanatory by now. Stateno is the state the helpers going to be (3001 remember), ID is an identifier for the helper. We don't need to make use of it but fill it in anyway, it's good practice.
Name is really only useful if you have lots of similar helpers on the screen and wish to identify which one has stupid behaviour. Otherwise all you get is "names helper"etc.
Ownpal = 1 will prevent palFX on the player showing up on the helper. Keyctrl = 0 denies them access to the CMD states (always a good thing)
Move onto the helpers state (3001)
Basically this is a normal attack. Tell it to use the right animation and set everything else up in the same way you would a basic. The biggest difference is rather than using a changestate at the end we want to get rid of the helper. To do that we use type = destroyself. Trigger with animtime = 0. You don't need anything else. That should finish this one off.
Bleh sheet is actually missing the sprites for high angle geyser. We'll vary the power geyser instead
Power Geyser MkII
Row 9, all.
Move details, Terry will punch the ground 3 times. Each punch will do a seperate energy flare slightly further away.
Terry's punches will be 1 animation. We still only need 2 states for this (yes i'm being a smartass)
You don't need an animation for the flare setup we can use the previous one.
States 3010 and 3011
Set these 2 states up EXACTLY the same as before. Although you may wish to cut down on the damage in the helper state as there's going to be 3 of them.
Now the clever bit lies in how we get the helper showing up.
Terry will be punching the ground at frame 5, frame 9 and frame 14. We're going to use those numbers to change where the helper shows up.
Set up 3 triggers
trigger1 = animelem = 5
trigger2 = animelem = 9
trigger3 = animelem = 14
In your helper sctrl for the first state go to the pos line
pos = animelemno(0)*10,0
As you can see we've used a small equation. Animelemno(0) checks what animelem(frame) we're on and multiplies that number by 10. So for the first helper it will show up at 50,0 (5 x 10) the 3rd helper will show up at 140,0 (14 x 10) This allows us to create the same helper in different positions without creating 3 helper creation sctrls. It's less time consuming. You can do this with any number of things. Say you had 3 helpers and you wanted a different one to come out dependant on animation number. If you were to give them the states 6005 6009 and 6014 you could then use
stateno = 6000+animelemno(0)
It'll work in most places. You can use things other than animelemno as well. Time, or power or even Vel.
Anyway, that one was pretty easy because of how much we were able to steal from the previous move.
What have we learned?
We've learned how to make helpers.
We've learned about the destroyself sctrl.
We've learned about the superpause sctrl
We've learned about the power trigger.
We've also found out how to condense operations for something simple into an equation to make them happen in different spots.
-
thx its help me a lot
-
Thank you Cyanide. You have opened my mind :o. This is exactly what I needed. You are indeed a master !! :'(
-
beautiful ... thanks for sharing your knowledge. Tutorials like this are hard to find