This thread is to help get the newest user up and editing as fast as possible. It's a collection of the major catch-all threads that break down the major parts of the character. (or it will be eventually)
THIS IS A FIRST STEP. Everything isnt included. There's a lot of stuff left out.
Check out the links if you have questions about each topic.
This thread explains what files Mugen, and the Characters use. (http://mugenguild.com/forum/topics/contents-and-files-168950.0.html) Check it out if you dont know what any of the files do.
You'll need the character.def file listed in your Select.def for mugen to even show your character. It links to the cmd file that allows you to change the character's states inside the cns file, that calls on the air file to show the sprites (images) of the character. the cns also calls on the snd file to play sounds. the Def file decides who your character is. The CNS tells mugen how that character acts (http://mugenguild.com/forum/topics/states-169342.0.html). The CMD finds out when the character can perform moves.
The start of your character's lists the Player's Variables (http://mugenguild.com/forum/topics/player-variables-169341.0.html) at the top of the .cns file, lays down most of your character's traits. Just the basics.
A specific action is usually broken into these groups
the StateDef (http://mugenguild.com/forum/topics/details-statedef-and-special-state-numbers-cns-169454.msg2168758.html#msg2168758); starts the specific move
it plays a sound (http://mugenguild.com/forum/topics/playsnd-sctrls-169020.0.html); because the character feels hollow if it doesnt
displays an effect (http://mugenguild.com/forum/topics/explode-sctrls-169499.0.html); because fighters kick up dust and use magic left and right
hits player 2 (http://mugenguild.com/forum/topics/hitdef-sctrls-169450.0.html); because it's a fighting game!
and changes states (http://mugenguild.com/forum/topics/changestate-sctrl-169312.0.html);ends the move
The statedefs can do a heck of a lot more. These options are called controllers (http://mugenguild.com/forum/msg.2159570)
Like if you wanted to make a projectile (http://mugenguild.com/forum/topics/projectile-sctrl-169755.0.html), or a move that makes other moves (http://mugenguild.com/forum/topics/helper-sctrl-169754.0.html) (a helper). All the controllers go under the statedef, and above the changestate. You dont have to have a changestate to end it, but most states do.
Deciding how to get each of those controllers up and running exactly the way you want, when you want, and why you want is the job of the triggers (http://mugenguild.com/forum/msg.2159554) and variables. (and a bunch of other stuff)
Defining the triggers usually relies on math symbols (http://mugenguild.com/forum/topics/arithmetic-operators-cns-159985.0.html). But the most basic is just the equal sign. Another important step in editing your characters is learning how to tell mugen, if this doesnt work, do something else (http://mugenguild.com/forum/topics/ifelsemath-condmath-triggers-169131.0.html). << Ifelse() and Cond() (http://mugenguild.com/forum/topics/ifelsemath-condmath-triggers-169131.0.html) are as important to learn as Variables. Variables remember stuff between statedefs (http://mugenguild.com/forum/topics/var-and-fvar-triggers-169438.0.html). If you set them up they can even remember between rounds. (Check the Player's Variables link)
In the CNS file there are two special statedefs, Statedef -2, and Statedef -3 (http://mugenguild.com/forum/topics/statedef-2-and-statedef-3-174684.0.html).
Statedef -1 IS/is in the CMD file.
Mugen constantly monitors these Statedefs without the character having to be in them.
States that are always executed (use statedef -2)
States that are executed when in self's state file (use statedef -3)
Electbyte's example,
[Statedef -3]
;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0
Would work best in Statedef -3 because if P2 throws you and uses stateno 106 the sound would play. Obviously this is something the other creator wouldnt want to happen.
DO NOT FORGET YOUR [Statedef -2] and [Statedef -3]
Be sure these are located before all -2 and -3 state coding.
The CMD controls the controls. The input from the keyboard/controller is matched up to commands in the Command Definitions, then the State Entry kicks in. Command Definitions section has [Remap], [Defaults], and [Command]. There can be a maximum of 128 Command names.
The State Entry, Statedef -1, part is usually where you see all of the ChangeStates and AI code.
Commands can also be read as triggers (http://mugenguild.com/forum/topics/command-triggers-169067.0.html) which allows you to sneak in statedef -1 style changestates inside the CNS file. The name has to be inside the CMD file for it to work though.
If youre having trouble making the commands work, there's a common mess up.
As I mentioned, mugen is constantly searching statedef -1. It's also looking at button inputs to match against the command definitions. Because people arent super precise pressing buttons, Mugen gives us some leeway. While you may think you pressed F,D,DF, A, in reality you may have pressed, F,DF,D,DF,F, A. If you notice the first set of inputs is hidden inside the second set. Mugen lets that activate the command which will go down the line to the changestate. If both sets are actually a named command, both will be triggered in the order their listed.
Meaning if F,D,DF, A is above F,DF,D,DF,F, A. Mugen checks it first to see if any ChangeStates with that name can be activated. If not, Mugen will check if any Changestates F,DF,D,DF,F, A. can activate.
The way to make sure you can do all of your moves properly is to make sure the most complex input commands are at the top Going a step further you'd need to make sure your most complex ChangeStates are at the top of the State Entry section. This isnt always the case but it's important and just good practice.
This thread is a mess right now. I plan on editing this a lot. For now, I think I'll lock the topic until it's a little better.
If you feel I should refine or talk about anything and it's still locked, shoot me a PM and I'll add it.