目前M.U.G.E.N的官方最新版本是1.1beta

人物标准受击的编写(二)

CNS格式说明中文版

=====================================================================  

The CNS format

==============

M.U.G.E.N, © Elecbyte 2000

Documentation for version 2000.06.27  


Beta-release documentation (incomplete)  

Updated 27 June 2000




====================================================================  

0. Contents

0.内容

====================================================================  

Section I.    Introduction

第一节 简介

Section II.   Player Variables

第二节 角色基本变数

Section III.  States

第三节  States介绍

Section IV.   Expressions

第四节 表示式

Appendix A.   Special State Numbers  

附录A  特殊状态编号

====================================================================  

I. Introduction

I.简介

====================================================================  


The CNS file of a player serves two  purposes:


.CNS档案提供玩家两种用途


i. It defines the variables of that player,  such as walking speed, drawing scale factor, and so on.


i.定义角色基本参数,例如走路速度,描画尺度…


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.  


ii.包含所有角色动作状态的描述.状态(states)是基本建构单位可以让你简单的建立一些脚色复杂的动作


Like many other character files, the CNS is  a text file that you can edit with any text editor.  


跟其他的人物相关档案一样,.cns档也是一个文字档,所以你可以用任何文字档编辑器来编辑


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.


.cns档里,分号(;)用来当作注解字元.;後的文字会被系统忽略..CNS档里,大部分的字母的大小写是没有分别的,例”MyName,myname,mYnAMe”都是相同的.唯一的例外”command”触发(trigger),但是你现在还不用担心这个问题.


Some terminology

一些专有名词

----------------

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:


当我们在後面的文章中提到”group”群组时,我们的意思是几行文字组成的一个区块,这个区块以[群组名称]开头,直到下一个群组开始之前都算是这个群组的一部份,以下是一个例子


[Blah]

line1

line2

[Group 2]

more lines


Within a group, the parameters can appear in  any order. So,


在群组里,参数的出现顺序可以任意


[SomeGroup]

value1 = 1234

value2 = "A string"


is equivalent to:


等同於


[SomeGroup]

value2 = "A string"

value1 = 1234




====================================================================  

II. Player Variables

II.角色一般变数

====================================================================  


No full documentation yet. See  chars/kfm/kfm.cns for comments on each variable.


还未有完整的说明文件,请参考/chars/kfm/kfm.cns对於变数的注解说明


Some importants one to note:


一些重要的说明:


- 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.  


-[Size]这个群组里,你可以使用”xscale”和”yscale”来改变你的角色的宽度和高度。这样做可以挽救在.SFF档里角色尺度太大或太小的问题。


- Set up the speeds of the player in  [Velocity]


-可以在[Velocity]里设定角色的速度。


- Set the player's downward acceleration --  "yaccel" in [Movement]


-[Movement]里设定角色的下降加速度。


====================================================================  

III. States

III.States

====================================================================  


a. Overview of Finite State Machines in  MUGEN

b. Introduction to States

c. Basic Parts of a State

d. Details on StateDef

e. Details on State Controllers

f. Common states (common1.cns)


a. 概述在MUGEN里一些State的机制

b. 介绍States

c. State的基本部分

d. StateDef的详述

e. State Controllers的详述

f. Common states (common1.cns)的说明。


-------------------------------------------------

III.a. Overview of Finite State Machines in  MUGEN

-------------------------------------------------


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.


这一节介绍如何用简单的MUGENstate机制来制作一个MUGENCHAR(角色)。这不需要特别的技术,但是这是针对能够用心分析思考的读者而言。您大可以跳过这一节,假如您已经对有限的state机制很了解,有或者如果您对这些细节没有兴趣,也可以直接往下一步份继续看喔。


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.


所谓的finite state machine(以下略称为FSM)是由一些子程序(subroutines)所集合而成的自动机制,每一个子程序可以执行一些功能而且可以利用一些判断指标来选择下一步要执行的子程序是什麼,每个子程序就叫做一个”state,所以FSM可以用来处理一个正在执行中的的stateFSM同一个时间只能处理一个state


The following is a trivial example of a FSM,  given in pseudocode.


以下以一个虚拟的简单例子来说明FSM的观念:


State 0:

1. Read in a number.

2. If the number is 0, go to state 0. Else,  go to state 1.


State 1:

1. Print "Woohoo!"

2. Go to state 3.


State 2:

1. Go to state 0.


State 3:

1. Quit


state 0:

1.读取一个数字

2.假如这个数字是0,那麼就跳到state 0.如果不是0,就跳到 state 1.


State 1:

1. 显示”Woohoo !

2. 跳到 state 3


State 2:

1. 跳到state 0


state 3:


is not holding punch, play recovery  

animation.

4. If not successful, play miss animation.  

5. When the recovery or miss animation ends,  go to state 0 (idle).


State 555

1. 尝试挥拳攻击对方。

2. 如果成功了,而且玩家继续挥拳攻击,就跳到state  555(连续动作)

3. 如果成功了,但是玩家没有继续挥拳攻击,显示回复正常的动作。

4. 如果没有成功,显示没打到敌人的动作。

