<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 1st April 2002 (no joke)), see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=windows-1252">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 9">
<meta name="Originator" content="Microsoft Word 9">
<link rel="File-List" href="./cns_files/filelist.xml">
<title>The CNS format</title>

<style type="text/css">
<!--
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0pt;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
 /* Page Definitions */
@page
        {mso-page-border-surround-header:no;
        mso-page-border-surround-footer:no;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style>
<style type="text/css">
 body.c8 {tab-interval:36.0pt;text-justify-trim:punctuation}
 span.c7 {font-size:10.0pt;font-family: "Courier New";color:black}
 p.c6 {margin-left:36.0pt;mso-pagination:none;mso-layout-grid-align: none;text-autospace:none}
 p.c5 {margin-left:18.0pt;mso-pagination:none;mso-layout-grid-align: none;text-autospace:none}
 span.c4 {mso-spacerun: yes}
 span.c3 {font-size:10.0pt;font-family:"Courier New"}
 p.c2 {mso-pagination:none;mso-layout-grid-align:none; text-autospace:none}
 span.c1 {font-size:10.0pt;font-family:"Courier New"; color:black}
</style>
</head>
<body lang="EN-US" class='c8'>
<div class="Section1">
<p class="MsoNormal c2"><span class='c1'>The CNS format</span></p>

<p class="MsoNormal c2"><span class='c1'>==============</span></p>

<p class="MsoNormal c2"><span class='c1'>M.U.G.E.N, (c) Elecbyte
2002</span></p>

<p class="MsoNormal c2"><span class='c1'>Documentation for version
2002.04.14</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>Beta-release documentation
(incomplete)</span></p>

<p class="MsoNormal c2"><span class='c1'>Updated 8 January
2002</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>0. Contents</span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>Section I.<span class=
"c4">&nbsp;&nbsp;&nbsp;</span> Introduction</span></p>

<p class="MsoNormal c2"><span class='c1'>Section II.<span class=
"c4">&nbsp;&nbsp;</span> Player Variables</span></p>

<p class="MsoNormal c2"><span class='c1'>Section III.<span class=
"c4">&nbsp;</span> States</span></p>

<p class="MsoNormal c2"><span class='c1'>Section IV.<span class=
"c4">&nbsp;&nbsp;</span> Expressions</span></p>

<p class="MsoNormal c2"><span class='c1'>Appendix A.<span class=
"c4">&nbsp;&nbsp;</span> Special State Numbers</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>I. Introduction</span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The CNS file of a player
serves two purposes:</span></p>

<p class="MsoNormal c2"><span class='c1'>i. It defines the
variables of that player, such as walking speed, drawing scale
factor, and so on.</span></p>

<p class="MsoNormal c2"><span class='c1'>ii. It contains the states
of the player, which describe all the moves that the player can do.
States are the building blocks that you can use to create simple as
well as complicated moves.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Like many other character
files, the CNS is a text file that you can edit with any text
editor.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>In the CNS file, a
semicolon (;) is considered a "comment" character. Any text on the
same line after the semicolon will be ignored by the program. The
CNS is mostly case-insensitive, i.e. "MyName" is treated the same
as "myname" and "mYnAMe". The only exception is the "command"
trigger, but you do not need to worry about this for
now.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Some
terminology</span></p>

<p class="MsoNormal c2"><span class=
'c1'>----------------</span></p>

<p class="MsoNormal c2"><span class='c1'>When we say "group", we
mean any block of lines of text beginning with something that looks
like [groupname], and ending before the next group. For example,
the group "Blah" consists of the first three lines in the
following:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Blah]</span></p>

<p class="MsoNormal c5"><span class='c1'>line1</span></p>

<p class="MsoNormal c5"><span class='c1'>line2</span></p>

<p class="MsoNormal c5"><span class='c1'>[Group 2]</span></p>

<p class="MsoNormal c5"><span class='c1'>more lines</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Within a group, the
parameters can appear in any order. So,</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[SomeGroup]</span></p>

<p class="MsoNormal c5"><span class='c1'>value1 = 1234</span></p>

<p class="MsoNormal c5"><span class='c1'>value2 = "A
string"</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>is equivalent
to:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[SomeGroup]</span></p>

<p class="MsoNormal c5"><span class='c1'>value2 = "A
string"</span></p>

<p class="MsoNormal c5"><span class='c1'>value1 = 1234</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>II. Player
Variables</span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>No full documentation yet.
See chars/kfm/kfm.cns for comments on each variable.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Some importants one to
note:</span></p>

<p class="MsoNormal c2"><span class='c1'>- In [Size], you can use
"xscale" and "yscale" to change the width and height of your
character. This saves the trouble of scaling every single one of
the sprites.</span></p>

<p class="MsoNormal c2"><span class='c1'>- Set up the speeds of the
player in [Velocity]</span></p>

<p class="MsoNormal c2"><span class='c1'>- Set the player's
downward acceleration -- "yaccel" in [Movement]</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>III. States</span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>a. Overview of Finite
State Machines in MUGEN</span></p>

<p class="MsoNormal c2"><span class='c1'>b. Introduction to
States</span></p>

<p class="MsoNormal c2"><span class='c1'>c. Basic Parts of a
State</span></p>

<p class="MsoNormal c2"><span class='c1'>d. Details on
StateDef</span></p>

<p class="MsoNormal c2"><span class='c1'>e. Details on State
Controllers</span></p>

<p class="MsoNormal c2"><span class='c1'>f. Common states
(common1.cns)</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>-------------------------------------------------</span></p>

<p class="MsoNormal c2"><span class='c1'>III.a. Overview of Finite
State Machines in MUGEN</span></p>

<p class="MsoNormal c2"><span class=
'c1'>-------------------------------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>This section presents a
working (heuristic) characterization of finite state machines, as
found in MUGEN. It is not especially technical, but it is aimed at
the analytically minded reader. Feel free to skip over this section
if you are already familiar with finite state machines, or if you
are not interested in the details.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>A finite state machine
(henceforth abbreviated FSM) is an automaton with a finite set of
subroutines, each of which performs some function and then employs
some criterion to choose the next subroutine to jump to. Each
subroutine is called a "state", and the FSM is said to be in a
given state when it is currently processing the directives in that
state. A FSM can only be in one state at any given time.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>The following is a trivial
example of a FSM, given in pseudocode.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>State 0:</span></p>

<p class="MsoNormal c2"><span class='c3'>1. Read in a
number.</span></p>

<p class="MsoNormal c2"><span class='c3'>2. If the number is 0, go
to state 0. Else, go to state 1.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>State 1:</span></p>

<p class="MsoNormal c2"><span class='c3'>1. Print
"Woohoo!"</span></p>

<p class="MsoNormal c2"><span class='c3'>2. Go to state
3.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>State 2:</span></p>

<p class="MsoNormal c2"><span class='c3'>1. Go to state
0.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>State 3:</span></p>

