Meter math help

Started by Ichisennen, June 12, 2011, 09:42:17 AM

Previous topic - Next topic

Ichisennen

I'm making a meter which fills up whenever my character does an attack and/or gets attacked. So this means that I'd have to scale my sprite of the meter "filling" with a variable, right? Or is there another way to go about this.

If I did make it "fill" by scaling, I'm having a hard time with the equation, except that I know I would need to set a permanent variable with the equation.

Then the equation would have to be values of less than one, meaning 30% of the bar would be 0.3, since the meter "filling" sprite is perfectly scaled to the bar. Hence if bar was 43% filled, scale of it would be var(**),1 with var(**) being the equation, and it being 0.43.... right?

I was never good at math, more so mugen Math. I stay away from it when coding, but I guess it's inevitable. Anyway, how do I go about this?

Rajaa Retired

You have a max value for your equation. Let's say the max value is 100. You have a variable that keeps track of how much of the value you actually have, let's say you have 50 out of 100. The variable represents 50.

You divide the variable by the max value the bar should be able to achieve: var(0)/100. 50/100 is equal to 1/2, so your bar will be scaled to 50% of its maximum size. Pretty simple. =p

Ichisennen

Okay I'm not that dumb.. I went to school y'know. I guess I didn't ask it right.  :sugoi:

First off, I don't know how to keep track of the damage I deal... I know that value = GetHitvar(damage) aligned with a variable will keep count of damage dealt to me, but what about damage I deal? What should I put in the value of a varset?

Then.. it'd be something like:

State varset
trigger=**
v = **
value= var(damage)+var(damagedealt)/1000[cuz max value is 1, like I said and since mugen damage is in the hundreds]

So yeah, what do I do to keep track of the damage I deal? And is there something wrong with my proposed eq?

Rajaa Retired

Quote from: Ichisennen on June 12, 2011, 10:49:21 AM
Okay I'm not that dumb.. I went to school y'know. I guess I didn't ask it right.  :sugoi:
Your first post told us that you didn't know what you were doing because you weren't good at math and that you wanted help on the equation for scaling a meter. :blank:




The damage you deal can't really be tracked with any specific trigger. And you need to use a varadd for this to work correctly. Since you said you already know how to track damage that is dealt to yourself, I won't get into that.

Here's a way you can track the damage you deal to others:

In every hitdef you have, set a variable that equals the amount of damage you will deal, like so:

[state]
type = hitdef
damage = var(0) := 80, var(1) := 7

That does 80 damage if hit and 7 if guarded. It also sets the corresponding variables to those values; the use of the colons make that happen.

After you do that, you should have another variable that adds those variables to itself on movecontact. Like so:

[state]
type = varadd
trigger1 = movecontact = 1
var(2) = cond(movehit, var(0), var(1))

That will add the damage you dealt to var(2) and you can just base your meter off of var(2). 

You don't need two variables to track the damage you're dealt and the damage you deal, just use one since they're both being used for the same meter. Remember to reset your variables accordingly.


Ichisennen

I never knew about the colon thing before, god there's so much to learn  :sugoi:

I got what I needed now though, it's working, but adding that to all theses states...  :S

Thanks Rajaa  :sugoi:

Rajaa Retired

If you have any problems with hitpauses, then post here.

And you shouldn't have that many hitdefs that you can't finish adding that piece of code to them in about 10 minutes. If you do, then excuse me.

Ichisennen

Is back for a follow up question.

Got all variables working in place, same as for the meter but modifyexplod makes the meter disappear for some reason. I'll just post code as an example.

let's say this is an attack

;---------------------------------------------------------------------------
;Shatter
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 3
ctrl = 0
anim =IfElse(var(31)>=1,10210,210)
[State 0, VarRandom]
type = VarRandom
trigger1 = time=0
v = 38
range = 1,5
[State 0, VarSet]
type = VarSet
trigger1 = animtime=0
v = 38    ;fv = 10
value = 0
[State 0, Width]
type = Width
trigger1 = 1
player = 21,21
[State PlaySnd]
type = PlaySnd
triggerall = anim = 210 || anim = 10210
trigger1 = animelem = 4
value = S11,var(38)
volume = 100