5. 当回复正常或是没打到敌人的动作显示完,跳到state  0(等待输入的发呆动作)。


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 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.


MUGEN的人物就是由FSM组合而成。人物的CNS档定义一些states,每个state都包含一个或一个以上的state  controllers(状态控制器)。状态控制器(state controll)是实际让人物有机能,类似之前我们提到的FSM。例如,HitDef这麼控制器允许人物打击对方,而ChangeState控制器则可以让人物显示一个指定的动作画面。每个状态控制器指定一个或一个以上的判断条件(称为触发triggers或是条件型态触发condition-type triggers),必须满足这些触发条件,控制器才会执行它们所要控制的动作。


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).


每个MUGEN人物有三种特别的state,编号为-1,-2,-3。这些是唯一允许使用负数来编号的state

State 1的状态控制器通常决定由玩家输入的state的转换规则。

State 2包含每个tick要被判断的状态控制器。

State 3的控制器则是每个tick要被判断一次,除非玩家所使用的人物暂时使用另一名玩家的

state资料(例如,当玩家被摔时)。


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 evaluat ed 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.


译注:tick查字典的意思是钟表的滴答声。

每个游戏时间的tickMUGEN会检查这三个特殊的state。检查的顺序是-3,-2,-1。若是在这个检查过程中,若有碰到状态控制器,那麼就评估它的触发条件,如果符合触发条件,就执行执行控制器要控制的内容。然後执行程序到这个state的下一个状态控制器。在这三个特殊state的一个state的转换(ChangeState)会更新人物目前的state number,但是不会更新特殊states的执行动作。在三个特殊state的所有状态控制器都检查完以後,会执行人物目前的sate,然後又检查-3,-2,-1,一直重复这样的动作。如果目前的state里有更换state的动作(ChangeState)那麼目前这个state的其他状态控制器会被跳过不执行,而是会接下去执行新的State的开头。若是执行完目前的state而且没有更换state的动作的话,那麼这个tick的工作就结束了。


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.)


以上的说明有一个例外的情形。如果人物是一个”helper”角色,也就是经由Helper状态控制器所产生的人物,那麼这个helper就没有state 3,-2。这个helper也不会有state 1除非它允许玩家操作(这要在这个Helper建立时透过Helper状态控制器来设定)


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.


技术层面的提醒:人物的state机制也许看起来是一种不清楚的FSM,因为有一些隐藏的状态转换规则没有办法由使用者指定。例如,击中一名人物所造成的状态转换方式没办法在CNS里头设定。还有,单一的CNS state通常比符合数学和电脑科学的标准FSM来的复杂。不管从那个角度来看,你会发现,使用FSM的观念来制作MUGEN的人物会比较容易。


-----------------------------

III.b. Introduction to States

-----------------------------


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.


设计states是建立一个人物最困难的一部份,必须花很多的时间来设计、测试,有时候还要利用试误法。在这一节,为了之後讲解方便我们称我们所设计的人物为P1,而对手则称之为P2


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.


如果您第一次阅读这篇文件,但是却遇到与多不懂的地方,其实并不需要感到沮丧。学习states最好的方法是,先选一个完成度高的人物,并试著修改它的CNS档案里的参数,看看不同的值对这个人物有什麼影响,您不用怕把CNS的内容改坏了,M.U.G.E.N有自动侦测文法的功能,而且会把有问题的地方指出来。


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.


M.U.G.E.N压缩档里有一个叫做功夫人(KFM)的人物,你可以在char/kfm里找到。


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.


CMD档包含指令名称的宣告和State 1的定义(State 1用於控制当玩家输入指令时,所操作的人物会有什麼要的反应),若需要更详细的说明,请参考CMD文件。


Here are some concepts that will be useful  for you to know:

1. Life and power

2. Control

3. Game-time and state-time

4. Position, velocity and acceleration  

5. Juggling  


译注:Juggling这个字译者想不出应该翻成什麼,以下是查字典的意思,请读者自行揣摩它的意思吧…:p=====1. 杂耍;戏法2.  玩花招;欺骗


1. Life and power

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.


1. 生命和气

人物的生命棒(life bar)是在萤幕上方那一条黄色的棒,当生命棒下降到零的话,就表示您所操作的人物被击倒啦!

萤幕上另一条棒,蓝色的那一条,就是这个人物的气棒,当人物击中对方或是让对方击中的话就会提升。当气棒的值上升到一定的程度就可以使用特殊的攻击。  


2. Control

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.


2. 操作

当我们说一个人物被操作,所指的意思就是它这个时候可以做一些走路,跳跃或者是攻击对方动作。反之,若是我们说这个人物不可以这麼时候不可以操作,那麼是表示您无法控制它。例如,当P1在站立的state时,他可以被操作,如果在这个时候你按”前”的话,他就会往前走。典型的无法操作,就是当他被攻击的时候,如果被攻击还可以操作的话,那在被攻击的时候走开好了嘛!…:p


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.


然而这个规则有一个例外,有时候当被攻击中,你还是你可以让人物做出一些动作。这就叫做”动作中断”或是称为”动作取消”。若是需要更多的细节,请参阅CMD文件的说明。


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.


