• Welcome, Guest. Please login.
 
April 29, 2024, 03:39:43 AM

News:

Anyone found direct-linking to our files will be perma-banned. Click here for more info.


Lifefill Tutorial

Started by Neon_Tiger, March 21, 2006, 02:43:28 PM

Previous topic - Next topic

UHMEEEEBA

Quote from: Neon_Tiger

Remember how in the old NES games bosses fell down from the screen and would have their lifebars fill? Well with a little bit of ingenuity you can have a similar effect in MUGEN.

First and foremost you must know your characters maximum health, in this case we will call it H, this will come in handy again later. You also need a jumping sprite, and preferebly a crouching one. You can use any of the sounds included in the file above, for reference state lets say you put this sound at "X, Y". However, not all the sounds are the same length thus meaning that the time of this may vary, 60 ticks are in 1 second so multiply the time in seconds by 60 to get your total time, we shall call this L. Finally, the amount of Life added to the character in the second state is logically therefore a function of the total health over the duration of the sound, in other words.

Lifeadd Value = (H/L)

Keep that in mind. The first state will be refered to as Q, the second one should be one higher than Q, in other words Q+1.

;---------------------------------------------------------------------------
[Statedef Q]
type = S
ctrl = 0
velset = 0,0
anim = 41
;If you are using an anim, besides the default jumping one, put it there.

[State Q, Musicless]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State Q, Decrease life]
type = LifeSet
trigger1 = Time = 0
value = 1

[State Q, What he's a Robot, he jumped]
type = PosSet
trigger1 = Time = 0
y = -300

[State Q, Fall]
type = VelSet
trigger1 = Time = 0
y = 7

[State Q, Go to Part Dos]
type = ChangeState
trigger1 = Pos Y >= -1
trigger1 = Time > 0
value = Q+1
ctrl = 0
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[Statedef Q+1]
type = S
ctrl = 0
velset = 0,0
anim = 40
;If you are using an anim besides the default crouch one, put it there.

[State Q+1, Orginal Intro]
type = PosSet
trigger1 = Time = 0
y = 0

[State Q+1, Get Up]
type = ChangeAnim
trigger1 = Time = 6
value = *put value posing animation here*
;This changes the anim to the pose Animation.

[State Q+1, Musicless]
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nomusic

[State Q+1, LifeBar filling up SFX]
type = PlaySnd
value = X, Y
trigger1 = Time = 0
channel = 9
volume = 100

[State Q+1, LifeBar filling up]
type = LifeAdd
trigger1 = Time < L
value = H/L
;Round to the next highest whole value for H/L. I.e. if it equals 3.1, use 4.

[State Q+1, Go to Part Tres]
type = ChangeState
trigger1 = Time = L
value = 0
;---------------------------------------------------------------------------

Finally add this into your State -2, failure to do so will result in your character having less life if the intro is skipped.

;---------------------------------------------------------------------------
[State -2, Full Life if skipped Old intro]
type = LifeAdd
trigger1 = prevstateno = Q+1
trigger2 = (prevstateno = Q) && (stateno = 0)
Value = H

[State -2, Disable Intro SFX's if intro is skipped]
type = StopSnd
trigger1 = prevstateno = Q+1
channel = 9
;---------------------------------------------------------------------------

Heres a file that gives you the sound effect from the NES MegaMan games: Here

Please credit me if you decide to use this, thanks.