<p class="MsoNormal c2"><span class='c3'>1. Quit</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>Suppose this FSM starts in
state 0 and reads in the value 0. Then it will return to the
beginning of state 0, and read another number. This will continue
until the FSM reads a nonzero number, at which point it will switch
to state 1. In state 1, the FSM prints "Woohoo!" and then switches
to state 3. State 3 causes the FSM to quit. State 2 is never
reached in this example.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>Here's a state out of an
FSM which might be used for a fighting game character.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>State 555:</span></p>

<p class="MsoNormal c2"><span class='c3'>1. Try to punch the other
guy.</span></p>

<p class="MsoNormal c2"><span class='c3'>2. If successful, and the
user is holding punch, go to state 555 (chain<span class=
"c4">&nbsp;</span></span></p>

<p class="MsoNormal c2"><span class='c3'><span class=
"c4">&nbsp;&nbsp;</span> move).</span></p>

<p class="MsoNormal c2"><span class='c3'>3. If successful and the
user is not holding punch, play recovery</span></p>

<p class="MsoNormal c2"><span class='c3'><span class=
"c4">&nbsp;&nbsp;</span> animation.</span></p>

<p class="MsoNormal c2"><span class='c3'>4. If not successful, play
miss animation.</span></p>

<p class="MsoNormal c2"><span class='c3'>5. When the recovery or
miss animation ends, go to state 0 (idle).</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>Characters in MUGEN are
finite state machines. The character's CNS file defines a number of
states, each of which contains one or more state controllers. State
controllers are what actually give the character its functionality,
similarly to the instructions for our character's FSM given above.
For instance, the controller HitDef allows the character to hit his
opponent, the ChangeState controller allows the character to make a
state transition, and the ChangeAnim controller allows<span class=
"c4">&nbsp;</span> the character to play a specified animation.
Each state controller is specified along with one or more test
conditions, called "triggers" or "condition-type triggers," which
must be satisfied in order for that controller to be
executed.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>Each MUGEN character has
three special states, numbered -1, -2, and -3. These are the only
allowable states with negative numbers. State -1 generally contains
state controllers that determine state transition rules based on
user input (commands). State -2 contains other state controllers
that need to be checked every tick. State -3 contains state
controllers which are checked every tick unless the player is
temporarily using another player's state data (for instance, when
the player is being thrown).</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>For each tick of
game-time, MUGEN makes a single pass through each of the special
states, from top to bottom, in order of increasing state number
(-3, -2, then -1). For each state controller encountered, its
condition-type triggers are evaluated and, if they are satisfied,
the controller is executed. Then processing proceeds to the next
state controller in the state. A state transition (ChangeState) in
any of the special states will update the player's current state
number, but will not abort processing of the special states. After
all the state controllers in the special states have been checked,
the player's current state is processed, again from top to bottom.
If a state transition is made out of the current state, the rest of
the state controllers (if any) in the current state are skipped,
and processing continues from the beginning of the new state. When
the end of the current state is reached and no state transition is
made, processing halts for this tick.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>There is one exception to
the above scenario. If the character is a "helper" character, i.e.,
spawned by the Helper state controller, that character will not
have the special states -3 and -2. The helper character will not
have the special state -1 either, unless it has keyboard input
enabled. (This is controlled by the Helper state controller when
the character is created.)</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c3'>Note for the technically
minded: A character's state machine might be considered an "impure"
FSM, since there are a number of implicit state transition rules
which are not user-specified. For instance, hitting the character
causes a state transition which is not explicitly coded into the
character's CNS. Furthermore, a single CNS state is usually much
more complex than a state in a typical FSM as considered in
mathematics or computer science. In any case, you will not find the
rigorous definition of an FSM especially applicable to working with
MUGEN.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>-----------------------------</span></p>

<p class="MsoNormal c2"><span class='c1'>III.b. Introduction to
States</span></p>

<p class="MsoNormal c2"><span class=
'c1'>-----------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Programming states is the
hardest part of creating a character. It entails a lot of work,
testing, and sometimes trial-and-error. In this section, we'll
often refer the player being programmed, and to his opponent as
well. Let us call the player whose states we are editing P1, and
his opponent P2.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Do not be discouraged if
you do not understand a lot of this document on your first reading.
The best way to learn about states is to first play around with
values in the CNS of a completed character, and see what effects
they have on him or her. There's nothing to fear from "tweaking"
the CNS; M.U.G.E.N is designed to detect syntax errors and report
them.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Included with the
M.U.G.E.N distribution package is a character named Kung Fu Man
(KFM for short.) You can find him in the directory
chars/kfm.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The CMD file contains
declarations of command names and the definition of State -1, a
special state which is used to control how the character responds
to user input. See the CMD document for more
information.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Here are some concepts
that will be useful for you to know:</span></p>

<p class="MsoNormal c2"><span class='c1'>1. Life and
power</span></p>

<p class="MsoNormal c2"><span class='c1'>2. Control</span></p>

<p class="MsoNormal c2"><span class='c1'>3. Game-time and
state-time</span></p>

<p class="MsoNormal c2"><span class='c1'>4. Position, velocity and
acceleration</span></p>

<p class="MsoNormal c2"><span class='c1'>5. Juggling</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>1. Life and
power</span></p>

<p class="MsoNormal c5"><span class='c1'>A player's life bar is the
yellow bar at the top of the screen on his side of the screen. When
the life bar reaches zero, the player is knocked out. His power bar
is the blue bar, and that increases with each attack he gives or
takes. When the power bar reaches certain values, he can do super
moves.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>2. Control</span></p>

<p class="MsoNormal c5"><span class='c1'>When we say a player "has
control", we mean that he is ready to walk or jump or attack. A
player who does not have control will not respond to your input
(from keyboard or joystick). For example, when P1 is in his stand
state, he has control, and will walk forward if you press the
forward button. A player will typically not have control when he is
in an attack state, otherwise you could just walk away halfway
through a punch.</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>There is an exception to
the rule, however. Sometims you can let the player respond to
certain moves even if he has no control. That is called a "move
interrupt", or a "move cancel". See the CMD documentation for
details.</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>We will frequently refer
to a player's "control flag". A "flag" is a value that is either
true, or false. If we say the player's control flag is true, then
it means he has control.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>3. Game-time and
state-time</span></p>

<p class="MsoNormal c5"><span class='c1'>M.U.G.E.N keeps track of
the time that has passed in the game. Every time the game is
updated (this includes updating the players, checking collisions,
and drawing to the screen), we say game-time has increased by
one.</span></p>

<p class="MsoNormal c5"><span class='c1'>The time a player has
spent in a state is known as the "state-time". The state-time
starts at 0 at the beginning of a state, and increases by one tick
for every tick of game-time.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>4. Position, velocity and
acceleration</span></p>

<p class="MsoNormal c5"><span class='c1'>Those of you with basic
knowledge of math should understand these concepts. M.U.G.E.N uses
the following coordinate system.</span></p>

<p class="MsoNormal c5"><span class='c1'>The greater the
X-position, the farther right the player is. The less the
X-position, the closer he is to the left.</span></p>

<p class="MsoNormal c5"><span class='c1'>A Y-position of zero is at
ground level. As the player's Y-position gets larger he moves
downwards. For example, a negative Y-position means he is in the
air.</span></p>