我们会常常提到人物的”操作旗标”,所谓的旗标就是一个可以用来表示”真”(true)或者是”假”(false)的数值。如果我们说这个人物的操作旗标是真,那就表示他可以被操作。


3. Game-time and state-time

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.

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.


3. 游戏时间和状态时间

MUGEN会持续追踪游戏经过的时间。每次游戏进行中内部资料更新一次(这个更新的动作包括了更新人物的资料更新、检查是否被攻击或是有击中对方、以及将结果在萤幕上重绘),我们称游戏时间(game-time)增加了1

而人物每个state要用的时间称为状态时(State-time)。每个state的时间都从0开始,当游戏时间(game-time)1时,状态时间也跟著加1


4. Position, velocity and acceleration  

Those of you with basic knowledge of math  should understand these concepts.  



M.U.G.E.N uses the following coordinate  system.

The greater the X-position, the farther  right the player is. The less the X-position, the closer he is to the left.  

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.

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.

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.


4. 位置、速度和加速度


如果你有基本的数学概念,那麼您应该很容易了解这个观念。

MUGEN使用如下的座标系统。

X位置越大,人物在越右边,值越小,人物在越左边。

Y位置为零表示在地面。Y值越大表示表示人物在越下面,例如,如果Y值小於零就表示他在空中。

同理,如果X加速度是正的,就表示人物往前,Y速度是负的,就表示人物是往上的。

同理,加速度也是这样。


5. Juggling

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.

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.

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.

For example, an attack that requires 5  juggle points could theoretically be used to juggle the opponent twice, leaving  the opponent with 1 point left. Subsequent such attacks will miss.

The reason for this juggle system is to  prevent infinite combos in the air.


5. Juggle

MUGEN有一套Juggle系统可以让你攻击已被击上空中的对手或是还躺在地上的对手。我们可以设定juggle points,内定值是15,每次人物进入掉落(fall就例如当人物被打离地面时,并不会恢复可操作状态,而会一直掉落得地面)状态时开始计算。如果人物在空中或是在还躺在地上时被攻击juggle points就会持续下降,而当攻击对方所需要的juggle  points比对方剩馀的还要多时,这次的攻击就会miss掉。任何会使对手进入掉落状态的动作,从刚击中对手时juggle  point就会开始减少。

例如,人物有5juggle点数,有一个需要2juggle  point的攻击动作理论上可以让你击中对方两次,直到对手剩下一个juggle point,接下去的攻击会miss

Juggle系统是为了要防止被无限段连续攻击。


By Bwhite

若要转载或对译文任何建议指教,请来信告知emil:g8811705@pine.yuntech.edu.tw

-----------------------------

III.c. Basic Parts of a State

-----------------------------


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.  



这一节开始之前,我们假设您至少浏览过AIR档案,并且知道动画的观念和知道AIR里的关键字和动作元件的语法。


Here is a short example state for P1:  


以下是一个简单的例子


[Statedef 200]

type = S

physics = S

movetype = I

ctrl = 0

anim = 200

velset = 0


[State 200, 1]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1


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.


这个状态会显示P1编号200的动画,并且在显示完後会回复到P1站立的状态。在这个例子里,我们假设编号200的动作是有个有限循环时间,也就是说,编号200没有时间设定为-1的元件(设定为-1所代表的意思也参考AIR文件)。


At this point, you do not need to worry  about the details. Let us begin by knowing what a state consists of.


我们以下会介绍state的基本组成形式。


All states must have a single Statedef  section and one or more State sections.  


所有的状态都必须要有单一的Statedef片段和一个以上以上的状态片段。  


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.)  


Statedef包含一个状态开始的资讯,例如这是一个什麼样的状态(站立,蹲下,或在空中等)和这个人物目前的动作(攻击或发呆)。  


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.  


每个状态片段都表示成一个状态控制器,或是或是一个简单的控制器。控制器告诉主程式P1应该做什麼样的动作,应该在什麼时候作。有许多种控制器可以用,每一种都有它们独特的功能。例如,有一些控制器可以改变人物的位置或速度,定义攻击的威力,让你可以发射飞行道具,或是在动画间切换,改变状态,还有…。每个控制器至少必须有一个触发。所谓的触发就是一个可以让控制器致能事件。像是,在状态一开始的触发,在动画结束的触发(这种触发就像以上那个例子一样),在指定的动作元件触发,当P2P1的一定范围里就触发,或是…。

--------------------------

III.d. Details on StateDef

--------------------------


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):


每一状态必须是以一个Statedef开头的群组。可以参考以下的例子(之後的点表示更多的参数)。


[Statedef state_number]

. state_parameters

.

.

Replace state_number 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.


当您自行设计时应把例子中state_number的地方改成您想要的数字。除了附录A所提出的特殊群组号码你不能使用以外,可以选择任何你想要的号码。为了避免选到特殊群组的号码,选择的时候请不要选0-1995000-5999的数字。


The lines that follow should include the  following parameters:

1. type

2. movetype

3. physics

4. anim


