Everything is wrong.
You've set variables 1-3 to 18. You do this every time time = 0 which is pretty common so if they had a purpose they would now be breaking things. But you're not using them so this basically does nothing.
There is a tutorial on this in the code library. You cannot copy paste it you need to understand it first.
Study, study, study. Do it in small increments till you UNDERSTAND it.
You must now learn this. You have asked enough small simple questions that both troubleshooting and working through a problem are actually required before help is forthcoming.
I quite understand this code very while:
Code: (MUGEN) [Select]
[State -3: VarAdd]
type = VarAdd
triggerall = (Time = 2)
trigger1 = ((StateNo = 5001) && (Anim = 5000)) || (StateNo = 5001) && (Anim = 5010)) || ((StateNo = 5011) && (Anim = 5020))
persistent = 0
ignorehitpause = 1
v = 0
value = 10
[State -3: VarAdd]
type = VarAdd
triggerall = (Time = 4)
trigger1 = ((StateNo = 5001) && (Anim = 5001)) || ((StateNo = 5001) && (Anim = 5011)) || ((StateNo = 5011) && (Anim = 5021))
persistent = 0
ignorehitpause = 1
v = 0
value = 40
[State -3: VarAdd]
type = VarAdd
triggerall = (Time = 6)
trigger1 = ((StateNo = 5001) && (Anim = 5002)) || ((StateNo = 5001) && (Anim = 5012)) || ((StateNo = 5011) && (Anim = 5022))
persistent = 0
ignorehitpause = 1
v = 0
value = 100
This is used to recover the stun meter when the character is not hit.
Code: (MUGEN) [Select]
[State -3: VarAdd]
type = VarAdd
trigger1 = (Var(0) > 0)
ignorehitpause = 1
v = 0
value = -1
Finally, this is used to go into the dizzy state, when the stun meter has reached it's limit. You can adjust the "Var(0) >= 400", if you want the stun meter to be higher, or lower.
Note, that the 9003 of this trigger is the final dizzy state mentioned earlier. Change this, if you plan to add in more.
Code: (MUGEN) [Select]
[State -3: ChangeState]
type = ChangeState
trigger1 = (Var(0) >= 400) && (StateNo != [9000,9003])
value = 9010
ignorehitpause = 1
Title: Number System
Post by: DavidGee on May 28, 2005, 10:25:05 pm
This is for displaying numbers in mugen. Basically mathematical equations.
First of all, we need the individual digits, lets say we have a Var(0) that has the value of 359.
Code: (MUGEN) [Select]
[State a, 0]
type = VarRangeSet
trigger1 = Time = 0
value = 0 ; Reset the Vars that we need
first = 1
last = 3
[State a, 1]
type = VarSet
trigger1 = Time = 0 && Var(0) > 99 ; Make sure Var(0) has 3 digits
Var(1) = Floor(Var(0) / 100) ; Take the integer part of the hundredth digit.
Var(1) now contains the first digit of our number, 3.
Code: (MUGEN) [Select]
[State a, 2]
type = VarSet
trigger1 = Time = 0 && Var(0) > 9 ; make sure Var(0) has 2 digits
Var(2) = Floor(Var(0) / 10) - (Var(1) * 10) ; Take the first 2 digits and subtract the first.
Var(2) now contains the 2nd, 5.
Code: (MUGEN) [Select]
[State a, 3]
type = VarSet
trigger1 = Time = 0
Var(3) = Var(0) - (Var(1) * 100) - (Var(2) * 10) ; Subtract the first and 2nd digits.
Var(3) now has the last digit, 9.
Now that we have all 3 digits, we can display them. First, make sure you have the number sprites in the sff. Second, make sure the AIR group numbers are proportional to the numbers, ie. if the sprite "0" has AIR group number 6000 or 7000 or 8920, then the sprite "8" would be 6008 or 7008 or 8928, respectively. Now:
Code: (MUGEN) [Select]
[State a, 4]
type = Explod
trigger1 = (whatever)
anim = (AIR group number of sprite "0") + Var(1)
postype = (whatever)
pos = (x), (y) ; Make sure you remember this position
[State a, 5]
type = Explod
trigger1 = (whatever)
anim = (AIR group number of sprite "0") + Var(2)
postype = (whatever)
pos = (x) + (width of sprite), (y) ; display after the 1st digit
[State a, 6]
type = Explod
trigger1 = (whatever)
anim = (AIR group number of sprite "0") + Var(3)
postype = (whatever)
pos = (x) + (width of sprite) + (width of sprite), (y) ; last position
I have a question. Alleviate were I can put the code in the right place since u said everything is wrong?