<p class="MsoNormal c5"><span class='c1'>Similarly, when we say a
player has positive X-velocity, it means he is moving forward, and
if he as negative X-velocity, he is moving backwards. A player with
positive Y-velocity is moving downward, and a negative Y-velocity
means he is moving up.</span></p>

<p class="MsoNormal c5"><span class='c1'>A positive X-acceleration
means the player's X-velocity is increasing, a negative
X-acceleration means his X-velocity is decreasing. Likewise for
Y-acceleration.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>5. Juggling</span></p>

<p class="MsoNormal c5"><span class='c1'>M.U.G.E.N allows for
certain moves to "juggle", that is, to hit opponents who have been
knocked into the air, or are lying down on the ground. The juggling
system works this way: each person starts with a set number of
juggle "points" on the first hit that makes them fall, typically
15.</span></p>

<p class="MsoNormal c5"><span class='c1'>Some quick terminology:
when we say a player is "falling", then we mean he does not recover
control in the air, and will fall onto the ground.</span></p>

<p class="MsoNormal c5"><span class='c1'>If a player is hit while
he is in the falling in the air or lying down on the ground, then
his juggle points will decrease by an amount depending on the
attack. When an attack requires more juggle points than the
opponent has left, then the attack will miss. Any move that causes
the opponent to fall immediately subtracts its juggle points on the
first hit.</span></p>

<p class="MsoNormal c5"><span class='c1'>For example, an attack
that requires 7 juggle points could theoretically be used to juggle
the opponent twice (assuming you started with 15 points), leaving
the opponent with 1 point left. Subsequent such attacks will
miss.</span></p>

<p class="MsoNormal c5"><span class='c1'>The reason for this juggle
system is to prevent infinite combos in the air.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>-----------------------------</span></p>

<p class="MsoNormal c2"><span class='c1'>III.c. Basic Parts of a
State</span></p>

<p class="MsoNormal c2"><span class=
'c1'>-----------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Note: This section assumes
you have at least browsed the documentation of AIR files, and
understand the concepts of animation, as know the meaning of key
words and phrases such as action and element of an
action.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Here is a short example
state for P1:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Statedef 200]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = S</span></p>

<p class="MsoNormal c5"><span class='c1'>physics = S</span></p>

<p class="MsoNormal c5"><span class='c1'>movetype = I</span></p>

<p class="MsoNormal c5"><span class='c1'>ctrl = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>anim = 200</span></p>

<p class="MsoNormal c5"><span class='c1'>velset = 0</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type =
ChangeState</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = AnimTime =
0</span></p>

<p class="MsoNormal c5"><span class='c1'>value = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>ctrl = 1</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>This state plays back the
Action 200 of P1's animation, and returns P1 to his standing state
after the animation has ended. In this case, assume Action 200 has
a finite looptime. That is, Action 200 does not have any elements
with time equal to -1.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>At this point, you do not
need to worry about the details. Let us begin by knowing what a
state consists of.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>All states must have a
single Statedef section and one or more State sections.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Statedef contains the
starting information of a state, such as what kind of state it is
(standing, crouching, in the air) and what kind of move he is doing
(attacking, idling.)</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Each State section is
referred to as a state controller, or a controller for short.
Controllers tell the program what to do to P1, and when to do it.
There are many kinds of controllers, each with its own function.
For example, there are controllers to change the players position
or velocity, define the effects of attacks, create projectiles,
switch between animation Actions, change states, and so on. Each
controller must have at least one trigger. A trigger is an event
that causes the controller to be activated. Examples are: trigger
at the start of the state, trigger at the end of the animation (as
seen in the example State above), trigger on an element of an
animation Action, trigger when P2 is within a certain range of P1,
and so on.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>--------------------------</span></p>

<p class="MsoNormal c2"><span class='c1'>III.d. Details on
StateDef</span></p>

<p class="MsoNormal c2"><span class=
'c1'>--------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Every state must begin
with exactly one StateDef group, also known as a Statedef section.
A StateDef group must look like this (put in one or more parameters
where the dots are):</span></p>

<p class="MsoNormal c5"><span class='c1'>[Statedef
<i>state_number</i>]</span></p>

<p class="MsoNormal c5"><span class='c1'>.
<i>state_parameters</i></span></p>

<p class="MsoNormal c5"><span class='c1'>.</span></p>

<p class="MsoNormal c5"><span class='c1'>.</span></p>

<p class="MsoNormal c2"><span class='c1'>Replace
<i>state_number</i> with the number of the state you are
programming. With the exception of the special group numbers (see
Appendix A) you are allowed to use any state number you choose. To
avoid choosing a special group number, do not choose numbers from
0-199, and from 5000-5999.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The lines that follow
should include the following parameters:</span></p>

<p class="MsoNormal c2"><span class='c1'>1. type</span></p>

<p class="MsoNormal c2"><span class='c1'>2. movetype</span></p>

<p class="MsoNormal c2"><span class='c1'>3. physics</span></p>

<p class="MsoNormal c2"><span class='c1'>4. anim</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>1. type</span></p>

<p class="MsoNormal c5"><span class='c1'>This is the state type of
P1 in that state. It defines if he is standing, crouching, in the
air, or lying down. The corresponding values are "S", "C" , "A" and
"L" respectively (without the quotation marks). To leave the type
unchanged from the previous state, use a value of "U". If this line
is omitted, it assumes the type is "S". You will most commonly use
"S", "C" and "A". For example, a crouching state type would require
the line:</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>type = C</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>The type is used to
determine several factors, most importantly, how P1 will react to
being hit. For example, being in a "stand"-type state, P1 will
react as if he is standing on the ground. If the type was "air",
then P1 would react to the hit accordingly.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>2. movetype</span></p>

<p class="MsoNormal c5"><span class='c1'>This is the type of move
P1 is doing: "A" for attack, "I" for idle and "H" for being hit. To
leave the movetype unchanged from the previous state, use a value
of "U". The value is assumed to be "I" if this line is omitted. "A"
and "H" should be self-explanatory. "I" is used for states where P1
is neither attacking, nor being hit. For example, an attack state
should have the line:</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>movetype = A</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>You need to specify the
movetype so the program will know how to process the state.
Incorrectly specifying the movetype may cause P1 to act
incorrectly.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>3. physics</span></p>

<p class="MsoNormal c5"><span class='c1'>You need to specify what
physics to use in that state. Valid values are "S" for stand, "C"
for crouch, "A" for air, and "N" for none. To leave the physics
unchanged from the previous state, use a value of "U". If omitted,
the value of "N" is assumed. The kind of physics is used to
determine how P1 behaves.</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>For "S" physics, P1 will
experience friction with the ground. The value for the friction
coefficient is set in the Player Variables (see section
II).</span></p>

<p class="MsoNormal c5"><span class='c1'>For "C" physics, P1 will
experience friction, just like in the "S" state.</span></p>

<p class="MsoNormal c5"><span class='c1'>For "A" physics, P1 will
accelerate downwards, and if his Y-position is greater than 0 (ie.
he touches the ground) he will immediately go into his landing
state.</span></p>