每个群组织要您应该换先看到以下几个参数:  

1. type(型态)

2. movetype(动作型态)

3. physics(物理型态)

4. anim(动画)


1. type

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). 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:


1. type

这是P1在那个状态群组里的型态。Type可以定义人物人物是正站著或正蹲下或是在空中或是倒在地上,以上四种型态所对应的值分别是”S,C,A,L”。如果type这一行省略不写,内定值是”S”。通常会使用到的是”S,C,A”。例如,一个蹲下状态的的型态必须有下列这一行:  


type = C


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.


我们用型态这个参数来决定几项因素,最重要的一项是,P1被击中时会有什麼反应。例如,在”stand”型态的状态下P1被击中的话,系统会当作是在地面被击中。同理,如果型态是”A’的话,被击中的话,系统会判定是在空中被击中,就会有在空中被击中的相对反应。


2. movetype

This is the type of move P1 is doing: "A"  for attack, "I" for idle and "H" for being hit. 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:


2. 动作型态

这是P1正在做的动作型态:”A”=”攻击”,I”=”发呆”,而”H”=”被击中”。如果这一行省略,系统内定值是”I”。”A”和”H”比较明显。而”I”就用於P1既不被攻击,也不攻击的情况下。例如,一个攻击的state应该有以下这一行:


movetype = A


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.


您应该指定动作型态好让主程式知道如何执行这个state。若是指定的动作型态不正确,可能会造成P1得动作不正确。


3. physics

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. If omitted, the value of "N" is assumed. The kind of physics is used  to determine how P1 behaves.


3. 物理型态

您必须要指定这个state的物理型态。正确的用法如下,”S”=”站立”,C”=”蹲下”,A”=”空中”,”N”=”没有”。如果省略这一行,系统内定是”N”。物理型态用於决定P1的行为。


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).


在”S”物理型态一下,P1会受到地面的摩擦阻力。而摩擦系数在会在人物变数里设定(请参考第二节)。


For "C" physics, P1 will experience  friction, just like in the "S" state.

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.

If you use "N" P1 will not use any of these  pre-programmed physics.

Do not confuse "physics" with the state  "type". They are usually the same, but you are given the choice if you want more  control.  



同理,”C”会受到地面的摩擦阻力,而”A”会受到重力影响而加速下降。如果人物下降到Y位置大於0(就是接触到地面),则他会马上跳到著地的state

如果您设定物理状态值是”N”,则人物不会受到以上叙述的影响。

不要让物理型态和型态改混了。通常这两个值是相同的,除非你想要有其他的控制方式。


4. anim

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.


4. 动画

这个参数改变P1动画的作动,透过这个参数指定作动的值。如果您不想要改变这个state的开始动画,只要忽略这个参数就可以了。  


So to have a state with number 400, where  the player is doing a crouching attack with Action 400, the typical parameters  would be:


所以要有一个编号400state,人物作一下蹲攻击的动作(这个动作编号刚好也是400)的设计,典型的参数指定如下:


[Statedef 400]

type = c

movetype = a

physics = c

anim = 400


The other optional parameters that you can  use are:

4. velset

5. ctrl

6. poweradd

7. juggle

8. facep2

9. hitdefpersist

10. movehitpersist

11. hitcountpersist


其他您可以使用的参数如下:

4. velset

5. ctrl

6. poweradd

7. juggle

8. facep2

9. hitdefpersist

10. movehitpersist

11. hitcountpersist


4. velset

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,  

velset = 4,-8

makes P1 start moving diagonally up and  forwards.

There is an exception to this. Even if you  have velset = 0, attacking P2 in the corner will push P1 away.


您可以用velset来设定P1state开始时的速度。使用的格式是输入一组数字,第一个数字表示X速度,第二个则表示Y速度。如果没有velset这一行则表示不改变P1的速度。举例如下:


velset = 4,-8


会使P1往前斜上升。

有一个例外的情形,就是既使您设定velset=0但是在角落攻击P2时,P1还是会往後弹开。


5. ctrl

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

ctrl = 1


ctrl:

这个参数会设定P1的可操作指标。”0设定指标为”false”则人物不可操作。”1设定指标为”true”,则人物可操作。这一行省略,P1的操作指标就不会改变。举例如下,要让P1可操作,指令如下:

ctrl = 1


6. poweradd

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

poweradd = 40


poweradd:


如果有这一行,可以增加P1的气棒的值。这个参数是一个数字,可以是正也可以是负。通常在攻击的动作会加入这个参数,当你想要在人物可以在做出攻击的动作时,叫增加气棒的值。例如增加40点的气poweradd=40


7. juggle

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.




Juggle参数只有当是攻击state的时候才会有用。它用来指定这个攻击动作需要多少点juggle点数。如果攻击动作没有这个参数的话,我们就可以做出无限段的攻击动作了)。您应该为所有的的攻击都指定juggle参数,如果一个攻击动作会用到许多state,则只要在这个攻击动作开始的state加上这个参数就可以了。


8. facep2

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.


Facep2:

如果有facep2=1这一行的会,则P1会强制在state开始的时候强制面向p2。如果省略这一行,facep2的内定值是”0


