Score System problem

Started by jailuis, August 19, 2011, 03:06:47 AM

Previous topic - Next topic

jailuis

Im working on an score system, and everything seems ready, but when mugen comes to Calculate the value for the number it ALWAYS seems to be 8 (If over 0)... so its 0 or 8. This seems to be a slow calculus since it appears sprite over sprite always having 8 as BG (So since all are based on 8 they're hardly visible -_-).. here's the formula I'm using:

Anim =F(10000+Floor(((Parent,Var(10))*1/100)%10))

where 1/100 changes depending on the number, that one is the third

The whole code:
Spoiler (click to show)
;-------------------------------------------------------------------------------
;Counter
[Statedef 10000]
type    = S
anim = 10000

[State 0, Explod];First Num -Random
type = Explod
trigger1 = Time = 0
anim = F10010
ID = 10
pos = 0,0
postype = p1
facing = 1
removetime = 20
pausemovetime = 999
scale = 1,1
sprpriority = 30
ontop = 1
ownpal = 1

[State 0, Explod];First Num
type = Explod
Triggerall = Numexplod(1) = 0
trigger1 = Time = 20
anim = F(Floor(((parent,Var(10))*1)%10)+10000)
ID = 1
pos = 0,0
postype = p1
facing = 1
removetime = -1
pausemovetime = 999
scale = 1,1
sprpriority = 30
ontop = 1
ownpal = 1
persistent = 0

[State 0, Explod];2nd Num
type = Explod
Triggerall = Numexplod(2) = 0
trigger1 = Time = 20
anim = F(10000+Floor(((Parent,Var(10))*1/10)%10))
ID = 2
pos = -19,0
postype = p1
facing = 1
removetime = -1
pausemovetime = 999
scale = 1,1
sprpriority = 30
ontop = 1
ownpal = 1
persistent = 0

[State 0, Explod];3rd Num
type = Explod
Triggerall = Numexplod(3) = 0
trigger1 = Time = 20
anim = F(10000+Floor(((Parent,Var(10))*1/100)%10))
ID = 3
pos = -38,0
postype = p1
facing = 1
removetime = -1
pausemovetime = 999
scale = 1,1
sprpriority = 30
ontop = 1
ownpal = 1
persistent = 0

[State 0, Explod];4th Num
type = Explod
Triggerall = Numexplod(4) = 0
trigger1 = Time = 20
anim = F(10000+Floor(((Parent,Var(10))*1/1000)%10))
ID = 4
pos = -57,0
postype = p1
facing = 1
removetime = -1
pausemovetime = 999
scale = 1,1
sprpriority = 30
ontop = 1
ownpal = 1
persistent = 0

[State 0, Explod];5th Num
type = Explod
Triggerall = Numexplod(5) = 0
trigger1 = Time = 20
anim = F(10000+Floor(((Parent,Var(10))*1/10000)%10))
ID = 5
pos = -76,0
postype = p1
facing = 1
removetime = -1
pausemovetime = 999
scale = 1,1
sprpriority = 30
ontop = 1
ownpal = 1
persistent = 0

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 10
value = 10000
ignorehitpause = 1
persistent = 0

;-------------------------------------------------------------------------------
[Statedef -2]

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =  1
text = "var(10) = %d"
params = Var(10)
ignorehitpause = 1
persistent = 1

[State 0, Helper]
type = Helper
trigger1 = Roundstate = 4 && Numhelper(10000) = 0
helpertype = normal ;player
name =  "Counter"
ID = 10000
stateno = 10000
pos = 100,-50
postype = Left
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 0, VarSet]
type = VarSet
trigger1 = Roundstate = 1
v = 10
value = 0
ignorehitpause = 1
persistent = 0

[State 0, VarAdd]
type = VarAdd
triggerall = hitdefattr = SCA, NA,NP,NT
trigger1 = Movehit = 1
v = 10
value = 133
ignorehitpause = 0
persistent = 0

Cybaster

Try something like this (adapting it to your code, obviously) :


[State 1]
type = explod
triggerall = parent,stateno != 20006
trigger1 = var(6) < 10000
anim = 20020+ Var(6)-(Floor(Var(6)/10)*10)
pos = 277,215
postype = left
sprpriority = -10
supermovetime = 99999
pausemovetime = 99999
bindtime = 1
removetime = 1
ID = 20000
ontop = 1
scale = .5,.5
trans = addalpha
alpha = 128,128

[State 10]
type = explod
triggerall = parent,stateno != 20006
trigger1 = var(6) >= 10 && var(6) < 10000
anim = 20020+Floor((Var(6)-(Floor(Var(6)/100)*100))/10)
pos = 261,215
postype = left
sprpriority = -10
supermovetime = 99999
pausemovetime = 99999
bindtime = 1
removetime = 1
ID = 20000
ontop = 1
scale = .5,.5
trans = addalpha
alpha = 128,128

[State 100]
type = explod
triggerall = parent,stateno != 20006
trigger1 = var(6) >=100 && var(6) < 10000
;anim = 20020+ Floor(Var(6)/100)
anim = 20020+Floor((Var(6)-(Floor(Var(6)/1000))*1000)/100)
pos = 245,215
postype = left
sprpriority = -10
supermovetime = 99999
pausemovetime = 99999
bindtime = 1
removetime = 1
ID = 20000
ontop = 1
scale = .5,.5
trans = addalpha
alpha = 128,128

[State 1000]
type = explod
triggerall = parent,stateno != 20006
trigger1 = var(6) >=1000 && var(6) < 10000
anim = 20020+ Floor(Var(6)/1000)
pos = 229,215
postype = left
sprpriority = -10
supermovetime = 99999
pausemovetime = 99999
bindtime = 1
removetime = 1
ID = 20000
ontop = 1
scale = .5,.5
trans = addalpha
alpha = 128,128

state 1 is for units, state 10 for the tens number, etc.

jailuis

Same problem.. only getting anim 1008 if different from 0... I used the display to show me the values and they are perfect (in Mine and urs), I dont get why this is happening.. im using sprites from FightEfx since its for a closed.. But I dunno if that matters or not

Cybaster

It should not matter. So you didn't check only var(10) in the displayclipboard, but also all your calculations like Floor(((Parent,Var(10))*1/10000)%10) ?
Use anim=F10001 , anim=F10002, etc. in various explods (replacing your formulas) just to test if they work correctly at first.

jailuis

Dude, done XD Since the Helper triggers at roundstate = 4, and LEFT, p2 was triggering it too.. his values were ALL 0.. that was why XD I just added Triggerall = Alive and Worked like a charm :) Thanks Anyways ^^

PD: I dont wanna make another post, so, I want to ask.. How may I do so the Var add the values if a helper hits?? Tried Herlper(0), Movehit = 1, but no results.. can u tell?

jailuis

Question: Is there some type of state -2 for helpers?? Thanks.

rizki29

sorry late but i have same problem in the scoring system so can i see the code just for example

Cyanide

Helpers can see state -1 if you give them keyctrl. Helpers can see -2 and -3 if you make them player (please don't do that though unless you absolutely need the opponent to turn and face your helper)

State -1 should be enough for most things. Player is deprecated and may vanish. Also, if used for an effect purpose it may cause p2 to alter facing without touching him because it mugen forces a turn towards nearest player.


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.