<p class="MsoNormal c5"><span class='c1'>If you use "N" P1 will not
use any of these pre-programmed physics.</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>Do not confuse "physics"
with the state "type". They are usually the same, but you are given
the choice if you want more control. For instance, you may choose
to use "N" (no physics), and specify your own acceleration and
landing detection for an aerial state.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>4. anim</span></p>

<p class="MsoNormal c5"><span class='c1'>This parameter changes the
Animation Action of P1. Specify the action number as the value. If
you do not want P1 to change animation at the start of the state,
omit this parameter.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>So to have a state with
number 400, where the player is doing a crouching attack with
Action 400, the typical parameters would be:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Statedef 400]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = c</span></p>

<p class="MsoNormal c5"><span class='c1'>movetype = a</span></p>

<p class="MsoNormal c5"><span class='c1'>physics = c</span></p>

<p class="MsoNormal c5"><span class='c1'>anim = 400</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The other optional
parameters that you can use are:</span></p>

<p class="MsoNormal c2"><span class='c1'>4. velset</span></p>

<p class="MsoNormal c2"><span class='c1'>5. ctrl</span></p>

<p class="MsoNormal c2"><span class='c1'>6. poweradd</span></p>

<p class="MsoNormal c2"><span class='c1'>7. juggle</span></p>

<p class="MsoNormal c2"><span class='c1'>8. facep2</span></p>

<p class="MsoNormal c2"><span class='c1'>9.
hitdefpersist</span></p>

<p class="MsoNormal c2"><span class='c1'>10.
movehitpersist</span></p>

<p class="MsoNormal c2"><span class='c1'>11.
hitcountpersist</span></p>

<p class="MsoNormal c2"><span class='c1'>12. sprpriority</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>4. velset</span></p>

<p class="MsoNormal c5"><span class='c1'>You can use velset to set
P1's velocity at the beginning of the state. The format is a number
pair, representing the x velocity and the y velocity respectively.
Omitting this line will leave P1's velocity unchanged. For
example,</span></p>

<p class="MsoNormal c6"><span class='c1'>velset = 4,-8</span></p>

<p class="MsoNormal c5"><span class='c1'>makes P1 start moving
diagonally up and forwards.</span></p>

<p class="MsoNormal c5"><span class='c1'>There is an exception to
this. Even if you have velset = 0, attacking P2 in the corner will
push P1 away.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>5. ctrl</span></p>

<p class="MsoNormal c5"><span class='c1'>This parameter will set
P1's control. A value of "0" sets the flag to false, "1" sets it to
true. If omitted, P1's control flag is left unchanged. For example,
to give P1 control, use</span></p>

<p class="MsoNormal c6"><span class='c1'>ctrl = 1</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>6. poweradd</span></p>

<p class="MsoNormal c5"><span class='c1'>When included, the
poweradd parameter adds to the player's power bar. The value is a
number, and can be positive or negative. This parameter is
typically used in attack moves, where you want the player to gain
power just by performing the attack. For example, to add 40 power,
type</span></p>

<p class="MsoNormal c6"><span class='c1'>poweradd = 40</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>7. juggle</span></p>

<p class="MsoNormal c5"><span class='c1'>The juggle parameter is
useful only for attacks. It specifies how many points of juggling
the move requires. If omitted for an attack, that attack will
juggle if the previous attacking state successfully juggled. You
should include the juggle parameter for all attacks. If an attack
spans more than one state, include the juggle parameter only in the
first state of that attack. Juggling was explained in detail in
"Useful Concepts" in Section IIIa.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>8. facep2</span></p>

<p class="MsoNormal c5"><span class='c1'>When you include the line
"facep2 = 1", the player will be turned, if necessary, to face the
opponent at the beginning of the state. "facep2" has the default
value of "0" if omitted.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>9.
hitdefpersist</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> If set to 1, any HitDefs which are active
at the time of a state</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> transition to this state will remain
active. If set to 0, the</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> default, any such HitDefs will be disabled
when the state</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> transition is made.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>10.
movehitpersist</span></p>

<p class="MsoNormal c5"><span class='c1'>If set to 1, the move hit
information from the previous state (whether the attack hit or
missed, guarded, etc; see Move* triggers in trigger docs) will be
carried over into this state. If set to 0 (the default), this
information will be reset upon entry into this state.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>11.
hitcountpersist</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> If set to 1, the hit counter (how many
hits this attack has done)</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> will be carried over from the previous
state to this state. If set</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> to 0 (the default), the hit counter will
be reset upon state</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> transition. This parameter does not affect
the combo counter which</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> is displayed on the screen. See the
hitcount and uniqhitcount</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> trigger documentation for how to check the
hit counter.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>12. sprpriority</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> If this parameter is present, the player's
sprite layering</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> priority will be set to the value
specified. If omitted, the</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> sprite priority will be left unchanged.
common1.cns (the CNS file</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> that is inherited by every player) defines
the sprite priority of</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> standing or crouching players to be 0, and
jumping players to be 1.</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> For most attack states, you will want to
set sprpriority = 2, so</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> that the attacker appears in
front.</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> See SprPriority in the sctrls
documentation for how to change</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> sprite priority using a
controller.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>-----------------------------------</span></p>

<p class="MsoNormal c2"><span class='c1'>III.e. Details on State
Controllers</span></p>

<p class="MsoNormal c2"><span class=
'c1'>-----------------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>d.1 Controller
Format</span></p>

<p class="MsoNormal c2"><span class='c1'>d.2 Triggers</span></p>

<p class="MsoNormal c2"><span class='c1'>d.3 Commonly-used
controllers</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>III.d.1 Controller
Format</span></p>

<p class="MsoNormal c2"><span class=
'c1'>-------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>All states must have at
least one state controller, otherwise it will cause an error. State
controller groups have the following format:</span></p>

<p class="MsoNormal c5"><span class='c1'>[State
<i>state_number</i>, <i>some_number</i>]</span></p>

<p class="MsoNormal c5"><span class='c1'>type =
<i>controller_type</i></span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 =
<i>condition_exp</i></span></p>

<p class="MsoNormal c5"><span class='c1'>.<i><span class=
"c4">&nbsp;</span> universal optional parameters</i></span></p>

<p class="MsoNormal c5"><span class='c1'>.<span class=
"c4">&nbsp;</span> <i>additional parameters depending on
controller</i></span></p>

<p class="MsoNormal c5"><span class='c1'>.</span></p>

<p class="MsoNormal c5"><span class='c1'>.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The <i>state_number</i>
must be the same number of the state from the statedef.
<i>some_number</i> can be any number you choose; it is the number
that is reported when an error is found, so you know which
controller needs to be fixed.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The universal (applicable
to all state controllers) optional parameters are the
ignorehitpause and persistency parameters. If ignorehitpause is set
to 1, MUGEN will check this state controller even if the character
is paused by a hit. Otherwise, this state controller will not be
checked during a hit pause. The default is 0, which is recommended
for all but exceptional situations. For an explanation of the
persistency parameter, see the section on trigger
persistency.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The <i>controller_type</i>
is the name of the controller you are using. Each type of
controller has a different effect, and requires different
parameters. See sctrls.txt for a full list of state
controllers.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The order of the
controllers is significant. Controllers listed first are the ones
checked and, if necessary, activated first.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Here is an example of a
controller that gives P1 control at the start of the state (the
same effect as putting "ctrl = 1" as a parameter in the
StateDef):</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 300, 1] ;State 300.
1 is just an arbitrary number.</span></p>