9. hitdefpersist

If set to 1, any HitDefs which are active  at the time of a state  

transition to this state will remain  active. If set to 0, the

default, any such HitDefs will be disabled  when the state  

transition is made.


Hitdefpersist:

如果设定为”1,任何的在这个state作动的Hitdefs将在转换state後保持作动。如果设定为”0(内定值),Hitdef在转换state会失效。


10. movehitpersist

If set to 1, the move hit information from  the previous state  

(whether the attack hit or missed, was  guarded, etc.) will be  

carried over into this state. If set to 0  (the default), this  

information will be reset upon entry into  this state.  


Movehitpersist

如果设定为”1,上一个state的击中资讯(不管是否有击中)将会被保存到下一个state。如果设为”0(内定值),当转换state时,击中资讯会重置。


11. hitcountpersist

If set to 1, the hit counter (how many hits  this attack has done)  

will be carried over from the previous  state to this state. If set  

to 0 (the default), the hit counter will be  reset upon state  

transition. This parameter does not affect  the combo counter which  

is displayed on the screen.


Hitcountpersist:

如果设为”1,则击中计数(计算这一次的攻击击中几次)会保存之前state的击中计数值,如果设为”0,则再变换state後,击中计数的值会重置。这个值并不会影响连续攻击计数器(combo counter,就是在画面上显示的那个连续攻击的计数直)。

-----------------------------------  

III.e. Details on State Controllers  

-----------------------------------  


d.1 Controller Format

d.2 Triggers

d.3 Commonly-used controllers



III.d.1 Controller Format

-------------------------


All states must have at least one state  controller, otherwise it will cause an error. State controller groups have the  following format:

[State state_number, some_number]  

type = controller_type

trigger1 = condition_exp

. universal optional parameters

. additional parameters depending on  controller

.

.

每个状态并需有一个以上的状态控制器,所则会出现错误讯息。状态控制群组有如下个格式:


The state_number must be the same number of  the state from the statedef. some_number 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.  


State_number的值必须和这个statestatedef的值相同。

Some_number可以使您选定的值,有这个值的话,若是您的设计有问题,系统才方便显示出错误是在哪里。


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.


对所有的状态控制器参数而言,有两个特性:  

若是ignorehitpause设为”1,则就算人物因被击中而暂时停止,系统也会继续检查状态控制器。若是设为”0(内定值),则反之。

Persistency parameters,这一部份请参阅trigger文件)


The controller_type 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.


Control_type是您所使用的控制器名称。每一种控制器都有不同的功用,而且需要不同的参数。请参阅sctrls文件里所有状态控制器的列表。


The order of the controllers is significant.  Controllers listed first are the ones checked and, if necessary, activated  first.


控制器的先後顺序是有意义的。第一个列出的控制器会被第一个检查,如果符合触发条件,会被第一个作动。  


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):


[State 300, 1] ;State 300. 1 is just an  arbitrary number.

type = CtrlSet ;Changes the control flag.  

trigger1 = Time = 0

value = 1  



以下是一个让P1能被操作的例子(他的作用如同在statedef里加入”ctrl=1


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".  


在这个例子里,ctrlset状态控制器让您能改变P1的可操作旗标。”trigger1=Time=0这一行表示当状态时间等於0的时候,作动ctrlset控制器,也就是在这个状态开始的时候就作动ctrlset控制器。”value = 1这一行表示我们要让操作旗标改为”1,也就是”真”。如果我们要让P1在状态开始时无法操作,只要把改成”value = 0就行了。


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).


来看看另一个例子。我们要让P1向前移动10个像素两次,分别在动画元件的第二个时触发,和第三个时触发。不必担心您不知道要用什麼状态控制器名称,因为您可以在sctrls文件里找到详细的资料。


[State 300, 2]

type = PosAdd ;Adds to P1's position  

trigger1 = AnimElem = 2 ;Trigger on 2nd  element.

trigger2 = AnimElem = 3 ;Trigger on 3rd  element.

x = 10


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.


如您以上所见,每一个状态控制器要有至少一个以上的trigger,就是让控制器作动的条件。在这个例子里有两个trigger,状态控制器在trigger为”真”会作动。


III.d.2 Triggers

----------------


i. Trigger logic


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:

1. Are all conditions of "trigger1" true? If  so, then yes, activate the controller.

2. Otherwise, repeat the test for  "trigger2", and so on, until no more triggers are found.

This can be thought of as "OR" logic.  


i.trigger逻辑

第一个触发器都是”trigger1,接下来的触发器则是”trigger2,trigger3…。而决定控制器是否作动的逻辑是:

1. 所有的”trigger1是否为”true”,若是,则作动控制器。

2. 否则,重复测试”trigger2,trigger3…。直到没有其他的触发器。

您可以想像这是”OR”逻辑。


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.  


请注意,跳过数字为触发器取名会造成某些触发器被忽略。例如您的触发器是”trigger1,trigger2,trigger4,则您的”trigger4会被忽略。


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:


trigger1 = Vel Y > 0 ; True if  Y-velocity is > 0 (going down)