[State 200, Explod]
type = Explod
triggerall = var(30) = 0
trigger1 = animelem = 2
anim = 111
ID = 4012
pos = 10,36
postype = p1
facing = 1
vfacing = 1
bindtime = 999
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 1
x = 4
y = 0

[State Hitdef]
type = HitDef
trigger1 = anim = 210 && animelem = 4
attr = S, SA ;Attribute: Standing, Normal Attack
givepower = 15, 10
getpower = 0
damage = var(40) := 10, var(41) := 2 ;Damage that move inflicts, guard damage
animtype = medium ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA ;Flags on how move is to be guarded against
hitflag = MAF ;Flags of conditions that move can hit
priority = 3, Hit ;Attack priority: 0 (least) to 7 (most), 4 default ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 7,12 ;Time attacker pauses, time opponent shakes
sparkno = s663 ;Spark anim no (Def: set above)
sparkxy = 0, 0 ;X-offset for the "hit spark" rel. to p2, ;Y-offset for the spark rel. to p1
hitsound = s1,1 ;Sound to play on hit
guardsound =  s100, 2
ground.type = High ;Type: High, Low, Trip (def: Normal)
ground.hittime  = 8 ;Time opponent is in hit state
ground.velocity = -10 ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8 ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-1 ;X-velocity at which opponent is pushed
air.hittime = 12

[State Hitdef]
type = HitDef
trigger1 = anim = 10210 && animelem = 4
attr = S, SA ;Attribute: Standing, Normal Attack
givepower = 15, 10
getpower = 0
damage = var(40) := 10, var(41) := 2 ;Damage that move inflicts, guard damage
animtype = medium ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA ;Flags on how move is to be guarded against
hitflag = MAF ;Flags of conditions that move can hit
priority = 3, Hit ;Attack priority: 0 (least) to 7 (most), 4 default ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 5,10 ;Time attacker pauses, time opponent shakes
sparkno = s663 ;Spark anim no (Def: set above)
sparkxy = 0, 0 ;X-offset for the "hit spark" rel. to p2, ;Y-offset for the spark rel. to p1
hitsound = s1,1 ;Sound to play on hit
guardsound =  s100, 2 ;Sound to play on guard
ground.type = High ;Type: High, Low, Trip (def: Normal)
ground.hittime  = 8 ;Time opponent is in hit state
ground.velocity = -10 ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8 ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-1 ;X-velocity at which opponent is pushed
air.hittime = 12
[State 0, VarSet]
type = VarSet
trigger1 = movecontact
v = 11    ;fv = 10
value = 1

[state driveadd]
type = varadd
trigger1 = movecontact = 1
var(42) = cond(movehit, var(40), var(41))

[State Changestate]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


This is the equation in the -2 state, and the helper