<p class="MsoNormal c5"><span class='c1'>type = CtrlSet ;Changes
the control flag.</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time =
0</span></p>

<p class="MsoNormal c5"><span class='c1'>value = 1</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>In this example, the
CtrlSet type lets you change the control flag of P1. The line that
reads "trigger1 = Time = 0" means that this controller is activated
when the state-time is 0, ie. at the start of that state. The line
"value = 1" says that we want to set the value of the control flag
to 1, which means true. If we want to make P1 start the state with
no control, then we just need to change the last line to "value =
0".</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Let's look another
example. This controller moves P1 forwards by 10 pixels twice: on
the second and third element of his current Animation Action. Don't
worry if you don't know what parameters go with which controller
types. You can learn more about them from the state controller
documentation (sctrls).</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 300, 2]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = PosAdd ;Adds to
P1's position</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = AnimElem = 2
;Trigger on 2nd element.</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger2 = AnimElem = 3
;Trigger on 3rd element.</span></p>

<p class="MsoNormal c5"><span class='c1'>x = 10</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>As you see above, each
controller must have at least one trigger. A trigger is a condition
that causes the controller to be activated. This example has two
triggers, and the controller is activated when EITHER ONE is
true.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>III.d.2
Triggers</span></p>

<p class="MsoNormal c2"><span class=
'c1'>----------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><u><span class='c1'>i. Trigger
logic</span></u></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The first trigger should
always be "trigger1", and subsequent triggers should be "trigger2",
then "trigger3" and so on. The logic for deciding if a controller
should be activated is:</span></p>

<p class="MsoNormal c2"><span class='c1'>1. Are all conditions of
"trigger1" true? If so, then yes, activate the
controller.</span></p>

<p class="MsoNormal c2"><span class='c1'>2. Otherwise, repeat the
test for "trigger2", and so on, until no more triggers are
found.</span></p>

<p class="MsoNormal c2"><span class='c1'>This can be thought of as
"OR" logic.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Be careful; skipping
numbers will cause some triggers to be ignored. For example, if you
have triggers "trigger1", "trigger2" and "trigger4" without a
"trigger3", then "trigger4" will be ignored.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Now what if you want more
than one condition to be met before the controller is activated?
Here is an commonly-used example for testing if a player in the air
has reached the ground. The triggers used are:</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Vel Y &gt; 0 ;
True if Y-velocity is &gt; 0 (going down)</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Pos Y &gt; 0 ;
True if Y-position is &gt; 0 (below ground)</span></p>

<p class="MsoNormal c2"><span class='c1'>At this point, you may be
confused by the format of the trigger. Do not worry about it for
now. We will get to it soon.</span></p>

<p class="MsoNormal c2"><span class='c1'>As you can see above, both
the triggers have the same number. When several triggers have the
same number, it implements the "AND" logic. That is, the controller
is activated if every one of the triggers with the same number is
true, but not if one or more of them is false.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>You can combine both
ideas. For example:</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Vel Y &gt; 0 ;
True if Y-velocity is &gt; 0 (going down)</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Pos Y &gt; 0 ;
True if Y-position is &gt; 0 (below ground)</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger2 = Time = 5<span
class="c4">&nbsp;</span> ; True if state-time is 5</span></p>

<p class="MsoNormal c2"><span class='c1'>The controller for this
would be activated if the player landed on the ground (Y-velocity
and Y-Position are both &gt; 0), OR if his state time was
5.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Here is a
summary:</span></p>

<p class="MsoNormal c2"><span class='c1'>- Triggers with the same
number activate the controller only if all of them are
true.</span></p>

<p class="MsoNormal c2"><span class='c1'>- Triggers with different
numbers activate the controller if any one or more of them are
true.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The format of a trigger
is:</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger? =
<i>trigger_type</i> <i>trigger_test</i></span></p>

<p class="MsoNormal c2"><i><span class='c1'>trigger_type</span></i>
<span class='c7'>is the name of the trigger (see triggers.txt for
the full list).</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><i><span class=
'c1'>condition_exp</span></i> <span class='c7'>is an arithmetic
expression to be checked for equality to 0. If <i>condition_exp</i>
is 0, then the trigger is false. If <i>condition_exp</i> is
nonzero, then the trigger is true. The <i>condition_exp</i> is
usually a simple relational expression as in the examples above,
but can be as simple or as complicated as required.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>It is possible to use
logical operators between expressions. For instance, this is
equivalent to the previous example above.</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = ((Vel Y &gt; 0)
&amp;&amp; (Pos Y &gt; 0)) || Time = 5</span></p>

<p class="MsoNormal c2"><span class='c1'>See exp.txt for a detailed
explanation of arithmetic expressions.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>A useful shortcut you
might use is "triggerall". It determines a condition that must be
true for all triggers. For instance in:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>triggerall = Vel X =
0</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Pos Y &gt;
-2</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger2 = AnimElem =
3</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger3 = Time =
[2,9]</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>For any of trigger1 to
trigger3 to be checked, the triggerall condition must be true too.
In this case, as long as the X-velocity is not 0, then the state
controller will not be activated. You can have more than one
triggerall condition if you need. Note that at least one trigger1
must be present, even if you specify triggeralls.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><u><span class='c1'>ii. Trigger
persistency</span></u></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>In the case where you do
not want the trigger to activate every single time the condition is
true, you will need to add a "persistent" paramter. Let us begin
with an example:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 310, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = PosAdd</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Vel Y &gt;
1</span></p>

<p class="MsoNormal c5"><span class='c1'>x = 10</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>This state controller
moves P1 forwards by 10 pixels for every tick of game time where
P1's Y-velocity is greater than 1. That is, the controller is being
activated everytime the trigger condition is true. If we want the
controller to be activated only once, we will need to add a
line:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 310, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = PosAdd</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Vel Y &gt;
1</span></p>

<p class="MsoNormal c5"><span class='c1'>persistent = 0<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> ;&lt;-- Added this
line</span></p>

<p class="MsoNormal c5"><span class='c1'>x = 10</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>"Persistent" has a default
value of 1, meaning that the controller is activated everytime the
trigger is true.</span></p>

<p class="MsoNormal c2"><span class='c1'>Setting "persistent" to 0
allows the controller to be activated only once during that state.
This holds true until P1 leaves that state. If P1 returns to that
state later, the controller can be activated once again.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The "persistent" parameter
can also take values other than 0 and 1:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 310, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = PosAdd</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Vel Y &gt;
1</span></p>

<p class="MsoNormal c5"><span class='c1'>persistent = 2<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> ;&lt;-- Modified
this line</span></p>