trigger1 = Pos Y > 0 ; True if Y-position  is > 0 (below ground)


如果您要让某些条件同时成立时作动控制器,该如何办到呢?以下是一个常用来检查人物是否已从空中落到地面的测试。我们要用到以下的触发器:  


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.  

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.  


从以上的例子您可以发现,触发器可已有同样的编号,您可以他解释为”AND”逻辑。也就是当所有相同编号的触发器为真时,控制器才会作动,只要触发器其中有一个是”假”,控制器就不会作动。  


You can combine both ideas. For example:  

trigger1 = Vel Y > 0 ; True if Y-velocity  is > 0 (going down)

trigger1 = Pos Y > 0 ; True if Y-position  is > 0 (below ground)

trigger2 = Time = 5 ; True if state-time is  5

The controller for this would be activated  if the player landed on the ground (Y-velocity and Y-Position are both > 0),  OR if his state time was 5.


您可以混用以上的两种观念,例如:

控制器会在人物著地时作动,或是当他的状态时间为5时作动。


Here is a summary:

- Triggers with the same number activate the  controller only if all of them are true.

- Triggers with different numbers activate  the controller if any one or more of them are true.


以下是总结:

-当所有编号相同的触发器同时为”真”时,控制器有作动。

-当不同编号的触发器中有一个为”真”时,控制器有作动。


The format of a trigger is:

trigger? = trigger_type trigger_test  

trigger_type is the name of the trigger (see  triggers.txt for the full list).  


condition_exp is an arithmetic expression to  be checked for equality to 0. If condition_exp is 0, then the trigger is false.  If condition_exp is nonzero, then the trigger is true. The condition_exp is  usually a simple relational expression as in the examples above, but can be as  simple or as complicated as required. See exp.txt for a detailed explanation of  arithmetic expressions.


触发器的格式是:

其中trigger type是触发器的名称(请参阅trigger.,txt,有完整的列表)。  

Condition_exp是数学表示是用来检查是否等於0

