YesNoOk
avatar

Problem with Helpers and variables (Read 1565 times)

Started by shadowuy, October 08, 2017, 01:03:51 am
Share this topic:
Problem with Helpers and variables
#1  October 08, 2017, 01:03:51 am
  • avatar
  • *
    • Uruguay
I want to create a helper that changes the players transparency with the press of a button.  also, if the button is pressed again it should return to the original transparency here is what i got so far

Code:
[statedef 6550]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 66655228


[state 6550, VARIABLES OFF]
type = varset
trigger1 = 1
v = var(0)
value = 0


[state 6550]
type = changestate
triggerall = time != 0
trigger1 = parent,command = "50% transparency"
value = 6551

[statedef 6551, VARIABLES ON]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 66655228

[state 6551, VARIABLES ON]
type = varadd
trigger1 = 1
v = var(0)
value = 1

[state 6551]
type = changestate
triggerall = time != 0
trigger1 = parent,command = "50% transparency"
value = 6550

in the command file:

Code:
[State -1, TRANSPARENCY CONTROLLER]
type = Helper
triggerall = alive&&Roundstate=2
triggerall = numhelper(8741) = 0
trigger1 = stateno = 6062
name = "TRANSPARENCY CONTROLLER"
id = 8741
stateno = 6550
pos = 0, 0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
;persistent = 0
sprpriority = 7
The problem that i have is that when it returns to 6550 the variable doesnt set itself to 0. I dont know what might be causing it. When i press the button it changes the transparency, then when i press it again it does nothing. somebody could help me? thx
Last Edit: October 08, 2017, 01:07:25 am by shadowuy
Re: Problem with Helpers and variables
#2  October 08, 2017, 02:46:03 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Var ztarts round at 0. This is normal. However you then tell the game to use the value of var(0) as the var id.

Should be
V = 0

Then youll get what you're after


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.
Re: Problem with Helpers and variables
#3  October 08, 2017, 02:57:11 am
  • avatar
  • *
    • Uruguay
Var ztarts round at 0. This is normal. However you then tell the game to use the value of var(0) as the var id.

Should be
V = 0

Then youll get what you're after

Omg :S the whole day trying to find a way out and it was that simple.... i really apreciate it thank you :S