<p class="MsoNormal c5"><span class='c1'>x = 10</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>In this case, setting
"persistent" to 2 means the controller will be activated once of
every two times the trigger is true. Setting "persistent" to 3
activates the controller every 3rd time, and so on.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><u><span class='c1'>iii. Trigger
redirection</span></u></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>One might wish to check
the statetime of the player's target, or the player's parent (if
the player is a helper), etc.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>III.d.3 Commonly-used
controllers</span></p>

<p class="MsoNormal c2"><span class=
'c1'>---------------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The "Null" controller will
be useful for debugging. A "null" controller basically does
nothing. You can use it to temporarily turn off certain
controllers, instead of commenting out the entire section. For
example, you might want to disable this:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 300, 1] ;Controller
that accelerates P1 forwards</span></p>

<p class="MsoNormal c5"><span class='c1'>type = VelAdd</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time &gt;=
0</span></p>

<p class="MsoNormal c5"><span class='c1'>x = .8</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Simply comment out the
type and put in "null":</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 300, 1] ;Controller
that accelerates P1 forwards</span></p>

<p class="MsoNormal c5"><span class='c1'>type = null
;VelAdd</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time &gt;=
0</span></p>

<p class="MsoNormal c5"><span class='c1'>x = .8</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Later, when you want to
reenable the controller, just change the type back to what it used
to be.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Now let us look back at
the example:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Statedef 200]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = S</span></p>

<p class="MsoNormal c5"><span class='c1'>physics = S</span></p>

<p class="MsoNormal c5"><span class='c1'>movetype = I</span></p>

<p class="MsoNormal c5"><span class='c1'>ctrl = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>anim = 200</span></p>

<p class="MsoNormal c5"><span class='c1'>velset = 0</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type =
ChangeState</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = AnimTime =
0</span></p>

<p class="MsoNormal c5"><span class='c1'>value = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>ctrl = 1</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>[State 200, 1] is a
"ChangeState" controller. As the name implies, it changes P1's
state number. The "value" parameter should have the number of the
state to change to. The optional "ctrl" parameter can be set P1's
control flag as he changes states.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Now let's make this an
attack state. First of all, the animation action needs attack
collision boxes. A quick review from the air documentation: Clsn1
is for attack and Clsn2 is where the player can be hit. So P1 will
hit P2 if any one of P1's Clsn1 boxes intersects with any of P2's
Clsn2 boxes.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>As an example, let's
assume the animation action in P1's AIR file looks like
this:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Begin Action
200]</span></p>

<p class="MsoNormal c5"><span class='c1'>200,0, 0,0, 3</span></p>

<p class="MsoNormal c5"><span class='c1'>200,1, 0,0, 4</span></p>

<p class="MsoNormal c5"><span class='c1'>200,2, 0,0, 4</span></p>

<p class="MsoNormal c5"><span class='c1'>200,3, 0,0, 3</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>After defining the
bounding boxes, it looks like:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Begin Action
200]</span></p>

<p class="MsoNormal c5"><span class='c1'>Clsn2: 1</span></p>

<p class="MsoNormal c5"><span class='c1'><span class=
"c4">&nbsp;</span> Clsn2[0] = -10,0, 10,-80</span></p>

<p class="MsoNormal c5"><span class='c1'>200,0, 0,0, 3</span></p>

<p class="MsoNormal c5"><span class='c1'>Clsn1: 1</span></p>

<p class="MsoNormal c5"><span class='c1'><span class=
"c4">&nbsp;</span> Clsn1[0] =<span class="c4">&nbsp;</span> 10,-70,
40,-60</span></p>

<p class="MsoNormal c5"><span class='c1'>Clsn2: 2</span></p>

<p class="MsoNormal c5"><span class='c1'><span class=
"c4">&nbsp;</span> Clsn2[0] = -10,<span class="c4">&nbsp;</span> 0,
10,-80</span></p>

<p class="MsoNormal c5"><span class='c1'><span class=
"c4">&nbsp;</span> Clsn2[1] =<span class="c4">&nbsp;</span> 10,-70,
40,-60</span></p>

<p class="MsoNormal c5"><span class='c1'>200,1, 0,0, 4</span></p>

<p class="MsoNormal c5"><span class='c1'>Clsn2Default: 1 ;Use this
box for the last two frames</span></p>

<p class="MsoNormal c5"><span class='c1'><span class=
"c4">&nbsp;</span> Clsn2[0] = -10,0, 10,-80</span></p>

<p class="MsoNormal c5"><span class='c1'>200,2, 0,0, 4</span></p>

<p class="MsoNormal c5"><span class='c1'>200,3, 0,0, 3</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>As you can see, each
element has a Clsn2 box defined for it (the last two elements are
using the same boxes). The second element is the only one with a
Clsn1 box.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Note: It is all right to
define Clsn1 boxes for any elements in an Animation Action, but if
you put a Clsn1 box in the very first element, the attack will be
instantaneous, and become unblockable. Therefore, it is recommended
that you define Clsn1 boxes only for elements after the first
one.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Now we are ready to set up
the state in the CNS. We will explain the changes below.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[Statedef 200]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = S</span></p>

<p class="MsoNormal c5"><span class='c1'>physics = S</span></p>

<p class="MsoNormal c5"><span class='c1'>movetype = A<span class=
"c4">&nbsp;</span> ;&lt;-- changed from "I" to "A"</span></p>

<p class="MsoNormal c5"><span class='c1'>ctrl = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>anim = 200</span></p>

<p class="MsoNormal c5"><span class='c1'>velset = 0</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1] ;&lt;--
Added this state controller</span></p>

<p class="MsoNormal c5"><span class='c1'>type = HitDef</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = AnimElem =
2</span></p>

<p class="MsoNormal c5"><span class='c1'>attr = S, NA</span></p>

<p class="MsoNormal c5"><span class='c1'>animtype<span class=
"c4">&nbsp;</span> = Light</span></p>

<p class="MsoNormal c5"><span class='c1'>damage<span class=
"c4">&nbsp;&nbsp;&nbsp;</span> = 10</span></p>

<p class="MsoNormal c5"><span class='c1'>guardflag = MA</span></p>

<p class="MsoNormal c5"><span class='c1'>pausetime =
12,12</span></p>

<p class="MsoNormal c5"><span class='c1'>sparkxy = 0,-55</span></p>

<p class="MsoNormal c5"><span class='c1'>hitsound<span class=
"c4">&nbsp;&nbsp;</span> = 5,0</span></p>

<p class="MsoNormal c5"><span class='c1'>guardsound =
6,0</span></p>

<p class="MsoNormal c5"><span class='c1'>ground.type =
High</span></p>

<p class="MsoNormal c5"><span class='c1'>ground.slidetime =
12</span></p>

<p class="MsoNormal c5"><span class='c1'>ground.hittime<span class=
"c4">&nbsp;</span> = 15</span></p>

<p class="MsoNormal c5"><span class='c1'>ground.velocity =
-5</span></p>

<p class="MsoNormal c5"><span class='c1'>air.velocity =
-2.5,-3.5</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 2]</span></p>

<p class="MsoNormal c5"><span class='c1'>type =
ChangeState</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = AnimTime =
0</span></p>

