Infinity MUGEN Team

IMT Discussions => M.U.G.E.N Discussion => Topic started by: Saohc on July 13, 2010, 11:04:02 PM

Title: Something cool I made you can add to your characters's coding..
Post by: Saohc on July 13, 2010, 11:04:02 PM
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:

Quote
;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[statedef -2]

Now you will have to add this to below "[statedef -2]"

Quote
;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:
Quote
;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:
Quote
;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:
Quote
;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:
Quote
[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":
Quote
;-------------------------
;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:

Quote
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

and above it add:

Quote
;----------------
;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 :)
Title: Re: Something cool I made you can add to your characters's coding..
Post by: Acey on July 19, 2010, 12:03:46 PM
So what does this code do exactly?
Title: Re: Something cool I made you can add to your characters's coding..
Post by: Saohc on July 22, 2010, 04:37:11 PM
Quote
This type of "Danger State" is similar to the ones seen in inFamous and Uncharted.

It turns the screen to black and white and the characters too.
In my character, a heartbeat sound plays..

The problem with the coding is, the PalFX can be overrided, so any suggestions would help fix up the code..
Title: Re: Something cool I made you can add to your characters's coding..
Post by: SanjiSasuke on August 05, 2010, 02:15:02 PM
I wish I could think of some more games that use this, that actually have characters, it would work well like that.
Title: Re: Something cool I made you can add to your characters's coding..
Post by: Alexziq on August 05, 2010, 02:59:42 PM
It's a cool little thing you did for fun.

I'd say the music skipping the next round is a pretty big issue though.
Title: Re: Something cool I made you can add to your characters's coding..
Post by: Saohc on August 08, 2010, 10:58:19 AM
It's a cool little thing you did for fun.

I'd say the music skipping the next round is a pretty big issue though.

I forgot to mention the fact that the PalFX can be overrided.
SimplePortal 2.3.5 © 2008-2012, SimplePortal