如果condition_exp等於0,表示触发器是”假”。如果condition_exp不为0,表示触发器为”真”。Condition_exp通常是一个简单的表示式,但是有需要的话,您也可以使用较为复杂的表示式(请参阅exp.txt


A useful shortcut you might use is  "triggerall". It determines a condition that must be true for all triggers. For  instance in:


triggerall = Vel X = 0

trigger1 = Pos Y > -2

trigger2 = AnimElem = 3

trigger3 = Time = [2,9]


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.


Triggerall”是您可能会用到的一个非常有用的触发方式。它表示对於所有的触发器,它都要是”真”才可以(和其他的触发器作AND的运算)。例如:


trigger1trigger3的检查同时,也要检查triggerall是否为真。在这个例子里,只要X速度不是0,那麼所以的触发器就没有作用。。值得注意的是,即使您指定了triggerall您还是要指定至少一个触发器,还有triggerall可以有一个以上。


ii. Trigger persistency


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:


如果您不想要每一次条件成立时,触发器被设为”真”的话,您必须使用”persistent”参数。我们以下面这个例子来说明:


[State 310, 1]

type = PosAdd

trigger1 = Vel Y > 1

x = 10


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:


每个tick只要符合Y速度大於1就作动PosAdd控制器,让P1往前移动1,也就是说只要Y速度大於一,就作动控制器。如果我们只要控制器作动一次,我们要加入下面这一列:


[State 310, 1]

type = PosAdd

trigger1 = Vel Y > 1

persistent = 0 ;<-- Added this line  

x = 10


"Persistent" has a default value of 1,  meaning that the controller is activated everytime the trigger is true.  

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.


Persistent”的内定值是1,这表示只要触发器为真,控制器就会作动。如果我们设定”persistent”为0的话,可以让控制器在这个状态期间只作动一次,除非重新进入这个状态。


The "persistent" parameter can also take  values other than 0 and 1:


[State 310, 1]

type = PosAdd

trigger1 = Vel Y > 1

persistent = 2 ;<-- Modified this line  

x = 10


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.


persistent”的值也可以设定大於0,1的值:

在这个例子,”persistent”设定为”2表示每两次触发器为”真”,控制器作动一次。同理,设定为”3时表示每三次为”真”时,控制器作动一次。


III.d.3 Commonly-used controllers  



accelerates P1 forwards

type = null ;VelAdd

trigger1 = Time >= 0

x = .8


Later, when you want to reenable the  controller, just change the type back to what it used to be.

以後您如果要重新让这个控制器有作动的话,只要把注解的地方改回来就好了。


Now let us look back at the example:  


[Statedef 200]

type = S

physics = S

movetype = I

ctrl = 0

anim = 200

velset = 0


[State 200, 1]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1


[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.


[State 200,1]是一个”ChangeState”控制器。如同字面意义,它改变P1的状态编号。”value”这个参数应该填入要变更呈的状态编号。”ctrl”这个选择性参数可以设定当状态改变时P1的可操作旗标。


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.


现在我们来制作一个攻击状态。首先,完成人物AIR档,这一部份请参考AIR文件。


As an example, let's assume the animation  action in P1's AIR file looks like this:


[Begin Action 200]

200,0, 0,0, 3

200,1, 0,0, 4

200,2, 0,0, 4

200,3, 0,0, 3


After defining the bounding boxes, it looks  like:


[Begin Action 200]

Clsn2: 1

Clsn2[0] = -10,0, 10,-80

200,0, 0,0, 3

Clsn1: 1

Clsn1[0] = 10,-70, 40,-60

Clsn2: 2

Clsn2[0] = -10, 0, 10,-80

Clsn2[1] = 10,-70, 40,-60

200,1, 0,0, 4

Clsn2Default: 1 ;Use this box for the last  two frames

Clsn2[0] = -10,0, 10,-80

200,2, 0,0, 4

200,3, 0,0, 3


在这里,我们假设攻击动画和攻击范围以及被攻击的范围设定如下:


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.


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.


我们建议您只要为第二个元件设定Clsn1


Now we are ready to set up the state in the  CNS. We will explain the changes below.



现在我们设定CNS档,我们会为您解释其中的意义:


[Statedef 200]

type = S

physics = S

movetype = A ;<-- "I" 改成 "A"

ctrl = 0

anim = 200

velset = 0


[State 200, 1] ;<-- 增加状态控制器

type = HitDef

trigger1 = AnimElem = 2

attr = S, NA

animtype = Light

damage = 10

guardflag = MA

pausetime = 12,12

sparkxy = 0,-55

hitsound = 5,0

guardsound = 6,0

ground.type = High

ground.slidetime = 12

ground.hittime = 15

ground.velocity = -5

air.velocity = -2.5,-3.5


[State 200, 2]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1


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.


StateDef里的“movetype”参数设为”A”表示”攻击”。记得为所有的攻击状态加入这个设定。P1在完成动作以後要变换状态在正常站立状态。  


That HitDef controller looks like a monster!  Do not worry, we will go through it slowly.


HitDef控制器看起来很难懂!没关系,我们会慢慢的为您解释。


L1: type = HitDef

L2: trigger1 = AnimElem = 2

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.

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.


若设为HitDef,当trigger1触发器为真时,Clsn2会检查他的范围。


L3: attr = S, NA

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.

"attr" has the format:

attr = arg1, arg2

Where:

- 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.

- 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.  


这是攻击的行为。用於决定是否是可以击中P2。在这里是站立普通攻击。

attr”的格式:

attr = arg1,arg2

-arg1可以是”S,C”或者是”A”。类似StateDef的”statetype”。

-arg2是两个字元的字串。第一个字元可以是”N=normal, S= special ,or H=hyper(super”也可以)

第二个字元必须是”A=attack  ,T = throw P =  projectile


L4: animtype = Light

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.


设定P2被击中时要显示什麼要的动作。可以选择”light ,  medium , hard,或是”back”。前三个比较容易了解。”Back”是当P2被双脚(双钮重击击)击中时使用。



L5: damage = 10

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.


P2被击中受到的伤害,如果防御就不会有伤害。如果我们把这列改成”damage= 10 ,1第一个数字表击中後的伤害,第二个表防御後的伤害。


L6: guardflag = MA

"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".


Guardflag”是设定P2如何防御这个攻击。在这里,可能是high(standing),low(crouching)和在空中。後面的参数必须是包含以下字元的字串:”H =  high ,L = low A =  AIR M(mid)  = HL


L7: pausetime = 12,12

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.  


击中後P1,P2暂停的时间。


L8: sparkxy = 0,-55

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.


画面显示的 击中/防御 爆点位置。使用格式要是”x, y”,其中x是相对於P2的前面。若x是负的值表示爆点会更深入P2Y值则是相对於P1Y值是负的会让爆点可高。


L9: hitsound = 5,0

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".  


击中的声音(从fight.snd)。可以选择5,0(轻击)到5,4(重击)。若要使用您自己的声音档,请在前面加上”S”,例如”hitsound = S1,0


L10: guardsound = 6,0

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".


防御声音(从fight.snd)。目前系统只有6,0可以选。若要使用您自己的声音档,也请加上一个”S”。


L11: ground.type = High

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".


地面攻击的种类(如果您没有 air.type = ? ,那ground.type 就当作air.type的内定值)。在这里,是一个轻攻击。选择”High”表示击中让P2头往後仰 ,或是选择”None”让P2没有反应。如果AnimType是”Back”那麼”High”和”Low”攻击对P2都是相同的。



L12: ground.slidetime = 12

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.



P2被击中後後退的时间(不包含暂停时间)。只有在地面攻击有效。


L13: ground.hittime = 15

Time that P2 stays in the hit state after  being hit. Applicable only to hits that keep P2 on the ground.


P2被击中後,保持被击中状态的时间。只有在地面上攻击时有效。


L14: ground.velocity = -5

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".


如果P2正站或蹲在地面,P2被击中後的初始X速度。如果您想要把P2击上空中,您可以指定Y速度当作第二个参数。例如 ground.velocity = -3 , -2


L15: air.velocity = -2.5,-3.5

Initial velocity to give P2 if P2 is hit in  the air


若把P2击上天空的初始速度。


There are more things that you can control  in a HitDef. See sctrls.txt for details.

其他的关於HitDef的细节,请参阅sctrls.txt


----------------------------------  

III.f. Common states (common1.cns)  

----------------------------------  


If you look at a player's DEF file, you will  see the line:

stcommon = common1.cns ;Common states  

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.


如果您看过人物的DEF档,你会发现这一列:

stcommon = common1.cns ;Common states  

每个人物共同使用一些一般性的states,这些states都是MUGEN的基本部分。这些共同的states可以在\data\common1.cns里找到。例如跑步的states和被击中的states。可以在附录A找到完整的列表。


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.


您可以建立您自己的common1.cns,在您的common1.cns里使用和\data\common1.cns相同的编号,那麼若是有使用到这些特殊编号的states的时候,就不用使用原来系统里的states,而会使用您的common1.cns里定义的states


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.


请记住若是您覆盖的特殊的stateMUGEN有一些特别的特性,则您自行定义的新states也要有相同的特性。例如,跑步的state(state  100)要设定人物跑步的动作,所以您自己定义的新state也要设定人物的速度。


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.


一个普通的例子是跑步的stateMUGEN定义人物跑步时候的行为是在跑步时,人物会以一定值的速度往前移动,直到您放开往前跑的键时,他会回复到站立的状态。  



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:


现在,我们来改变人物往前跑的动作,您可以在P1CNS里找到以下的部分:


; RUN_FWD 改成向前冲

[Statedef 100]

type = S ;在地面上跑

physics = N ;

anim = 100 ;Anim action 100

ctrl = 0 ;No control for duration of dash  


[State 100, 1] ;To start dashing forwards  

type = VelSet

trigger1 = Time = [0,5]

x = 6


[State 100, 2] ;Friction after initial dash  

type = VelMul

trigger1 = Time > 5

x = .85


[State 100, 3] ;

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1


Here, we assume that Action 100 has a finite  looptime. The velocity in "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.


在这里我们假设Action 100使有限循环时间的。在[Velocity]里的”run.fwd”并非真的忽略,而是[State 100,1]把原先的X速度改成6


====================================================================  

IV. Expressions

IV.表示式

====================================================================  


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).


MUGENCNSCMD之有支援一些表示式。这一节概要地用一些例子来介绍表示式。这里只是一个快速入门的介绍,若是需要详细的说明,请参考exp文件。


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.


表示式可以让你把触发器当成餐数值。以下的例子用一个和他的状态时间相等的值来当作要增加的人物的X位置值。


[State 200, 1]

type = PosAdd

trigger1 = Time = 0

x = Time


Simple arithmetic is also possible using  expressions. Some basic arithmetic operators are:


也可以在表示式里使用一些简单的算术,一些基本的运算子有:


+ addition

- subtraction

* multiplication

/ division


[State 200, 1]

type = VelSet

trigger1 = 1 ;Note: this is logically  equivalent to  

x = Time + 4 ;"trigger1 = Time >= 0"  


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.


Time值一直在改变,所以上面例子的X值也会跟著Time值改变而变。


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.


先乘除,後加减。 先作刮号内,在作刮号外。(与一般的数学计算相同观念)



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).