<p class="MsoNormal c5"><span class='c1'>value = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>ctrl = 1</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The "movetype" parameter
in the StateDef is set to "A" for "attack". Remember to do this for
all attack states. As before, P1 changes back to his standing state
after his animation is over.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>That HitDef controller
looks like a monster! Do not worry, we will go through it
slowly.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L1: type =
HitDef</span></p>

<p class="MsoNormal c2"><span class='c1'>L2: trigger1 = AnimElem =
2</span></p>

<p class="MsoNormal c2"><span class='c1'>This specifies the
controller type as "HitDef", which stands for "Hit Definition". It
is triggered on the second element of animation. Any Clsn2 box from
the time the trigger was activated will take on this hit
definition.</span></p>

<p class="MsoNormal c2"><span class='c1'>If, for example, you had a
Clsn1 in both the second and third element of animation, triggering
a single HitDef at the second element makes it apply to both
elements of animation. So P1 will hit at most once: if the second
element hits, the third will miss. If the second element misses,
the third can still hit. To make the attack hit twice, you must
trigger a HitDef for each of the two elements.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L3: attr = S,
NA</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the attribute of
the attack. It is used to determine if the attack can hit P2. In
this case, it is a Standing Normal Attack.</span></p>

<p class="MsoNormal c2"><span class='c1'>"attr" has the
format:</span></p>

<p class="MsoNormal c5"><span class='c1'>attr = <i>arg1</i>,
<i>arg2</i></span></p>

<p class="MsoNormal c2"><span class='c1'>Where:</span></p>

<p class="MsoNormal c2"><span class='c1'>- arg1 is either "S", "C"
or "A". Similar to "statetype" for the StateDef, this says whether
the attack is a standing, crouching, or aerial attack.</span></p>

<p class="MsoNormal c2"><span class='c1'>- arg2 is a 2-character
string. The first character is either "N" for "normal", "S" for
"special", or "H" for "hyper" (or "super", as it is commonly
known). The second character must be either "A" for "attack" (a
normal hit attack), "T" for "throw", or "P" for
projectile.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L4: animtype =
Light</span></p>

<p class="MsoNormal c2"><span class='c1'>This refers to the type of
animation that P2 will go into when hit by the attack. Choose from
"light", "medium", "hard" or "back". The first three should be
self-explanatory. "Back" is the animation where P2 is knocked off
her feet.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L5: damage = 10</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the damage that P2
takes when hit, and it does no damage if guarded. If we changed
that line to "damage = 10, 1", then it will do 1 point of damage if
guarded.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L6: guardflag =
MA</span></p>

<p class="MsoNormal c2"><span class='c1'>"Guardflag" determines how
P2 may guard the attack. Here, it may be guarded high(standing),
low (crouching) and in the air. The argument must be a string of
characters that includes any of the following: "H" for "high", "L"
for "low" or "A" for air. "M" (mid) is equivalent to saying
"HL".</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L7: pausetime =
12,12</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the time that each
player will pause on the hit. The first argument is the time to
freeze P1, measured in game-ticks. The second is the time to make
P2 shake before recoiling from the hit.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L8: sparkxy =
0,-55</span></p>

<p class="MsoNormal c2"><span class='c1'>This is where to make the
hit/guard spark. The arguments must be in the form "x, y". x is
relative to the front of P2. A negative x makes a spark deeper
inside P2. y is relative to P1. A negative y makes a spark higher
up.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L9: hitsound =
5,0</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the sound to play
on hit (from fight.snd). The included fight.snd lets you choose
from 5,0 (light hit sound) through to 5,4 (painful whack). To play
a sound from the player's own SND file, precede the first number
with an "S". For example, "hitsound = S1,0".</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L10: guardsound =
6,0</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the sound to play
on guard (from fight.snd). Right now all we have is 6,0. To play a
sound from the player's own SND file, precede the first number with
an "S".</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L11: ground.type =
High</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the kind of attack
for ground attacks (it also defaults to air attacks if you do not
have "air.type = ?"). In this case, it is a high attack. Choose
from "High" for attacks that make P2's head snap backwards, "Low"
for attacks that look like that hit in the stomach, "Trip" for low
sweep attacks, or "None" to not do anything to P2. "High" and "Low"
attacks are the same on P2 if the AnimType is "Back".</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L12: ground.slidetime =
12</span></p>

<p class="MsoNormal c2"><span class='c1'>This is the time in
game-ticks that P2 will slide back for after being hit (this time
does not include the pausetime for P2). Applicable only to hits
that keep P2 on the ground.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L13: ground.hittime =
15</span></p>

<p class="MsoNormal c2"><span class='c1'>Time that P2 stays in the
hit state after being hit. Applicable only to hits that keep P2 on
the ground.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L14: ground.velocity =
-5</span></p>

<p class="MsoNormal c2"><span class='c1'>Initial X-velocity to give
P2 after being hit, if P2 is in a standing or crouching state on
the ground. You can specify a Y-velocity as the second argument if
you want P2 to be knocked into the air, eg. "ground.velocity = -3,
-2".</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>L15: air.velocity =
-2.5,-3.5</span></p>

<p class="MsoNormal c2"><span class='c1'>Initial velocity to give
P2 if P2 is hit in the air</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>There are more things that
you can control in a HitDef. See sctrls.txt for details.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>----------------------------------</span></p>

<p class="MsoNormal c2"><span class='c1'>III.f. Common states
(common1.cns)</span></p>

<p class="MsoNormal c2"><span class=
'c1'>----------------------------------</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>If you look at a player's
DEF file, you will see the line:</span></p>

<p class="MsoNormal c2"><span class='c1'>stcommon =
common1.cns<span class="c4">&nbsp;</span> ;Common states</span></p>

<p class="MsoNormal c2"><span class='c1'>Every player shares some
common states, which are the basic parts of the game engine. These
common states are found in data/common1.cns. Some examples are
states for running and getting hit. A full list is available in
Appendix A, Special State Controller Numbers.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>If there is a common state
that you would like to override for a certain player, all you need
to do is make a state in that player's CNS with the same number as
the one you would like to override. Then, when the player changes
to that certain state number, he will enter that new state, instead
of the one in common1.cns.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>You should remember that
when overriding certain states that have special properties coded
inside M.U.G.E.N, the new states you make will still have the same
special properties as the ones you overrode. For example, the run
state (state 100) sets the player's velocity to whatever values you
specified in his player variables. If you override state 100, the
new state will still have the property of setting that player's
velocity.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>A common example is
overriding the running state. M.U.G.E.N's default behaviour for the
running state is to have the player continue moving forward at a
constant speed, until you let go of the forward key. At that point
he returns to the stand state.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Now, let's say we want
that player (let us call him P1) to instead hop forward, just like
the default double-tap back hop. You can make a state in P1's
CNS:</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c3'>; RUN_FWD (overridden to
dash-type)</span></p>

<p class="MsoNormal c5"><span class='c3'>[Statedef 100]</span></p>

<p class="MsoNormal c5"><span class='c3'>type<span class=
"c4">&nbsp;&nbsp;&nbsp;</span> = S<span class=
"c4">&nbsp;&nbsp;</span> ;Running is on the ground</span></p>