[Statedef -2]
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 42   
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 43    ;fv = 10
value = GetHitVar(damage)
[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 23
value = var(42)+var(43)/1000
[State 0, Helper]
type = Helper
trigger1 = numhelper(9112) != 1
helpertype = normal ;player
name = "MeterFX"
ID = 9112
stateno = 9112
pos =10,150
postype = left 
facing = 1
keyctrl = 0
ownpal = 1
supermovetime=9999
pausemovetime=9999
size.xscale = 1
size.yscale = 1
removetime = 1
size.shadowoffset = 999


this is the state of the bar itself:


[statedef 9112]
movetype = I
physics = U

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9975
ID=9111
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 18
ontop = 0

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9975
ID=9114
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 18
ontop = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID = 9111
scale = fvar(23),1


Now, whenever I null the modifyexplod... the meter is there. But whenever I do turn it on, meter disappears... I don't know what I'm doing wrong. Help?

2OS

scale=ROOT,fvar(23),1


The reason it's disappearing is because all vars default to 0 until re-defined and helpers have their own vars. Since fvar(23) has no definition in the helper, it's equivalency is 0, therefore xscale is 0, therefore you see 0.

You set fvar(23) in a root state [ Statedef -2 ]. So you need to redirect to root.

In this case, the root is the helpers parent, so you can actually redirect to parent or root.

Ichisennen

I forgot, you have to add root when defining a var of the parent... It always slips my mind  :P Thanks 2OS.

Follow up question though. After checking if setting fvar(23) to value =2 would work after doing root,fvar(23),1 [which it did], I then replaced my original EQ back to its place, it seems that the meter does show although it does show when fvar(23) hits 1, aka when the meter is full. And that's assuming I do a combo.

Meaning, if fvar(23) had a value of 0.6 or something, meter doesnt show, but when it hits 1.0... tadaa it magically appears. Another condition is that I should reach that amout when I do or get hit by a combo. The graduation of the sprite itself doesnt show, but mugen does compute my equation correctly and keeps track of it, although it resets when I stop attacking/ getting attacked.

Like I said I hate vars and numbers.. forgive me, but what part of my code makes this foolishness keep on happening?

I think its a trigger concerning my -2 state vars.. But I'm not sure. Help?

2OS

I can't give a solid answer without my own trials and errors when it comes to math.

Cybaster

Most probably has to do with a cast to integer problem.

In state -2, change :

value = var(42)+var(43)/1000

by :

value = 1.0*var(42)+1.0*var(43)/1000.0


To check, please put fvar(23) in displaytoclipboard.

Ichisennen

#11
Quote from: 2OS on June 15, 2011, 03:25:11 AM
I can't give a solid answer without my own trials and errors when it comes to math.

So... you're gonna take a rain check on your answer or... that's a "sorry can't help you no more" thing?

Quote from: Cybaster on June 15, 2011, 04:16:59 AM
Most probably has to do with a cast to integer problem.

In state -2, change :

value = var(42)+var(43)/1000

by :

value = 1.0*var(42)+1.0*var(43)/1000.0


To check, please put fvar(23) in displaytoclipboard.

OMFG its Cybaster!  :o *is honored*

anyway, did what you said. Sadly, meter still doesnt show. Replacing fvar(23) into =2 shows that fvar(23) does work, but it's something with the equation. ANd I have no idea what "cast to integer problem" means...

EDIT:

Got the damn thing to work now.

Although, I displayed to clipboard liek Cybaster said, but I encountered an entirely different and irritating problem:

"WARNING: Player *****(56) in state 5900: can't map pallete 1.1 to 1.2"
and
"WARNING: Player *****(56) in state 3376:changed to invalid state 3376(from 3376)"

I don't know what warning one meant, but i'm sure as hell that I dont even HAVE state 3376 in my code.  :-\

So yeah, different problem now: what does the first debug warning mean, and why do I have that invalid state debug flood when I dont even have state 3376?

Rajaa Retired

Why are you using three variables for this meter? All you need is one variable that increases every time you are hit and every time you hit an opponent, not two variables that have two totally different values added together, unless you're limiting each variable to a certain fraction that adds up to a whole. And you only need to use a varset sate controller to reset the meter variable.

To set the scale via variable in the modify explod, just use this: scale =[your variable here]/1000; no need for two variables.




I know you might have trouble with adding the damage you deal to your variable, so you can just use a separate variable for that and then add it to the main variable on movecontact. Like so:


[State 200, Medium Punch]
Type = HitDef
Damage = Var(42) := 100, Var(43) := 50

[State -2, Add damage dealt to meter scaling variable]
Type = VarAdd
Trigger1 = MoveContact = 1
FV = 23
Value = Cond(MoveHit, Var(42), Var(43))

[state -2, Add damage receive]
Type = VarAdd
Trigger1 = You're gonna need to find a way to trigger this once per each time you're hit.
fv = 23
Value = GetHitVar(Damage)


After understanding that bit about the damage dealt and enacting it, you'll get hitpause problems. So to make the damage dealt varadd activate only once per hit and ignorehitpause, you will need another variable. You will use it like this:


[State -2, Detect Hit Pause Time]
Type = Varset
Trigger1 = Var(0) < 0
Trigger1 = MoveContact = 1
Var(0) = HitPauseTime
IgnoreHitPause = 1

[State -2, Reset Hit Pause Time Variable]
type = Varset
Trigger1 = 1
Var(0) = -1


The first varset is used so you can detect the hitpause of your move, it'll stay each hitpause tick's value once until it reaches 0 since it's ignoring any hit pauses. That combined with the "movecontact = 1" allows you to use the one tick that var(0) does equal your actual hitpausetime to trigger a state controller only once. The second varset doesn't ignore any hit pause so it'll automatically reset the variable when any hitpause is over.

Now, you can trigger the varadd like this:


[State -2, Add damage dealt to meter scaling variable]
Type = VarAdd
Trigger1 = Var(0) = HitPauseTime
Trigger1 = Var(42) !=0 || Var(43) != 0
Trigger1 = MoveContact=1
fv = 23
Value = Cond(MoveHit, Var(42), Var(43))


You should place those in correct syntactical order with the two varsets above (in between them is correct). Ignore my usage of Var(43) if you don't want to add the chip damage dealt. You can ignore all of this if it's working the way you want it to work, but I don't see how a meter can work the way you want it to work if it's just setting the values, there's nothing really accumulating.




As for these:

Quote from: Ichisennen on June 15, 2011, 03:11:06 PM
"WARNING: Player *****(56) in state 5900: can't map pallete 1.1 to 1.2"

You have a remappal in your statedef 5900 and the character doesn't have palette 1.1, or 1.2.

Quote from: Ichisennen on June 15, 2011, 03:11:06 PM
"WARNING: Player *****(56) in state 3376:changed to invalid state 3376(from 3376)"

Quote from: Ichisennen on June 15, 2011, 03:11:06 PM
i'm sure as hell that I dont even HAVE state 3376 in my code.  :-\
Exactly, it's invalid because you don't have it and you're directed to it somewhere in your code. The debug should tell you where and when. Always keep debug on when creating a character.

2OS

Quote from: Ichisennen on June 15, 2011, 03:11:06 PM
Quote from: 2OS on June 15, 2011, 03:25:11 AM
I can't give a solid answer without my own trials and errors when it comes to math.

So... you're gonna take a rain check on your answer or... that's a "sorry can't help you no more" thing?

It was more of a ""let me try to fix it, if I do, I'll give elaboration and maybe you'll learn something from it"".

Ichisennen

Quote from: 2OS on June 15, 2011, 04:08:12 PM
Quote from: Ichisennen on June 15, 2011, 03:11:06 PM
Quote from: 2OS on June 15, 2011, 03:25:11 AM
I can't give a solid answer without my own trials and errors when it comes to math.

So... you're gonna take a rain check on your answer or... that's a "sorry can't help you no more" thing?

It was more of a ""let me try to fix it, if I do, I'll give elaboration and maybe you'll learn something from it"".

Lol, aight dude :sugoi:

@Rajaa, Thanks for showing me the simpler method, I really made it overcomplicated with two variables.
About the detect hitpausetime though.... It's giving an error.. :\ So I'll leave that for the time being

Anyway, I've come across another problem. I'm trying to make the meter reset when it reaches full, AKA fvar(23)=1. So i did this:

[State 0, VarSet]
type = VarSet
trigger1 =fvar(23)<=1
fv = 23 
value = var(42) *which is the now single variable*/1000.0

[State 0, VarSet]
type = VarSet
trigger1 =fvar(23)>1
fv = 23 
value = 0[/code
]This is because when It reaches full, the bar is supposed to "blink", then the helper will change state into another different looking meter. This is how i added the changestate:
[code]
;-------------------------------------------------------------------
[statedef 9876]
movetype = I
physics = U

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9876
ID=9876
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 10
ontop = 0

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9876
ID=9876
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0

random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 10
ontop = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =root,fvar(23)>1
ID = 9876
removetime = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = root,fvar(23)> 1
value = 9877
ctrl = 0


So, when fvar(23) hits>1, it will go to 9877. BUT, that won't happen since fvar(23) resets on the -2 state right? So, what can I do so that before it resets, the helper will changestate first? Then after that, it will reset? I tried varset, but i cant affect a parent's var in a helper state... right?.... help?


Cybaster

Quote
I tried varset, but i cant affect a parent's var in a helper state... right?

parentvarset

:P

Ichisennen

#16
Quote from: Cybaster on June 16, 2011, 02:47:11 AM
Quote
I tried varset, but i cant affect a parent's var in a helper state... right?

parentvarset

:P

:P I... feel so dumb.

BTW, what does "expected float value and read int" error mean?

Regarding these:
Quote
Quote from: Ichisennen on Yesterday at 08:11:06 am
"WARNING: Player *****(56) in state 5900: can't map pallete 1.1 to 1.2"

You have a remappal in your statedef 5900 and the character doesn't have palette 1.1, or 1.2.


Quote from: Ichisennen on Yesterday at 08:11:06 am
"WARNING: Player *****(56) in state 3376:changed to invalid state 3376(from 3376)"

Quote from: Ichisennen on Yesterday at 08:11:06 am
i'm sure as hell that I dont even HAVE state 3376 in my code.  Exactly, it's invalid because you don't have it and you're directed to it somewhere in your code. The debug should tell you where and when. Always keep debug on when creating a character.

Like I said, I have no, i mean none, mention of a state 3376 anywhere in my codes. And I dont have state 5900 as well. Nor any direction of any changestate to that state. So yeah, bug?

A little bit more...Help please? 

EDIT:

More problems with the meter. Let's say the meter fills, that's level 1. The requirement for that is that fvar(23)=1. When fvar(23) reaches 1, the helper meter goes to another state. Then it'd have to go to another process of it being fvar(23)=1 to reach lvl 2, 3 and so on. Two problems with that:

Here's the whole code:

;-------------------------------------------------------------------
;BAR FXlevel 0
[statedef 9876]
movetype = I
physics = U

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9876
ID=9876
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 10
ontop = 0

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9876
ID=9876
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0

random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 10
ontop = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =root,fvar(23)>1
ID = 9876
removetime = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = root,fvar(23)> 1
value = 9877
ctrl = 0
;-------------------------------------------------------------------
;Meter
[statedef 9112]
movetype = I
physics = U

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9975
ID=9111
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 8
ontop = 0

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9975
ID=9114
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 8
ontop = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID = 9111
scale =root,fvar(23),1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "fvar(23) = %d"
params = fvar(23)
;-------------------------------------------------------------------
:BarFX lvl 1
[statedef 9877]
movetype = I
physics = U
anim = 8715

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9877
ID=9881
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1.1,1
sprpriority = 9
ontop = 1

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9877
ID=9881
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1.1,1
sprpriority = 9
ontop = 1

[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
v = 45   ;fv = 10
value = 1

[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
var(42) = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =root,fvar(23)>1.1
ID = 9881
removetime = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = root,fvar(23)> 1.1
value = 9878
ctrl = 0
;-------------------------------------------------------------------
;BarFX lvl 2
[statedef 9878]
movetype = I
physics = U

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9878
ID=9887
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1.1,1
sprpriority = 8
ontop = 0

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9878
ID=9887
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1.1,1
sprpriority = 8
ontop = 0

[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
v = 45   ;fv = 10
value = 2

[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
var(42) = 0  ;fv = 10

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =root,fvar(23)>1.2
ID = 9887
removetime = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = root,fvar(23)> 1.2
value = 9879
ctrl = 0
;-------------------------------------------------------------------
;BarFX lvl 3
[statedef 9879]
movetype = I
physics = U

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
var(42) = 0  ;fv = 10
[State 0, explod]
type = Explod
triggerall = teamside = 1
trigger1=time=0
anim = 9879
ID=9879
pos=83,220
postype=left
facing=1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 8
ontop = 1

[State 0, explod]
type = Explod
triggerall = teamside = 2
trigger1=time=0
anim =9879
ID=9879
pos=-83,220
postype=right
facing=-1
vfacing=1
bindtime=99999
vel=0,0
accel=0,0
random=0,0
removetime=-1
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 8
ontop = 1

[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
v = 45   ;fv = 10
value = 3

[State 0, VarSet]
type = ParentVarSet
trigger1 = time=0
var(42) = 0  ;fv = 10
;=|Statedef -2|=====================================================
;Always execute these.
[Statedef -2]

[state driveadd]
type = varadd
trigger1 = movecontact = 1
var(42) = cond(movehit, var(40), var(41))

[State 0, VarSet]
type = VarAdd
trigger1 = 1
v = 42    ;fv = 10
value = gethitvar(damage)

[State 0, VarSet]
type = VarSet
triggerall = var(30)=0
trigger1 =1
fv = 23  ;fv = 10
value = var(42)/1000.0


The Dillemas:

One, when fvar(23) reaches 1, that means meter full. The Bar goes up a level, so the Bar Helper changestates into another state. Problem is, the damn bar fx directly changes to lvl 3 for some reason, unless I heighten the requirement per level, which I shouldn't do.

Second, I want to make fvar(23), aka the meter var, stop filling when Bar reachers lvl 3. I've been trying my ass off for like 4 hours to do so, but I just cannot for the life of me do so..

Help?