News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Var Help!

Started by GOD984, November 24, 2015, 11:37:49 PM

Previous topic - Next topic

GOD984

Hello, I'm having some trouble using this var code.

[state - 2]
type=varset
triggerall = command = "a" || command = "b" || command = "c" || command = "x" ||  command = "z"
trigger1 = !time
var(95055) = 0


[State 0, varadd]
type = varAdd
trigger1=command="y"
var(95055)=1

[State 0, PowerAdd]
type = PowerAdd
triggerall = command = "y"
trigger1 = var(95055) = 0
value = -250

[State 0, PowerAdd]
type = PowerAdd
triggerall = command = "y"
trigger1 = var(95055) = 1
value = -500

[State 0, PowerAdd]
type = PowerAdd
triggerall = command = "y"
trigger1 = var(95055) = 2
value = -750

[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(95055) = 3
value = -1500

Felkazz

You can't use var(95055)...
Mugen gives each char 60 vars (from 0 to 59) and 40 fvars (from 0 to 39), you can't use a higher var.

BlackFired

If you use the code well, you stop giving error. Obviously the reason is so the friend said top ^^^

[state - 2]
type=varset
triggerall = command = "a" || command = "b" || command = "c" || command = "x" || command = "z"
trigger1 = !time
var(55) = 0

[State 0, varadd]
type = varAdd
trigger1=command="y"
var(55)=1

[State 0, PowerAdd]
type = PowerAdd
triggerall = command = "y"
trigger1 = var(55) = 0
value = -250

[State 0, PowerAdd]
type = PowerAdd
triggerall = command = "y"
trigger1 = var(55) = 1
value = -500

[State 0, PowerAdd]
type = PowerAdd
triggerall = command = "y"
trigger1 = var(55) = 2
value = -750

[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(55) = 3
value = -1500

GOD984

I did, the var isn't being used any where else [var(59)]  It still is not working.

Odb718

#4
Use debug by pressing ctrl+d.
You'll need to set up a displaytoclipboard in statedef -2.

use something like
[State -2, Debug data]
type = displaytoclipboard
trigger1 = time >= 0
text = "P2 X = %f,Front =%d, groundfront = %d, pos y = %d, var59 = %d"
params = p2dist x, FrontEdgeDist, enemynear,const(size.ground.front), pos y, var(59)


The code you have is going to kill 2750 power in 3 tics. In 1 twentieth of a second. You might want to reconsider your timing.
It might be why your code doesnt work. In 4 tics, 1 fifteenth of a second, there's no active code.
[State 0, varadd]
type = varAdd
trigger1=command="y"
var(59)=1 ;time = 4 = var(59) = 4

If you didnt have the jump from 2 to 3, from 750 to 1500 you could simplify your poweradd code too.
[State 0, PowerAdd]
type = PowerAdd
trigger1 = command = "y" 
value = -250+floor(-250*var(59))

^^ -250+0, -250+-250, -250+-500, -250+-750. You might not need the floor() but sometimes things will kick out errors.
vVv Gouken718 vVv SabreTooth718 vVv


Noctis

[state - 2]
type=varset
triggerall = command = "a" || command = "b" || command = "c" || command = "x" ||  command = "z"
trigger1 = !time
var(55) = 0

the trigger1 makes it so that it sets to 0 on the first tick of every single state you go into just in case no one caught this. Maybe this could be your problem? You didn't really say what your problem was at ALL.

Also, by the way they're organized, the first poweradd won't work. The varadd must be below all of the poweradds (I might be wrong. Dyslexia can be a real bitch sometimes. Try it out both ways, but I'm pretty sure it's what I said.)

I'm assuming you want the var to go back to 0 when a different command is pressed or when it's hit the max? Which I'm assuming is 3?

[state - 2]
type=varset
trigger1 = command = "a" || command = "b" || command = "c" || command = "x" ||  command = "z"
trigger2 = var(55) >= 3
var(55) = 0

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

Cyanide

It only does that if the command is any of those buttons though. If he's pressing nothing, it does nothing.

What do you actually want to achieve, is this part of an attack in some way? Why are you doing this in state -2, is it impossible to do in the attack itself for some reason? I mean, i think what you want to do based on what i'm reading is each time you press Y you lose some power. Are you losing it because Y is an attack? Can we code this into the Y attacks somehow instead? It'll solve a lot of your problems if we do.


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.