News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Variable divided by variable

Started by Alzter, July 29, 2018, 01:20:11 PM

Previous topic - Next topic

Alzter

I need help. I'm trying to divide a variable by another variable, but it keeps giving me zero.

Variable 55 is always 100 (for now), and Variable 54 starts at the value of Variable 55 and goes down each frame until it reaches zero. Var(54)/Var(55) however, does not give me a decimal value representing (variable 54) percent of (variable 55). It just outputs zero.

I'm trying to scale an explod so it shrinks vertically until disappearing. Oddly, setting it's vertical scale to 1/2 just makes it invisible.

Help?

Lurker

Use Fvar instead, var only returns whole numbers.
Beware that mugen only supports 40 Fvars from 0 to 39.

VictorCYBR

I don't think you need variables to achieve what you want. You can use modify explod and use something like this:

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = NumExplod(number) ; or whatever trigger you want to use
ID = number
scale = 1, 1 -(0.5 * time)


You can play with numbers here to see what fits better.

Manson Rees

var(54)/(var(55)*1.0) is a alternative too.

Odb718

Alzter, if the explod has transparency added or subtraction added sometimes mugen just messes up. I forget exactly why. But I think you'll want to make your modifyexplod with all of the attributes and work backwards.
Lurker is correct if you want decimal places working with vars. Manson Rees' method can be used too.

DeathScythe's method can also work but you'll need to do extra math if you need it to happen over a specific period of time. Meaning you'll have to change the values to get what you want to happen perfectly. Shouldn't be too hard.

Look in mugen help for the explod/modifyexplod sections. I think the problems were worked out there.
vVv Gouken718 vVv SabreTooth718 vVv


Alzter

#5
I fixed it!! I did scale = 0.8,0.8*root,var(54)/(root,var(55)).

Odb718

Dont forget to press the Solve button once you get a solution to the problem next time.
vVv Gouken718 vVv SabreTooth718 vVv