运算式也可以被用於触发器列。下一个例子里当状态时间大於存在var(1)的变数时,控制器将改变状态。


[State 200, 1]

type = ChangeState

trigger1 = Time > var(1)

value = 201


Variables may also take expressions, as seen  below.

变数也可以作表示式,请看以下的例子:


[State 200, 1]

type = VarSet

trigger1 = Time = [1,5]

var(Time) = Time * 2


Logical operators may also be used. || is  used for "or", and && for "and". For example, this changes the player's  state when his state time is greater than 90, and his animation has ended.  


也可以使用逻辑运算。”||”用於”or”,”&&”用於”and”。例如以下的例子:当他的状态时间大於90而且动画结束时,换更换状态。


[State 200, 1]

type = ChangeState

trigger1 = Time > 90 && AnimTime  = 0

value = 0


The trigger line above is logically  equivalent to these two lines:

以上例子的触发器可以改写如下:


trigger1 = Time > 90

trigger1 = AnimTime = 0


&& 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:


&&的运算优先权高於||。当您要用到许多逻辑运算时可以为每个式子加上刮号让程式看起来清楚一点。例如:


trigger1 = ((Time > 90) &&  (AnimTime = 0) || (var(2) = [5,9]))


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:


并不是所有的参数都支援表示式。典型地,像是非数值形式就不支援表示式。例如,以下就是一个不合法的例子:  


[State 300, 5]

type = HitDef

trigger1 = Time = 0

ground.type = High && Low ; <--  illegal -- non-numeric types!




====================================================================  

Appendix A. Special State Numbers  

====================================================================  


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.  


除非您想要修改一些普通的state,否则应避免选用0-199以及5000-5999的数字当作状态编号。



Number Description

------ -----------

0 Stand

10 Stand-to-crouch

11 Crouching

12 Crouch-to-stand

20 Walk


To be finished.


你,确定要这么做吗?
正在处理中...