PDA

View Full Version : how do you...



eishiba
Feb 05, 2017, 22:12
How do you make more than one throw? Ive seen other characters with two throws. Also, how do you make a fatality or finishing move after the match?

Anji Mito
Feb 05, 2017, 22:29
A fatality tutorial by Equinócio


=================================
= --------------------------------------- =
= Fatality Tutorial =
= by: Equinócio - 07/13/2004 =
= Modified in - 10/29/2005 =
= --------------------------------------- =
= site: http://2dgraphic.tripod.com =
= e-mail: *removed to avoid spam* =
= --------------------------------------- =
=================================


WARNING:
-----------------------------------------------------------------------------------------------
- This tutorial aims at the aid to create terminating blows in MUGEN,
between them fatalities, brutalities, pit-fatalities...

- If this tutorial the assistant in some way, I ask for that it does not place my
name in place some form of gratefulness.

- If you to want can place this tutorial in its site. It does not need to ask for to me.

- I made small modifications in tutorial in 10/29/2005. I added some Sctrls and I more
clearly tried to be in the explanations.

- This tutorial is recommendable for people who already dominate the MUGEN,
its language, Sctrls, Triggers, archives(CNS, CMD, AIR...).

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


Introduction:
-------------

When if it speaks in fatalities, the first thing that comes the head is MK(Mortal Kombat).
What you it will learn is valid any to char, independent of which game is. However,
during elapsing of tutorial, MK more will be focused to facilitate the understanding.
Let us make everything step by step to understand the mechanism of fatalities.

================================================== ====================================
Mounting the codes:
-------------------

AIR:

Let us start speaking of "FINISH HIM!"

First you must create an invisible animation, in the AIR,
that encloses all the screen of the game, with Clsn1. Our Helper future.

; "FINISH HIM!" - Invisible Helper
[Begin Action 7000]
Clsn1: 1
Clsn1[0] = -320,480,320,-480
-1, 0, 0, 0, -1

After this, to obtain the sprites of message "FINISH HIM" e places them in the SFF.
After that, to make its animation in the AIR. If you do not possess no message
to place at the moment of "fatality", you can jump this part.
The animation must be thus.

; "FINISH HIM!" - MSG
[Begin Action 7010]
7010, 0, 0, 0, 4,
7010, 1, 0, 0, 4,
7010, 2, 0, 0, 4,
7010, 3, 0, 0, 65,
.
.
.
-1, 0, 0, 0, -1,

-> Later I explain the reason of the line with infinite time.


================================================== ====================================
CNS:

1º step:
--------

Important states will be placed in the CNS.
For the good functioning of fatalities.

I advise, for an organization question, to type this in one another
archive CNS with name "Fatality", for example. Everything what will be said
on CNS will be interpreted as if was being placed in the archive "Fatality.cns".
It will be informed when it will be for working in the main CNS.

One remembers that invisible animation that you made in the AIR and that it
affects all the screen? You state for it will make one now.
It observes what it follows ahead.

Invisible Helper that will appear when to arrive close to the end of the fight:

Its personage calls the Helper in this instant.
;-> 10000 are an imaginary number that does not exist in the AIR.
[StateDef 10000]
type = S
movetype= I
physics = S
juggle = 1
velset = 0,0
ctrl = 1

;Invisible Helper that will make P2(opponent) is dizzy.
[State 10000, 1]
type = Helper
trigger1 = 1
trigger1 = NumHelper(7000) = 0 ;another Helper cannot exist as this in the screen.
ID = 7000
stateno = 7000
pos = 160, -140
postype = left
helpertype = normal
name = "FINISH HIM!"
keyctrl = 0
ownpal = 1

