Variable tutorials?

Started by Khali, May 05, 2010, 08:01:42 AM

Previous topic - Next topic

Khali

Is there any?  For the most part I'm going off of examples of characters.  My character has a forward/back dash afterimage.  Code here:
[State 100, AfterImage]
type = AfterImage
;trigger1 = PalNo = 1
trigger1 = AnimElem = 4
time = 1
length = 20
palbright = 0,0,0
palcontrast = 255,0,0
alpostbright = 0,0,0
timegap = 1
flamegap = 1
trans = add1

[State 100, AfterImageTime]
type = AfterImageTime
trigger1 = 1
time = 2


I'm using the color red, because the character's outfit is red, however with different palettes I want the afterimage to copy the palette.  I can add several afterimage codes with the trigger "PalNo = " and call them all that way, but thats a lot of extra code.  I was wondering if there's anyway I can make a variable that is always active, that can check the PalNo, and return basicly "If this palette is palette 2, use variable 2"

I'm of course hoping the final code would look something like: "palcontrast = variable here"  But I'm not sure if Mugen's engine is capable of this or not...

Cyanide

You shouldn't need a tutorial.

varset
value = specific value. In your case

value = palno


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Khali

But that still doesn't help me at all.  I need to know how to make it check the palette number, and return a value for "palcontrast."

For example, if its palette 1, it should return as 255, 0, 0.  However, if it is palette 2, it should return as 0, 0,  255.

I need some way to check the palette, and return a value in palcontrast...I'm not sure if this is in any way on the right path, but I want it to look somewhat like this:
[State 100, AfterImage]
type = AfterImage
;trigger1 = PalNo = 1
trigger1 = AnimElem = 4
time = 1
length = 20
palbright = 0,0,0
;palcontrast = 255,0,0
palcontrast = var(0)
alpostbright = 0,0,0
timegap = 1
flamegap = 1
trans = add1

Is it also possible to call the variable globally?  I want to use the same variable for a few scripts, I'm just wondering if I have to use a new varset, or if I can use a universal one?

Cyanide

No, it wouldn't work like that.

Palcontrast takes 3 arguements, not just one. How many different values do you actually require here? The easiest option might be 3 variables and a couple of expressions

palcontrast = var(1)+(255*palno = 1),var(2),var(3)

Set them to certain values based on palette and multiply or something. Like the above. In this situation, multiple palfx's may simply be the easiest option.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Khali

Seems I may have to use multiple palfx triggered by palno = *.  I just wanted to know if there was a way I could make one PalFX that checks the PalNo and returns a palcontrast.