YesNoOk
avatar

[SOLVED] How to reset a variable when the character hit the ground? (Read 207 times)

Started by SignificantSlice, May 18, 2012, 09:03:37 am
Share this topic:
[SOLVED] How to reset a variable when the character hit the ground?
#1  May 18, 2012, 09:03:37 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
How to reset a variable when the character hit the ground? :-\
Last Edit: May 18, 2012, 01:39:12 pm by SignificantSlice
Re: How to reset a variable when the character hit the ground?
#2  May 18, 2012, 09:44:06 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
hit's as in lands, or hit's as in, is knocked over and falls on their back? The method differs a little for option number 2.


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: How to reset a variable when the character hit the ground?
#3  May 18, 2012, 10:01:26 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
it's better if i can use both  :)
Re: How to reset a variable when the character hit the ground?
#4  May 18, 2012, 10:14:45 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Varset with

var(number) = value && pos Y>= 0

Pos Y= 0 means you're on the ground. Using the value of the variable as well is simply a "don't keep triggering forever" thing. Put it in state -2.

And don't copy paste what i wrote it won't work, rework it to fit.


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: How to reset a variable when the character hit the ground?
#5  May 18, 2012, 10:45:22 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
i think you help me fix my problem with the reseting the variable but it won't let me do the same move again

Situation:
i have a move that is up to 5 secs and i can cancel it with a certain button so i tried it

when i cancel the move i can do the move again
but when i let the move finish it won't let my char do it again

this is the code i put

[State -2, VarSet]
Type = VarSet
Trigger1 = !time
var(40) = 1 && pos Y >= 0
Last Edit: May 18, 2012, 10:51:25 am by SignificantSlice
Re: How to reset a variable when the character hit the ground?
#6  May 18, 2012, 10:54:16 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Ok, that's my fault for not specifying that as a trigger

[state -2]
type = varset
TRIGGER1 = var(40) = value && pos Y>= 0
v = 40
value = whatever you need


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: How to reset a variable when the character hit the ground?
#7  May 18, 2012, 11:08:13 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
sir i think the one you suggested before is better
because now the variable is not even reseting when i cancel the move

EDIT: I think i accidentally fix it LOL

i just put the simplest thing i can think of

[State 1900, VarSet]
Type = VarSet
Trigger1 = !time
v = 40
value = 1
Last Edit: May 18, 2012, 01:38:41 pm by SignificantSlice
Re: [SOLVED] How to reset a variable when the character hit the ground?
#8  May 19, 2012, 12:10:44 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
That's not "hittin the ground" though. That's just time = 0, and it looks like you've put it in a state rather than -2. So it's not actually what you asked for, but whatever, if it works it's right.


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: [SOLVED] How to reset a variable when the character hit the ground?
#9  May 21, 2012, 07:04:45 am
  • avatar
  • *
    • Philippines
    • ulolako35@yahoo.com
yeah  your correct sir cyanide i did it wrong again, but it's ok now
i redo it this is what i put

[State -2, VarSet]
Type = VarSet
trigger1 = (stateno = 1800) && (var(40) >= 301)
trigger2 = command = "fly"
trigger3 = pos y >=  0
trigger4 = Win = 1
trigger5 = Lose = 1
trigger6 = (stateno = 1907) && (var(40) <= 400)
trigger7 = power = 0
v = 40
value = 0