[State 10000, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


-------------------------------------
This is the HitDef for the Helper bred above.

[StateDef 7000]
type = S
movetype = A
physics = S
anim = 7000
velset = 0,0
ctrl = 1

;Affecting all the screen.
[State 7000, 1]
type = HitDef
trigger1 = AnimElem = 1
trigger1 = P2StateType != A
attr = S, SA
damage = 0,0
animtype = Heavy
hitflag = MF
guardflag = A
priority = 7
pausetime = 0,3
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
fall = 0
numhits = 0
p2stateno = 49999 ;P2 will go for this state after to be affected by the Helper.

-> This Helper cannot be destroyed.


-------------------------------------
This is the Helper of the animation of "FINISH HIM!"(message) that you made.
It will appear when P2 is dizzy. If you do not possess no message to place at
the moment of "fatality", you can jump this part.

He places it in [StateDef 10000], more above. Together with the invisible Helper.

;"FINISH HIM!" - MSG
[Statedef 7010]
type = S
movetype= I
physics = S
juggle = 1
velset = 0,0
anim = 7010
ctrl = 0

;Voice of Shao Kahn(optional).
[State 7010, 1]
type = PlaySnd
trigger1 = Time = 1
value = 3,3

;"FINISH HIM!" it will not have shadow while it will be in the screen.
[state 7010, 2]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;The message will appear above of all the elements of the screen(scene, lifebars, chars...)
[State 7010, 3]
type = SprPriority
trigger1 = 1
value = 5

;Helper do "FINISH HIM!" - MSG
[state 7010, 4]
type = Helper
trigger1 = NumHelper(7000) = 1 ;It must have a Helper that makes P2 is dizzy in the screen.
trigger1 = NumHelper(7010) = 0 ;It cannot have message "FINISH HIM!" in the screen.
trigger1 = P2StateNo = 49999 ;P2 must be in this state it message to appear.
id = 7010
stateno = 7010
pos = 160, -140
postype = left
helpertype = normal
name = "FINISH HIM! - MSG"
keyctrl = 0

-> Analyzing triggers of the Helper, you it will perceive that it cannot be destroyed.
It was therefore that more above(animation in the AIR) a line with infinite time was placed.


-------------------------------------
2° step:
--------

Now you it will place a Custom State for where P2 will be sent the Helper after to appear.
It observes that the number of this state the same is placed in the HitDef of the
invisible Helper(7000: P2StateNo = 49999).

;Dizzy(before one fatality, with chronometer).
[Statedef 49999]
type = S
movetype= H
physics = S
juggle = 1
ctrl = 0
velset = 0,0

;Enemy will be with life equal the 1.
[State 49999, 1]
type = LifeSet
trigger1 = 1
value = 1

;Its personage gains a little more than energy to prevent an equal result.
[State 49999, 2]
type = TargetLifeAdd
trigger1 = P2life <= 1
value = 1

;After 480 ticks without having fatality, P2 falls.
[State 49999, 3]
type = SelfState
trigger1 = Time = 480
trigger1 = P2StateNo != [3000,3200] ;It places here the numbers of states of fatalities.
value = 5050
ctrl = 0

;After 480 ticks without having fatality, P2 is died.
[State 49999, 4]
type = LifeSet
trigger1 = Time = 480
trigger1 = P2StateNo != [3000,3200]
value = 0

;Enemy is dizzy.
[State 49999, 5]
type = ChangeAnim
trigger1 = AnimExist(5300)
trigger1 = Anim != 5300
value = 5300


-------------------------------------
3° step:
--------

Now, it opens the main CNS. You it will place important "States -2" in it.

To make them, you it will have to place a Var of high value,
so that it is not extinguished between rounds. Let us catch as example Var(58).
It changes the value of the IntPersistIndex parameter of the CNS.
If in the example to var he is 58, moves for 57.
Making this it will not extinguished between rounds.


[Statedef -2]

;This VAR will be set in motion when one round previous will be gained.
[State -2, 1]
type = varset
trigger1 = Win = 1
trigger1 = NumHelper(7000) = 0 ;Invisible Helper that makes the opponent is dizzy.
v = 58
value = 1

;When the enemy is deceased, it erases.
[State -2, 2]
type = varset
trigger1 = Win = 1
trigger1 = NumHelper(7000) = 1
trigger1 = p2life != 0
v = 58
value = 0

;When P2 will be with 1 of energy, it is died with any blow.
[State -2, 3]
type = AttackMulSet
triggerall = !Var(58)
triggerall = p2Life <= 1
trigger1 = Win = 0
trigger1 = RoundNo != 1
trigger2 = P2StateNo = 49999
value = 9999

;This state is optional, but I suggest that it places it to have a notion of the
;distance between P1 and P2. It will appear in debug during the game.
[State -2, 4]
type = DisplayToClipBoard
trigger1 = 1
text = "P2BodyDist X %f, P2BodyDist Y %f, Var(58) = %d"
params = P2BodyDist x, P2BodyDist y, Var(58)


-------------------------------------
It adds this code in the HitDefs and Projectiles of the personage,
with exception of the Fatalities:

kill = !var(58) || 1*p2stateno = 49999

What it will occur when life of the opponent the 1 is equal:

- Opponent will die if you did not win one round before or if it will be is dizzy.
- It prevents that the adversary is died before FINISH HIM.


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

CMD

1º step:
--------

Now it comes the part of the CMD. In it you it will place the necessary commands for the execution of fatalities.

This command will call the invisible Helper when P2 will be with equal life the 1.
Everything is automatic. You do not need to type command.

[State -1]
type = Changestate
trigger1 = Ctrl ;It must have the control.
trigger1 = P2Life <= 1 ;Life of P2 must be equal the 1.
trigger1 = NumHelper(7000) = 0 ;It cannot have another Helper as this in the screen.
trigger1 = P2StateNo != 49999 ;Opponent cannot be in Custom State.
trigger1 = RoundNo != 1 ;Round cannot be the first one.
trigger1 = var(58) >= 1 ;You must be to win one round before.
trigger1 = statetype != A ;P1 cannot be in air.
trigger1 = p2statetype != A ;P2 also not.
value = 10000

This must be placed before any routine of the personage.
In the top, below of [Statedef -1].
If you it made Artificial Intelligence to char, places this ChangeState
above of the routines of it. This procedure is not norm,
but it increases the probability of the Helper to be called in the end of the fight.

EX.: Artificial Intelligence

trigger46 = command = "cpu_46"
trigger47 = command = "cpu_47"
trigger48 = command = "cpu_48"
trigger49 = command = "cpu_49"
trigger50 = command = "cpu_50"
v = 59
value = 1

(It places here the command that will call the invisible Helper)


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

2° step:
--------

Fatality to be executed must have parameters as the shown ones below, in the CMD.

[State -1, Fatality]
type = Changestate
trigger1 = Ctrl ;It must have the control.
trigger1 = P2Life = 1 ;Life of the opponent must be equal the 1.
trigger1 = NumHelper(7000) = 1 ;It must have at least 1 invisible Helper in the screen.
trigger1 = P2StateNo = 49999 ;Opponent must be in this state.
trigger1 = RoundNo != 1 ;Round cannot be the first one.
trigger1 = var(58) >= 1 ;You must be to win one round before.
trigger1 = command = "FATALITY" ;It places the command to execute fatality.
trigger1 = statetype != A ;P1 cannot be in air.
trigger1 = p2statetype != A ;P2 also not.
value = 3000

-> If you to want, uses another parameter as "P2BodyDist X <= 50", for example.
You can use the language of "&&" not having that to type as much "trigger1".


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

Making Fatalities:
------------------

-> We go to come back to work with the archive "Fatality.cns".

Basic types of fatalities exist that we can use as example:


1º Example:
-----------

The first example that we will analyze will be fatality where a Helper appears in
the place of P2. This method consists of ordering the opponent the Custom State.
It will be in it where P2 will lose the life. In this example it does not have
necessity of boxes of collision(Clsn1 or Clsn2) for its personage, nor for the Helper.
This model will serve for Fatality, Babality, Animality or any another finishing
where he appears something or somebody in the place it its personage or opponent it.

================================================== ====================
Here you it will place the animation where char it makes the movement to give fatality,
but in it it will only be the Helper.

[Statedef 3000]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
anim = 3000 ;-> The personage makes the movement to give fatality.
ctrl = 0

;This is the Helper that will appear in the place of P2.
[State 3000, 1]
type = Helper
trigger1 = Time = 49
trigger1 = NumHelper(3010) = 0 ;It cannot have Helper as this in the screen.
ID = 3010
stateno = 3010
pos = 0,0
postype = P2
helpertype = normal
name = "Helper"
keyctrl = 0
sprpriority >= -2

;Screen is dark(optional).
[State 3000, 2]
type = BGPalFX
trigger1 = Time >= 63
time = 99999
add = 0,0,0
mul = 0,0,0

;Sound touched at the moment(optional).
[State 3000, 3]
type = PlaySnd
trigger1 = time = 1
value = 3,4

;Stand comes back.
[State 3000, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

-----------------------------------
;This is the Helper that will be called and that it was placed in state above.
[Statedef 3010]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
anim = 3010
ctrl = 0

[State 3010, 1]
type = Helper
trigger1 = NumHelper(3010) = 0
ID = 3010
pos = 0,0
postype = P2
stateno = 3010
helpertype = normal
name = "Helper"
keyctrl = 0
sprpriority >= -2

[State 3010, 2]
type = Destroyself
trigger1 = AnimTime = 0

-----------------------------------
;Custom State for where P2 is sent.
[Statedef 51000]
type = S
movetype= H
physics = S
juggle = 1
velset = 0,0
ctrl = 0

;Enemy exchange of position and "disappears" of the screen.
[State 51000, 1]
type = PosSet
trigger1 = time > 62
y = 1000

;Opponent does not have shadow.
[state 51000, 2]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;Life goes the zero.
[State 51000, 3]
type = LifeSet
trigger1 = time >= 63
value = 0

;Enemy it comes back to its proper CNS, however it continues in the position Y = 1000.
[State 51000, 4]
type = SelfState
trigger1 = life = 0
value = 5150

-----------------------------------
Two Sctrls important:

-> It adds this Sctrl in state where P2 is dizzy with chronometer.
Custom State for where P2 is sent the Helper after to appear.
In our tutorial one it is the State of number 49999.

[State 49999, Change]
type = ChangeState
trigger1 = P2StateNo = 3000 ;-> State of fatality.
value = 51000 ;-> Custom State for where P2 is sent.
ctrl = 0

When executing the command of fatality, its char(P1) will go for the State of fatality.
When this to happen, P2 will go immediately to the Custom State of fatality that
he is being executed. There it will lose the life, will disappear of the screen...

-> If you it will be playing in the Team way, it can happen of its partner or
the partner of its opponent to interrupt fatality.
To prevent this problem, It uses NotHitBy in the Custom States of fatalities.
This does not finish for complete with the problem, but aid very.

[State 51000, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

-> It places this Sctrls in all the terminating blows.


The example above also can be applied to the blows below.

Babality:
---------
You it will have that to create or to catch a figure standard of a child and
places it as Helper. The Custom State for where P2 will be sent is seemed.
When it to disappear of the screen and to lose the life, child(Helper)
appears in the place.

Opponent it not to cry out in the end, at the same time where I cry it of the child appears,
he adds this in the Custom State de P2.

[State 51000, Without crying out]
type = AssertSpecial
trigger1 = 1
flag = nokosnd


Animality:
----------
It follows project the same, but the difference is that, as its personage if transforms
into an animal, it also it will have to disappear of the screen during the
transformation and the blow. It tries to use it its to char the Sctrl PosSet,
as well as you used in the Custom of the opponent. Example of Custom State can be
used the same above. The animal could be a Helper. When the blow to finish,
its personage will come back to the same place of before. But it takes care with the
gone time of and coming for its personage.


FriendShip:
-----------
The Custom State sends P2 and, in this Custom, it makes the life of the
opponent to go the zero(Sctrl LifeSet). In SelfState it places animation
0(stand) or 5300(dizzy). The result of this is that P2 will be in same foot
later that its life will be zero. The inconvenience is that the MUGEN will
delay a little to finish the fight and to close the scene.


"Blades": One fatality where the enemy is cut in some parts.
------------------------------------------------------------
For this you can create one box black(Helper) that she appears in the place of
P2 and the parts where it is cut.

It makes its Helper to have maximum priority on P2, being used this Sctrl.

[State 3400]
type = SprPriority
trigger1 = 1
value = 5

If to want that the parts of the body of P2 are plays in the soil, then will have
that to create or to catch a body of a man used standard to be as substitute.
I suggest that this model is a half-***** man, not to have contrast of clothes with
other personages. Here, more of the one than in the other blows, I advise to use
the Sctrl BGPalFX to darken the scene. I say this so that it does not appear
one box black and rectangular in full scene. He would be very strange.

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

2º Example: Brutality
---------------------

We will now see a model of Brutality or any another sequence of blows.
As in the first example, you it will not need to around place boxes of collision
of the personage. The only difference is that the blow will be divided in two parts.
The first one is when char runs or walks in direction to the opponent to execute
the blow and the second part is when a series of blows occurs.

If to want, can place some animation that will appear in the place of P2
when it to die. This animation can be a Helper. In our example, we will place
a blood burst to substitute the figure of P2 in the game.

To make the first part, it is enough that you it copies animation 20 or 100 that
he is in the archive "common1.cns", located in the folder "data" of the MUGEN.
Later it places it in a different State.

It observes the example:

==============================
Brutality - part 1

The personage runs in direction to the opponent.
-> 3199 are an imaginary number that does not exist in the AIR.
[Statedef 3199]
type = S
movetype= A
physics = S
juggle = 1
anim = 100
velset = 0,0
ctrl = 0

;Constant speed.
[State 3199, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

;It will not be interrupted by the walked one, in case that it is running.
[State 3199, 2]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

;One does not turn over during the race.
[State 3199, 3]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

;Sound touched at the moment(optional).
[State 3199, 4]
type = PlaySnd
trigger1 = time = 1
value = 1,4

;When the personage is to less than 15 pixels of the opponent,
;it modifies of state and starts the session of blows.
[State 3199, 5]
type = ChangeState
trigger1 = P2BodyDist X <= 15
value = 3200
ctrl = 0


In the second part you it will have to create a great animation that contains
all the movements of char, but does not place no box of colisão(Clsn1 or Clsn2)
in sprites. Exactly that she is enormous and stranger, leaves as is.
This is only one technique. It has another one that consists of placing each
sprite in a different animation, but already is more laborious there and what
we want it is to simplify.


==============================
Brutality - part 2

The personage executes the sequence of blows.
-> 3200 are the animation where char it executes the blows.
[Statedef 3200]
type = S
movetype= A
physics = S
juggle = 1
anim = 3200
velset = 0,0
ctrl = 0

;Burst of blood that appears in the place of P2 in one determined time.
[State 3200, 1]
type = Helper
trigger1 = AnimElem = 63
trigger1 = NumHelper(3210) = 0 ;It cannot have Helper as this in the screen.
ID = 3210
pos = 0,0
postype = P2
facing = 1
stateno = 3210
helpertype = normal
name = "Burst"
keyctrl = 0
sprpriority >= -2

;Screen becomes gloomy(optional).
[State 3200, 2]
type = BGPalFX
trigger1 = AnimElem = 10
time = 99999
add = 0,0,0
mul = 0,0,0

If to want, places a PlaySnd.
The sound will be touched always that its to char to make a movement that
supposedly the opponent hits in case that he had Clsn1 in the animation.
In case that you it makes the screen to tremble(EnvShake) or uses animações
of blood(VarRandom), the procedure is the same.

[State 3200, 3]
type = PlaySnd
triggerall = p2bodydist X <= 16
trigger1 = AnimElem = 2
trigger2 = AnimElem = 4
trigger3 = AnimElem = 7
trigger4 = AnimElem = 12
trigger5 = AnimElem = 16
trigger6 = AnimElem = 21
trigger7 = AnimElem = 23
trigger8 = AnimElem = 25
value = 0,6

;Stand comes back.
[State 3200, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

-----------------------------------
;Helper that substitutes P2 in the end of the Brutality.
[Statedef 3210]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
anim = 3210
ctrl = 0

[State 3210, 1]
type = Helper
trigger1 = NumHelper(3210) = 0
ID = 3210
pos = 0,0
postype = P2
stateno = 3210
helpertype = normal
name = "Burst"
keyctrl = 0
sprpriority >= -2

[State 3210, 2]
type = Destroyself
trigger1 = AnimTime = 0

----------------------------------------------------------------------
;Custom State for where P2 is sent.
[Statedef 52000]
type = S
movetype= H
physics = S
juggle = 1
velset = 0,0
ctrl = 0

A drawing between animation 5000 and 5001 will occur.
The drawing will be made to each 10 ticks not to be very fast
while P2 is being hit.

[State 52000, 1]
type = VarRandom
trigger1 = (GameTime%10) = 0
trigger1 = Time >= 3
v = 10
range = 1,2

;Being hit
[State 52000, 2]
type = ChangeAnim
trigger1 = var(10) = 1
trigger1 = Time >= 3
value = 5000

;Being hit - 2
[State 52000, 3]
type = ChangeAnim
trigger1 = var(10) = 2
trigger1 = Time >= 3
value = 5001

;Life goes the 0(zero) when to arrive at one definitive time.
[State 52000, 4]
type = LifeSet
trigger1 = Time >= 298
value = 0

;Change of position and one another animation can appear in the place.
;That one shown above and that it will substitute P2.
[State 52000, 5]
type = PosSet
trigger1 = Time >= 298 ;Helper will appear at the same moment.
y = 1500

;It does not cry out in the end(optional). You do not go to want the opponent
;crying out at the same time that she blows up.
[State 52000, 6]
type = AssertSpecial
trigger1 = 1
flag = nokosnd

;He comes back to its proper CNS.
[State 52000, 7]
type = SelfState
trigger1 = Time >= 300 ;P2 will come back to its proper CNS, but already died.
value = 5150

To finish the code, it opens the CMD and it types the command referring
the execution of the Brutality. It follows the model that was placed more above.

-> You must place the regarding command the first part of the Brutality.
The blow was divided in two parts - 3199 and 3200. It places the command
only for first part - 3199. Thus, the personage will go to run and to
start the sequence.

-> In state where P2 is dizzy with chronometer(State 49999), adds a
ChangeState(that already it was commented before). Trigger must be in relation
the second part of the Brutality. "trigger1 = P2StateNo = 3200".


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

3º Example: Pit-Fatality
------------------------

You must catch or create a great screen with the dimensions
standards of MUGEN - 320 x 240. It is not norm, but the objective is to cover
all the screen.

You can use the same animation of the Uppercut(Hook) of its char to make the blow.
The opponent will be sent the Custom State at the same moment of the blow and will
suffer a vertical acceleration until disappearing of the screen.
When it to come back to appear, the screen of the Pit-Fatality already will
have to be present. Places it as Helper.

It observes the example:

;This is the animation where the personage executes the "hook".
[Statedef 3300]
type = C
movetype= A
physics = C
juggle = 1
ctrl = 0
anim = 3300
velset = 0,0

In one determined moment, when P2 leaves the scene, its personage disappears and
goes for a distant position. A bit before the screen of the Pit-Fatality appearing.
Compares the times.

[State 3300, 1]
type = PosSet
trigger1 = Time = 53
y = 1000

;P1 does not have shade.
[state 3300, 2]
type = AssertSpecial
trigger1 = Time >= 53
flag = noshadow

;Screen of the Pit-Fatality.
[State 3300, 3]
type = Helper
trigger1 = NumHelper(3310) = 0 ;It cannot have Helper as this in the screen.
trigger1 = Time >= 55
ID = 3310
pos = 160,-120
postype = left
stateno = 3310
helpertype = normal
name = "Screen"
keyctrl = 0
sprpriority >= -2

;Its personage will be in the same pose of "hook" until P2 to die.
[State 3300, 4]
type = ChangeState
trigger1 = P2Life = 0
value = 0
ctrl = 1

-----------------------------------
;Helper: Screen
[Statedef 3310]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
anim = 3310
ctrl = 0

[State 3310, 1]
type = Helper
trigger1 = NumHelper(3310) = 0
ID = 3310
pos = 160,-120
postype = left
stateno = 3310
helpertype = normal
name = "Screen"
keyctrl = 0
sprpriority >= -2

[State 3310, 2]
type = Destroyself
trigger1 = AnimTime = 0


-------------------------------------
-> Custom State for where P2 is sent. When the life of P2 will be 0 (zero),
at the same time where it goes for a distant position and it is invisible, perhaps,
as suggestion, it it blows up in many pieces, as well as in the Brutality.
To if shocking with many metal thorns. The reasoning in the Custom State will be this.
If it only wants that it is stuck in the thorns and dies, obviously does not need
to make it to be invisible and to order it it a distant position.

[Statedef 53000]
type = S
movetype= H
physics = S
juggle = 1
velset = 0,0
ctrl = 0

;Without shade.
[state 53000, 1]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;Camera does not follow P2 leaving the screen.
[State 53000, 2]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0

;Taking Collision - animation of P2 to the hit being.
[State 53000, 3]
type = ChangeAnim
trigger1 = 1
value = 5030

;Speed - when P2 is leaving the screen.
;If to want to place VelSet, the choice is its.
[State 53000, 4]
type = VelAdd
trigger1 = time = [9,40]
y = -0.3

;Speed - P2 appears again in the screen.
[State 53000, 5]
type = VelAdd
trigger1 = time >= 40
y = 0.3

;Life goes 0(zero) at one definitive moment of the fall.
[State 53000, 6]
type = LifeSet
trigger1 = time = 115
value = 0

;Change of position when Life = 0
[State 53000, 7]
type = PosSet
trigger1 = Time = 115
y = 1500

;Opponent is invisible when Life = 0.
[State 53000, 8]
type = AssertSpecial
trigger1 = Life = 0
flag = invisible

;He does not cry out in final(optional).
[State 53000, 9]
type = AssertSpecial
trigger1 = 1
flag = nokosnd

;Come back to its proper CNS when Pos Y = 1000
[State 53000, 10]
type = SelfState
trigger1 = Pos Y = 1000
value = 5150

-> In state where P2 is dizzy with chronometer(State 49999),
adds a ChangeState(that already it was commented before).

It tries to make the everything most accurate possible in the Pit-Fatality.
In rare cases, part of stage appears. To diminish this bug, I suggest that
it modifies the resolution of the screen (Helper) of 320 x 240 for 350 x 260,
for example, and add this in State -2.

[State -2, Deep It Disappears]
type = BGPalFX
trigger1 = NumHelper(3310) = 1
time = 99999
add = 0,0,0
mul = 0,0,0

When the screen of the Pit-Fatality to appear, the scene will be dark.
Thus, stage will not appear.


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

;Messages after "fatality":
;--------------------------

Case you wants to place a final message(Fatality, Brutality...) after the blow,
is only enough to make a Helper. This code can be placed in our "Fatality.cns",
but I suggest that it places the Helper in state of the victory pose.
The voice of Shao Kahn can be placed in any one of states. Here or there.
The counting of the time alone depends on state.

;"FATALITY" - MSG
[Statedef 7100]
type = S
movetype= I
physics = S
juggle = 1
velset = 0,0
anim = 7100
ctrl = 0

;"FATALITY" will not have shade while it will be in the screen.
[state 7100, 1]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;The message must appear above of everything in the scene, even though of
;its personage in victory pose(in accordance with the norms in MK).
[State 7100, 2]
type = SprPriority
trigger1 = 1
value = 5

;Helper of the "FATALITY" - MSG
[State 7100, 3]
type = Helper
trigger1 = NumHelper(7100) = 0 ;It cannot have message "FATALITY" in the screen.
ID = 7100
stateno = 7100
pos = 160,-110
postype = left
helpertype = normal
name = "FATALITY"
keyctrl = 0
sprpriority >= -2

Analyzing trigger of the Helper, you it will perceive that it cannot be destroyed.
For this, in the animation of the AIR, it places a line with infinite time.
As well as it was made for message "FINISH HIM".


-----------------------------------------------------------------------------------------------
Gratefulness:

- God: for giving the chance to me to learn on MUGEN and fatalities.

- Chon Wang: for teaching to the beddings and techniques to me on fatalities.
Many codes of this tutorial originally had been made by it.

- To the many creators whose works in MK I consulted to make the tutorial
and to mount the examples seen here.

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

I wait that the rial o assists during the creation of fatalities.

If it will have some doubt, informs for email.

Good Luck,

Equinócio.