<p class="MsoNormal c5"><span class='c3'>physics = N<span class=
"c4">&nbsp;&nbsp;</span> ;We'll define our own physics</span></p>

<p class="MsoNormal c5"><span class='c3'>anim = 100<span class=
"c4">&nbsp;&nbsp;&nbsp;</span> ;Anim action 100</span></p>

<p class="MsoNormal c5"><span class='c3'>ctrl = 0<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> ;No control for duration
of dash</span></p>

<p class="MsoNormal c5"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c3'>[State 100, 1] ;To start
dashing forwards</span></p>

<p class="MsoNormal c5"><span class='c3'>type = VelSet</span></p>

<p class="MsoNormal c5"><span class='c3'>trigger1 = Time =
[0,5]</span></p>

<p class="MsoNormal c5"><span class='c3'>x = 6</span></p>

<p class="MsoNormal c5"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c3'>[State 100, 2] ;Friction
after initial dash</span></p>

<p class="MsoNormal c5"><span class='c3'>type = VelMul</span></p>

<p class="MsoNormal c5"><span class='c3'>trigger1 = Time &gt;
5</span></p>

<p class="MsoNormal c5"><span class='c3'>x = .85</span></p>

<p class="MsoNormal c5"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c3'>[State 100, 3]
;</span></p>

<p class="MsoNormal c5"><span class='c3'>type =
ChangeState</span></p>

<p class="MsoNormal c5"><span class='c3'>trigger1 = AnimTime =
0</span></p>

<p class="MsoNormal c5"><span class='c3'>value = 0</span></p>

<p class="MsoNormal c5"><span class='c3'>ctrl = 1</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Here, we assume that
Action 100 has a finite looptime. The velocity in "</span><span
class='c3'>run.fwd" under [Velocity] of the player variables is not
really ignored, but [State 100,1] overrides that detail by setting
the X-velocity to 6.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>IV. Expressions</span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>MUGEN has support for
expressions in both the CNS and the CMD files. This section will
briefly cover some examples of expressions. Don't take this for a
thorough reference; it is only a quick guide to get you started.
For a complete explanation of expressions, please refer to the
expressions documentation (exp).</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Expressions allow you to
use a trigger as the value of a parameter. The following example
increases the x-position of the player by a value that is equal to
his state time.</span></p>

<p class="MsoNormal c5"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = PosAdd</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time =
0</span></p>

<p class="MsoNormal c5"><span class='c1'>x = Time</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Simple arithmetic is also
possible using expressions. Some basic arithmetic operators
are:</span></p>

<p class="MsoNormal c2"><span class='c1'>+ addition</span></p>

<p class="MsoNormal c2"><span class='c1'>- subtraction</span></p>

<p class="MsoNormal c2"><span class='c1'>*
multiplication</span></p>

<p class="MsoNormal c2"><span class='c1'>/ division</span></p>

<p class="MsoNormal c5"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = VelSet</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> trigger1 = 1<span class=
"c4">&nbsp;&nbsp;</span> ;Note: this is logically equivalent
to</span></p>

<p class="MsoNormal c2"><span class='c1'><span class=
"c4">&nbsp;&nbsp;</span> x = Time + 4<span class=
"c4">&nbsp;&nbsp;</span> ;"trigger1 = Time &gt;= 0"</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Expressions in state
controller parameters are evaluated at runtime, meaning that every
time a state controller with a parameter containing an expression
is executed, the parameter's value is recalculated during that
instant. In the example above, the player's x-velocity is
recomputed for every frame that he stays in state 200.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The order of evaluation
generally left-to-right, but with multiplication and division
taking precedence over addition and subtraction. For example, in an
expression 5 + 6 / 2, the result is 8. To force the addition to
take place before the division, you can add in parentheses, ie. (5
+ 6) / 2, which gives a result of 5.5.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Expressions may also be
used in the trigger line. These expressions are evaluated every
time the trigger is checked. This next example changes the player's
state when his state time is greater than the value stored in the
variable var(1).</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type =
ChangeState</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time &gt;
var(1)</span></p>

<p class="MsoNormal c5"><span class='c1'>value = 201</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Variables may also take
expressions, as seen below.</span></p>

<p class="MsoNormal c5"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type = VarSet</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time =
[1,5]</span></p>

<p class="MsoNormal c5"><span class='c1'>var(Time) = Time *
2</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Logical operators may also
be used. || is used for "or", and &amp;&amp; for "and". For
example, this changes the player's state when his state time is
greater than 90, and his animation has ended.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>[State 200, 1]</span></p>

<p class="MsoNormal c5"><span class='c1'>type =
ChangeState</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time &gt; 90
&amp;&amp; AnimTime = 0</span></p>

<p class="MsoNormal c5"><span class='c1'>value = 0</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>The trigger line above is
logically equivalent to these two lines:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = Time &gt;
90</span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = AnimTime =
0</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>&amp;&amp; takes
precedence over ||. Whenever you use more than one logical operator
in an expression, try to use brackets for clarity. It's not
required, but it makes it easier to understand. For
instance:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c5"><span class='c1'>trigger1 = ((Time &gt; 90)
&amp;&amp; (AnimTime = 0) || (var(2) = [5,9]))</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Not all parameters support
expressions. Typically, those that are of a non-numeric type do not
support expressions. For example, this is an illegal
construct:</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>[State 300, 5]</span></p>

<p class="MsoNormal c2"><span class='c1'>type = HitDef</span></p>

<p class="MsoNormal c2"><span class='c1'>trigger1 = Time =
0</span></p>

<p class="MsoNormal c2"><span class='c1'>ground.type = High
&amp;&amp; Low<span class="c4">&nbsp;&nbsp;&nbsp;</span> ; &lt;--
illegal -- non-numeric types!</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class='c1'>Appendix A.<span class=
"c4">&nbsp;</span> Special State Numbers</span></p>

<p class="MsoNormal c2"><span class=
'c1'>====================================================================</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Unless you plan to
override a common state, avoid choosing state numbers in the range
0-199 and 5000-5999. Here is a list of states in common1.cns. State
numbers labeled "reserved" should not be used, as they may be
assigned special functionality in a later version of
MUGEN.</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>Number<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> Description</span></p>

<p class="MsoNormal c2"><span class='c1'>------<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> -----------</span></p>

<p class="MsoNormal c2"><span class='c1'>0<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
Stand</span></p>

<p class="MsoNormal c2"><span class='c1'>10<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
Stand-to-crouch</span></p>

<p class="MsoNormal c2"><span class='c1'>11<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
Crouching</span></p>

<p class="MsoNormal c2"><span class='c1'>12<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;</span>Crouch-to-stand</span></p>

<p class="MsoNormal c2"><span class='c1'>20<span class=
"c4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
Walk</span></p>

<p class="MsoNormal c2"><span class=
'c1'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>

<p class="MsoNormal c2"><span class='c1'>This list is not yet
complete. Please be patient.</span></p>

<p class="MsoNormal c2"><span class=
'c3'><![if !supportEmptyParas]>&nbsp;<![endif]></span></p>
</div>
</body>
</html>

