I made this coding while messing around with MUGEN some..
Are you pretty much tired of the old Marvel vs Capcom crap of a simple sound effect and a explod that says "DANGER"?(no offense.)
Here's a different type of way you can notify the player, that the character's health is low.
This type of "Danger State" is similar to the ones seen in inFamous and Uncharted.
I do have this implemented, in my character, LucasX3(Dark).
This will involve use variables and such.
Now on with the tutorial.
First you will need to look through your character's .cns(if you are using KFM to make a character..) and find this:
;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[statedef -2]
Now you will have to add this to below "[statedef -2]"
;Danger! (When Energy Gets Low)
;SetDanger Variable
[State -2, VarSet]
type = VarSet
triggerall = life < 205
trigger1 = (var(46) = 0)
v = 46
value = 1
You can change the variable number to whatever you want, but if you are using KFM, keep it as it is.
Now for the sound that will play, add this below:
;Danger!
[State -2, PlaySnd]
type = PlaySnd
trigger1 = var(46) = 1
value = 9067,0
volume = 255
flag = nomusic ;I don't know why this is here, but okay
You can change the "value" numbers to anything you have in your character's .snd file that would be fit for this type of state that character goes into.
Go head and add this below:
;Close Danger Var
[State -2, VarSet]
type = VarSet
trigger1 = var(46) = 1
v = 46
value = 2]
This is up next and this will kill the music for dramatic effect:
;Begin NoMusic state.
[State -2, VarSet]
type = VarSet
trigger1 = var(46) = 2
v = 58 ;fv = 10
value = 1
ignorehitpause = 1
[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = var(58) = 1
flag = nomusic
This is all the extra stuff that will change the background and characters to Black and White:
[State -2, AllPalFX]
type = BGPalFX
trigger1 = var(55) = 1
time = -1
add = 50,50,50
ignorehitpause = 1
color = 0
persistent = 0
[State -2, VarSet]
type = VarSet
trigger1 = var(55) = 1
v = 56 ;fv = 10
value = 1
[State -2, AllPalFX]
type = AllPalFX
trigger1 = var(56) = 1
time = -1
add = 50,50,50
ignorehitpause = 1
color = 0
persistent = 0
[State -2, VarSet]
type = VarSet
trigger1 = life < 200
v = 55 ;fv = 10
value = 1
ignorehitpause = 1
[State -2, PalFX critical2]
type = PalFX
trigger1= var(55) = 1
time = -1
ignorehitpause = 1
add = 128,128,128
Now this is the next step, now we are trying to prevent the other player or the opponent from escaping the "PalFX or Pallete Effects":
;-------------------------
;P2 Danger State
;Since the other player can get out of the "black and white" palfx
;This has been added.
[State -2, Prevent the opponent from getting out of the PALFX]
type = TargetState
trigger1 = !time
value = 3551
ID = 3500
Now you will have to add this and this shouldn't be in [State -2], or else it won't work or it will cause some problems, if you have a lot of other stuff in [State -2].
Now find this:
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
and above it add:
;----------------
;PALFX STATE
;This is just for something related to state -2
[Statedef 3551]
type = S
movetype= H
physics = N
velset = -3,-4
ctrl = 0
[State 3351, PalFX]
type = PalFX
trigger1 = 1
time = -1
persistent = 1
color = 0
[State 3551]
type = selfstate
trigger1 = alive = 0
value = 5150
Now you are finished! You have added something good to your character and something a bit unique.
The only real bug with this code, is because of the NoMusic state, in WinMUGEN, the music may skip in the next round.
I would like to thank Elecbyte for those documents on MUGEN