Throwing in MUGEN

download Throwing in MUGEN

of 16

Transcript of Throwing in MUGEN

  • 7/27/2019 Throwing in MUGEN

    1/16

    Throwing in MUGENThrows exist since the original Street Fighter 2 and they were an"easy" way to inflict damage to your opponent, since you onlyneeded to be near him and push the controller forward plus apunch or kick button to throw him. They were called cheapsometimes .but in truth there are chars that rely heavily on the useof throws or "special throws" (aka "command throws" that requirea special motion to be executed) to win, like Zangief and hisSpinning PileDriver. In this section you will hopefully learn how toimplement throws in MUGEN.

    Example: Chris (ChrisbyNeogouki)

    Neogouki's Chris throwing Geese HowardAs in every move in MUGEN, you add the proper frames to thesprite file and then define a command to activate it.

    Defining how to activate the throw - The CMD File; Aerial drop[State -1]

    type = ChangeState

    value = 850

    trigger1 = command = "holdfwd"trigger1 = command = "b"

    trigger1 = Var1 = 0

    trigger1 = statetype = Strigger1 = stateno != 100

    trigger1 = P2bodydist X

  • 7/27/2019 Throwing in MUGEN

    2/16

    Chris's Aerial Drop is what is called "a normal throw". We alreadysaid before that normal throws require that you are fairly close tothe opponent , and that you press forward plus some button toactually throw him. This "conditions" are defined in the CMD file:

    a) Pressing forward + some buttontrigger1 = command = holdfwdtrigger1 = command = b

    The above triggers ,that have the same number (1) check that theplayer has pressed forward and in this case, the "b" button.

    b) Checking the distancetrigger1 = P2bodydist X

  • 7/27/2019 Throwing in MUGEN

    3/16

  • 7/27/2019 Throwing in MUGEN

    4/16

    animation no.850In the above picture, taken from Ranchan's Mugenerator, youshould note that the red collision box is slightly to the right of Chris.This area, marked by the red box, is what you would call "the throw

    area" . When the enemy touches this area, he will be thrown. This iscalled the "throw range" in most fighting games, so when you wantthat your char has a long "throw range", just make his collision boxwider,and don't forget to draw itout of your character,notsurrounding your character. The above pic should be enough asreference.

    Ok, now we define how the throw will "hit" the opponent. As inevery move in MUGEN, we use the HitDef controller to do this:

    [State 850, 1]type = HitDeftrigger1 = AnimElem = 1

  • 7/27/2019 Throwing in MUGEN

    5/16

    [State 850, 2]type = ChangeStatetrigger1 = AnimTime = 0value = 0ctrl = 1

    We have defined the throw, but now is time to code what exactly isChris going to do while throwing, and how the opponent will reactto this. As we have said before, state 860 explains what Chrisbehaviour is going to be (p1stateno = 860) and 870, his opponent's(p2stateno = 870)

    State 860: Chris throwing the opponent; Aerial drop (success)

    [Statedef 860]type = Smovetype = A

    physics = S

    anim = 860

    [State 860, 1]type =NotHitBy

    trigger1 = Time = 0value = SCA

    time = 81

    [State 860, 2]type = PlayerPush

    trigger1 = Time >= 0

    value = 0

    [State 860, 3]type = Explodtrigger1 = AnimElem = 2anim = 880

    sprpriority = 0

    postype = p1

    pos = 56,-76

    bindtime = 1

    [State 860, 4]type = PlaySnd

    trigger1 = AnimElem = 2, = 1

    value = 1500,1

  • 7/27/2019 Throwing in MUGEN

    6/16

    [State 860, 5]type = TargetBindtrigger1 = AnimElem = 4, >= 0

    trigger1 = AnimElem = 5, < 0

    pos = 20,0

    [State 860, 6]type = TargetBind

    trigger1 = AnimElem = 5, >= 0trigger1 = AnimElem = 6, < 0

    pos = 42,-64

    [State 860, 7]type = TargetBind

    trigger1 = AnimElem = 6, >= 0trigger1 = AnimElem = 7, < 0

    pos = 30,-52

    [State 860, 8]

    type = TargetBindtrigger1 = AnimElem = 7, >= 0

    trigger1 = AnimElem = 8, < 0

    pos = 22,-58

    [State 860, 9]type = TargetBindtrigger1 = AnimElem = 8, >= 0

    trigger1 = AnimElem = 9, < 0

    pos = 2,-60

    [State 860, 10]type = TargetBind

    trigger1 = AnimElem = 9, >= 0trigger1 = AnimElem = 10, < 0

    pos = -26,-50

    [State 860, 11]type = TargetBind

    trigger1 = AnimElem = 10

    pos = -26,-110

    [State 860, 12]type = TargetState

    trigger1 = AnimElem = 10, = 1value = 880

  • 7/27/2019 Throwing in MUGEN

    7/16

    [State 860, 13]type = PlaySndtrigger1 = AnimElem = 10, = 1

    value = 850,0

    [State 860, 14]type = PlaySnd

    trigger1 = AnimElem = 10, = 3

    value = 240,1

    [State 860, 15]type = ChangeStatetrigger1 = AnimTime = 0

    value = 0

    ctrl = 1

    Wow, that was a lot of code. Fortunately, a lot of lines seemsimilar,and they do cause they do the same thing.

    We will look at the code by part beginning with:

    -Defining the animation; Aerial drop (success)[Statedef 860]type = Smovetype = Aphysics = Sanim = 860

    Standard stuff here, we define the move and tell wich frames of theSFF file we will use for the throws. Like it says above, we will useanimation number 860 (anim=860).

    animation no.860: Chris's Aerial Drop

    -Making your char invulnerable during the throw -NotHitBy[State 860, 1]type = NotHitBytrigger1 = Time = 0value = SCA

  • 7/27/2019 Throwing in MUGEN

    8/16

    time = 81

    In the first part of the state, we find the NotHitBy controller, this letsyour player be invulnerable to the attacks of his opponent. It takestwo parameter ,how long will the effect last (time=81) in game ticks(1 sec=60 game ticks), and which moves will the player beinvincible to : (value=SCA) meaning he 's invulnerable

    to StandingCrouchingAerial attacks while he's throwing the otherguy.-Putting your Sprite "overlap" the opponent - PlayerPush[State 860, 2]type = PlayerPushtrigger1 = Time >= 0value = 0

    Next,we have the PlayerPush controller. As you probably haveseen in most fighting games, when you throw someone, theirsprites overlap , meaning they are in top of each other, giving theillusion that the character is indeed putting its hands on theopponent's clothing. That's what we use the PlayerPush for. Seethe following pic for reference:

    PlayerPush controller: Chris's sprite "on top" of Geese's- Using custom sparks when throwing- Explods[State 860, 3]type = Explodtrigger1 = AnimElem = 2anim = 880sprpriority = 0postype = p1pos = 56,-76bindtime = 1

  • 7/27/2019 Throwing in MUGEN

    9/16

  • 7/27/2019 Throwing in MUGEN

    10/16

    ....................................

    ....................................[State 860, 11]type = TargetBindtrigger1 = AnimElem = 10pos = -26,-110

    Now comes the important part of the throw. In order to give theillusion that your char is throwing the opponet over his shoulder asRyu does , or in this case hitting him with Chris legs to make him fly,you have to "bind" him to your chars position. This is done by usingthe TargetBind controller. You can specify how long the effect willlast, this is specified in game ticks as is always the case with tamein MUGEN. If you don't specify the "time=" parameter it defaults to1.

    The pos argument specifies the offset from Chris axis to which the

    opponent will be binded. These values are difficult to get right inyour first try, so it's very possibly that you will have to play withthem a bit and trial and error till you are satisfied with the results.

    - Changing the opponent's states - TargetState[State 860, 12]type = TargetStatetrigger1 = AnimElem = 10, = 1value = 880

    We have already thrown the enemy with the previous states, butnow we want him flying in the air, but he won't do it alone!, we canuse the TargetState controller, that lets you change in which stateis our opponent now (this only works if we have previously bindedhim with TargetBind), so when the animation reaches its10th frame (Animelem=10) , we change him to state 880 to makehim fly (TargetState with value=880).

  • 7/27/2019 Throwing in MUGEN

    11/16

    Animelem=10:Chris launching the opponent into the air

    State 870: State for the opponent while being thrown; Thrown by Aerial drop

    [Statedef 870]

    type = Smovetype = Hphysics = S

    velset = 0,0

    ctrl = 0

    [State 870, 1]type = ChangeAnim2

    trigger1 = Time = 0

    value = 870

    [State 870, 2]type = NotHitBytrigger1 = Time = 0

    value = SCA

    time = 35

    [State 870, 3]type = SprPrioritytrigger1 = Time = 0

    value = -2

    As seen previously , State 870 is the state we put the opponent inas soon as the throw makes contact, and BEFORE we go into state880 that makes hin fly into the Air and land.

    [State 870, 1]type = ChangeAnim2trigger1 = Time = 0value = 870

    Here we make the opponent use animation 870 ofChris 's AIRfile. The AIR file, as you know, contains all the animationinformation including position of each animation frame in thescreen, how long to show each frame,etc. Because Chris knowshow his throw works and his opponents don't , we just let them useour AIR file for this state so they know how to show their frames

  • 7/27/2019 Throwing in MUGEN

    12/16

    while being thrown. This is about the only case where you are goingto use ChangeAnim2.

    animation no.870: being thrownPlease note that we let them use our animation data,notourframes,ok? We give them the information of where each framegoes, how long to show them,etc. But the opponent is going touse their own frames. Hope that clears up any doubts.

    [State 870, 2]type = NotHitBytrigger1 = Time = 0value = SCAtime = 35

    Now we use the NotHitBy controller again, this lets your player beinvulnerable to the attacks of his opponent. It takes two parameter,how long will the effect last (time=35) in game ticks (1 sec=60game ticks), and which moves will the player be invincible to :(value=SCA) meaning he 's invulnerable

    to StandingCrouchingAerial attacks. As this is the state of theopponent (remember? State 870 defines what the opponent isgoing to do while being thrown), the above code renders theopponent invulnerable to further attacks for 35 game ticks or half asecond, aprox.

    Of course you can eliminate this in your char, especially if you wantto juggle your enemy after throwing them or something like that.Like I always say: this are merely guidelines from tried and truecharacters, but you can (and should) be as creative as u want.

    -State 880:Making your opponent fly (and land too!); Thrown by Aerial drop (in the air)

    (in the air)

    [Statedef 880]

  • 7/27/2019 Throwing in MUGEN

    13/16

    type = A

    movetype = H

    physics = N

    [State 880, 1]type = VelSet

    trigger1 = Time = 0x = 2.3

    y = -7

    [State 880, 2]type = VelAdd

    trigger1 = Time > 0

    y = .4

    [State 880, 3]type = LifeAdd

    trigger1 = Time = 0value = -150

    [State 880, 4]type = PosAdd

    trigger1 = Time = 3

    x = 10

    [State 880, 5]type = SelfState

    trigger1 = Pos Y >= 0trigger1 = Vel Y > 0

    value = 5100

  • 7/27/2019 Throwing in MUGEN

    14/16

    [State 880, 1]type = VelSettrigger1 = Time = 0x = 2.3y = -7

    The Velset controller lets us change the X and Y velocity of a char. Less Yvelocity means going up, greater Y velocity means going down. y= -7 as a

    paremeter in Velset makes our char go up. The same goes for X ,thehorizontal axis, a positive X makes the char go forward, a negative makeshim go backward.

    We can positively say that with the above parameters, the char will goforward and up,that's right? Please note that we are talking aboutChris opponent here not Chris himself!. This state 880 that we are looking atnow,contains the actions for the enemy , because we said thatwe weregoing to control his movements ourselves, in order to achieve greatercontrol in how he flies into the air. We did it in Chris states with the followinglines, remember?

    [State 860, 12]type = TargetStatetrigger1 = AnimElem = 10, = 1value = 880

    Ok , that said , we go to our next part in state 880:

    [State 880, 2]type = VelAdd

    trigger1 = Time > 0y = .4

    Here we use the VelAdd controller to make the char come down,we made him fly before, now we add to the Y velocity a positivevalue to make him come down (y=.4)

    [State 880, 3]type = LifeAddtrigger1 = Time = 0value = -150

    This is nothing difficult, we just decrease our opponent's LifeBarusing the LifeAdd controller with a negative value (you do knowthat (+) plus ( -) gives you (-) ,don't you?) : )

  • 7/27/2019 Throwing in MUGEN

    15/16

    [State 880, 4]type = PosAddtrigger1 = Time = 3x = 10

    Nothing fancy here either, we use the PosAdd controller to movethe opponent a little forward in order to make him fall in a position

    we like.

    NOTE : Take into account that how you make the opponent fly intothe air when thrown depends strictly on what character are youmaking or what effect you are trying to achieve, this is only aguideline, but you are free to be as creative as you want.

    - Making your opponent land - Mugen predefined states[State 880, 5]type = SelfStatetrigger1 = Pos Y >= 0trigger1 = Vel Y > 0value = 5100 =0) then he's not in the air, and if his Y velocity is alsopositive (Vel Y>0) he is not going up,either, so he must be near the floor.Remember when we used TargetState to make our opponent go into thisstate,manually? Well, SelfState lets you do the same, change to a desiredstate manually, but it refers to the same char,not his opponent.

    So ,if State 880, the one we are looking at, is the opponent's state, thenSelfState will refer to the opponent too!. In the above code we use 5100 asthe parameter (value=5100), but we haven't defined a 5100 state anywhere!!In reality, there is a state 5100 for Chris, in fact: every Mugen char hasit! That is cause that state comes in the Mugen engine itself, it'spreprogrammed and everyone can use it.

    There are a number of preprogrammed states in Mugen, if you are curiousjust look for the file COMMON1.CNS in the DATA directory of your Mugeninstallation. You will find lots of states there, and one of them will be state

    5100. This state makes the char bounce from the ground into the air whenthey fall heavily, this adds some "drama" to the animation, and you can lookat it whenever you Piledrive someone with Zangief in any SF game: youropponent doesn't just fall and stay there, they bounce back a little into theair then fall again, flat in their backs.

    So, because we want this effect, we just use SelfState to change theopponent state to 5100.

  • 7/27/2019 Throwing in MUGEN

    16/16

    That's about it, but since we have gone through *some* code I thinkit's time for our.....

    SUMMARY- If you are making a normal throw, check for trigger1 = command ="holdfwd" and the button designed to activate the throw. If you aremaking a command throw a la KOF or Zangief, specify theappropiate motion in the CMD file, this is the only difference thereis.go here for a more detailed explanation

    - Implement the throw itself in the CNS file. If the throw is succesful(HitDef) define 2 states ,one for your char and one for youropponent, defining the actions to be performed while the throw isactive.go here for a more detailed explanation

    - Now implement those 2 states mentioned earlier. Here's whatChris (our example) will do while throwing his opponent. Use ofTargetBind and TargetState to "bind" the opponent to your char.gohere for a more detailed explanation

    - And here's what the opponent will do while being thrown.Lettingthe opponent use our AIR file for the throw animation data, so heknows how to show his frames while being thrown. go here for amore detailed explanation

    - Implement how the throw will affect the opponent: how high is hegonna fly, how far , how fast is he gonna land,etc. Usingpreprogrammed State 5100 to make the opponent bounce whenlanding .go here for a more detailed explanation

    That's it, hopefully with some work, these will inspire people tomake more grapplers: go Zangief! :)

    http://www.angelfire.com/ego/heavens/mugen_throws.htm#CMDhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CMDhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CMDhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSImplementinghttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSImplementinghttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSImplementinghttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSChris_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSChris_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSChris_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSChris_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponent_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponent_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponent_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponentinAirhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponentinAirhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponentinAirhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponentinAirhttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponent_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSOpponent_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSChris_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSChris_statehttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CNSImplementinghttp://www.angelfire.com/ego/heavens/mugen_throws.htm#CMD