YesNoOk
avatar

Number System doesn't work. (Read 234 times)

Started by GoldingCircle, October 15, 2011, 05:49:56 pm
Share this topic:
Number System doesn't work.
#1  October 15, 2011, 05:49:56 pm
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
I trying to activate a number system but I don't see it. Hear something I put in statedef -3:
Code:
[State -3, Number Set System]
type = VarRangeSet
trigger1 = Time = 0
value = 18 ; Reset the Vars that we need
first = 1
last = 3
;and a helper
[State -3, Number System]
type = Helper
triggerall = roundstate = 2
trigger1 = Time = 1 && NumHelper(652)=0
helpertype = normal
name = "Number System"
ID = 652
stateno = 652
pos = 0,0
postype = back
facing = 1
ownpal = 1
Here is the helper state:
Code:
;Number System
[Statedef 652]
physics = N
Anim = 74140108
ctrl = 0

[State 652, 1]
type = ParentVarSet
trigger1 = Time = 0 && Var(18) > 99 ; Make sure Var(0) has 3 digits
V = 15
value = Floor(Var(18) / 100) ; Take the integer part of the hundredth digit.

[State 652, 2]
type = ParentVarSet
trigger1 = Time = 0 && Var(18)>9 ; make sure Var(0) has 2 digits
V = 16
value = Floor(Var(18)/10) - (Var(15)*10) ; Take the first 2 digits and subtract the first.

[State 652, 3]
type = ParentVarSet
trigger1 = Time = 0
V = 17
value = Var(18) - (Var(15) * 100) - (Var(16) *10) ; Subtract the first and 2nd digits.

[State 652, 4]
type = Explod
trigger1 = Time = 0
anim = 1005+ Var(15)
postype = p1,back
pos = -181,-184 ; Make sure you remember this position

[State 652, 5]
type = Explod
trigger1 = Time = 0
anim = 1005+ Var(16)
postype = p1,back
pos = -181+(8),-184 ; display after the 1st digit

[State 652, 6]
type = Explod
trigger1 = Time = 0
anim = 1005+Var(17)
postype = p1,back
pos = -181+(8)+(8),-184 ; last position
;-----------------------------------------------------------------------------------------------------
I looked at the debug, but I never seen the system displayed. What's wrong?
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.
Re: Number System doesn't work.
#2  October 15, 2011, 11:21:40 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.


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: Number System doesn't work.
#3  October 16, 2011, 02:21:48 am
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
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:
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?
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.
Re: Number System doesn't work.
#4  October 16, 2011, 03:37:49 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
He explains it. Do the work required.


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: Number System doesn't work.
#5  October 19, 2011, 04:37:02 am
  • **
  • "GrayCircle will once be the greatest warrior"
    • i.imgur.com/MdGQY.gif
 >:( Now look what I did! I carefully followed his instructions,in a different way:  >:(
Code:
;I put this in Statedef -3
[State -3, Number System]
type = Helper
triggerall = roundstate = 2 && Var(14) > 0
trigger1 = Time = 1
helpertype = normal
name = "Number System"
ID = 652
stateno = 652
pos = -60,60
postype = p1,back
ownpal = 1
facing = 1
;------------------------------------------------------
[State -3, Number Set System]
type = VarRangeSet
triggerall = RoundState = 2 && Var(14)=395
trigger1 = Teamside = 1 || Teamside = 2
trigger1 = Time = 1
value = 14
first = 15
last = 17
;------------------------------------------------------
[State -3, Set Projectile Pack]
type = VarSet
trigger1 = teamside = 1 || teamside = 2
trigger1 = !time
v = 14
value = 395
;-------------------------------------------------------
;The variable is 395
And the helper:
Code:
;Number System
[StateDef 652]
type = U
physics = N
anim = 74140108

[State 652, 0]
type = ParentVarSet
Trigger1 = Time = 0 && Var(14)>2
v = 15
value = Floor(Var(14)/100)

[State 652, 1]
type = ParentVarAdd
trigger1 = Time = 0 && Var(14)>4
v = 16
value =Floor(Var(16)/10)-(Var(15)*10)

[State 652, 2]
type = ParentVarAdd
trigger1 = Time = 0
v = 17
value = Var(14)-(Var(15)*100)-(Var(16)*10)

[State 652, 3]
type = Explod
trigger1 = time = 1
anim = 1000
pos = -10,0
postype = p1
sprpriority = 5

[State 652, 4]
type = Explod
trigger1 = time = 1
anim = 1002
pos = -10,0
postype = p1
sprpriority = 4

[State 652, 5]
type = Explod
trigger1 = time = 1
anim = 1005 + Var(15)
pos = 0,0
postype = p1,back
scale = 2,2
sprpriority = 5

[State 652, 6]
type = Explod
trigger1 = time = 1
anim = 1005 + Var(16)
pos = 0+(8),0
postype = p1,back
scale = 2,2
sprpriority = 5

[State 652, 7]
type = Explod
trigger1 = time = 1
anim = 1005 + Var(17)
pos = 0+(8)+(8),0
postype = p1,back
scale = 2,2
sprpriority = 5
;-------------------------------------------------------------------------------
The thing is that I check through Ctrl-D and I saw the helper texted out, but it didn't appear visually?What happened?
"GrayCircle will surpass ever hero one day!"

My Local Name: Fighting Toys Freak.
Last Edit: October 19, 2011, 04:41:09 am by graycircle11
Re: Number System doesn't work.
#6  October 19, 2011, 04:57:01 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
pos = -60,60

It's 60 pixels below the floor of the stage? If it's invisible and has no clsn's it will not be visible.

You set var(14) to 395, then you set vars 15-17 to the value 14. Then the helper does a load of parentvaradds using it's own variables which all = 0 at that point.

Follow his instructions to the letter. Also, once more, things like "the helper is not visible" You should be able to resolve that yourself. First step is put the helper where you KNOW it will show up and give it an animation so you can see it. Then make the triggers simpler. Then you can change things back and work backwards till it disappears.

You are going to learn to troubleshoot. It's more than just looking at the debug. If something isn't showing MAKE IT SIMPLER and work backwards. When it stops showing again that's where your error is.


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.