YesNoOk
avatar

Enable Variable in a Round  (Read 297 times)

Started by GoldingCircle, October 12, 2011, 03:02:53 am
Share this topic:
Enable Variable in a Round
#1  October 12, 2011, 03:02:53 am
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
I have this code like this:
Code:
[State -3, Set Projectile Pack]
type = VarSet
triggerall = var(14) = 0
trigger1 = RoundState = 0
trigger1 = teamside = 1 || teamside = 2
trigger1 = time = 1
trigger2 = roundno = 0
v = 14
value = 30
During the Survival rounds, I want the character to set its variable during rounds it does not appear (at like the one replacing for what I put, roundno = 0)? 
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.
Re: Enable Variable in a Round
#2  October 12, 2011, 05:41:39 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Roundstate = 0 doesn't normally have a time = 1 and is instant.

Roundno starts at 1 not 0.

If your code isn't working cut down on your triggers and make them simpler. Troubleshoot. Make them simple. Time = 1, stateno = 0, that sort of thing.


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: Enable Variable in a Round
#3  October 12, 2011, 01:13:46 pm
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
Roundstate = 0 doesn't normally have a time = 1 and is instant.

Roundno starts at 1 not 0.

If your code isn't working cut down on your triggers and make them simpler. Troubleshoot. Make them simple. Time = 1, stateno = 0, that sort of thing.

I know that. But I want the variable to set once, not continuously. Any Ideas?
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.
Re: Enable Variable in a Round
#4  October 12, 2011, 03:17:52 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
You could use a helper. Summon the helper once, using the conditions you are using for the varset. and make sure one of your triggeralls is !NumHelper(#). Then in the helper's state, use a ParentVarSet with a trigger of !time. That should do it for you.

-[Все слова это только слова.]-
Re: Enable Variable in a Round
#5  October 12, 2011, 09:19:27 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Don't do that, far too much work for something simple.

His problem is the variable isn't setting. I have given him a simple process to make sure it will set (something he doesn't seem to understand) Once it sets correctly he can make it much stricter. For now the important thing is for him to get the variable to set.


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: Enable Variable in a Round
#6  October 12, 2011, 09:51:18 pm
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
You could use a helper. Summon the helper once, using the conditions you are using for the varset. and make sure one of your triggeralls is !NumHelper(#). Then in the helper's state, use a ParentVarSet with a trigger of !time. That should do it for you.
Thanks that worked! But now their is a helper that appears when the variable is 0 at the start of the round.:
Code:
[State -3, Bag Refill]
type = Helper
trigger1 = random < 2 && numhelper(713) = 0 && var(14) = 0
trigger2 = !random > 2 && roundstate != 0
helpertype = normal
name = "Bag Drop"
ID = 713
stateno = 713
pos = 0,-240
postype = back
ownpal = 1
How can I fix this?
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.
Re: Enable Variable in a Round
#7  October 12, 2011, 10:52:54 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Sigh. I will break your original trigger set down.
[mcode][State -3, Set Projectile Pack]
type = VarSet
triggerall = var(14) = 0 ;Won't set unless the variable is 0, ie do so once
trigger1 = RoundState = 0 ;state 5900 only, ends on time = 0
trigger1 = teamside = 1 || teamside = 2 ;True regardless, waste of trigger
trigger1 = time = 1 ;doesn't happen in state 5900 so not triggering anyway
trigger2 = roundno = 0 ;doesn't exist.
v = 14
value = 30[/mcode]

As i said. When something is giving you a problem MAKE IT SIMPLER. Your above is not only formatted incorrectly but it's very strict when all you want to do is set a variable to 30 at the start of the round.

type = varset
trigger1 = var(14) != 0
trigger1 = roundstate = 1
v = 14
value = 30

Var(14) will be = 30 after this so it will not trigger again. If you want it to persist between rounds make use of intpersistindex. You really really really need to learn to troubleshoot things.


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: Enable Variable in a Round
#8  October 12, 2011, 11:06:18 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Sigh. I will break your original trigger set down.
[mcode][State -3, Set Projectile Pack]
type = VarSet
triggerall = var(14) = 0 ;Won't set unless the variable is 0, ie do so once
trigger1 = RoundState = 0 ;state 5900 only, ends on time = 0
trigger1 = teamside = 1 || teamside = 2 ;True regardless, waste of trigger
trigger1 = time = 1 ;doesn't happen in state 5900 so not triggering anyway
trigger2 = roundno = 0 ;doesn't exist.
v = 14
value = 30[/mcode]

As i said. When something is giving you a problem MAKE IT SIMPLER. Your above is not only formatted incorrectly but it's very strict when all you want to do is set a variable to 30 at the start of the round.

type = varset
trigger1 = var(14) != 0
trigger1 = roundstate = 1
v = 14
value = 30

Var(14) will be = 30 after this so it will not trigger again. If you want it to persist between rounds make use of intpersistindex. You really really really need to learn to troubleshoot things.

var(14)!=0? Since all variables start at 0 before set, this won't ever trigger. Am I wrong? Shouldn't it be !var(14) or var(14)=0?

-[Все слова это только слова.]-
Re: Enable Variable in a Round
#9  October 12, 2011, 11:14:09 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Sorry, yes. That should actually be

var(14) != 30

And that's part of the problem with his original trigger too.


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: Enable Variable in a Round
#10  October 13, 2011, 01:39:50 am
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
Thanks!  :)
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.