News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Adding point counter

Started by EM20XX, June 15, 2010, 07:47:57 AM

Previous topic - Next topic

EM20XX

I seen with some other characters that it's possible to add a score board in mugen where if you hit your opponent you will get points. I have not been able to figure this out tho. Can someone help me with this?

Cyanide

It's in the code library. And it's wanky. Lots of effort, buggerall gain.


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.

EM20XX

what topic is it? i cant seem to find it

Cyanide

The sticky one if memory serves.


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.

EM20XX

i still cant find it sorry  ???

Cyanide



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.

Ricepigeon

Using a single variable with modulo division for the explods would be much easier wouldnt it?

ie:

var(0) % 10           ; ones digit
(var(0) /10) % 10  ; tens digit
(var(0)/100) % 10 ; hundred digit

combined with a varadd in each state with a trigger = movehit and persistent = 0, should give the result he's looking for.

EM20XX

where do i add the codes? in statedef -2?

Cyanide

Read the thing i linked to and follow it. It describes everything. If you can't understand it at all right now, don't do it. The effort required is >>>>>>>> what you get out of it.


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.

EM20XX

yeah this might be over my head right now :-\ but maybe when i have the time for it i will learn it, seems like something worth learning  8)

The Railgunner

#10
I'm having a hard time implementing the code in the Archive - you see, I'm still working on an ST scoring system, which keeps scores up to seven digits long (i.e, an upper bound of 9999999 points). I tried augmenting the scoring system to support seven digits, which effectively requires only two as the last two digits are zeroes. However, only the last two digits (i.e, the zeroes) show up, even if the scoring variable is greater than zero.

Here is the code, for anyone interested:
[State -2, 0]
type = VarRangeSet
trigger1 = Time = 0
value = 0 ; Reset the Vars that we need
first = 10
last = 18

[State -2, 1]
type = VarSet
trigger1 = Time = 0 && Var(10) > 9999
v = 11
value = Floor(Var(10) / 10000)
;value = (Var(10)/1000000)%10

[State -2, 2]
type = VarSet
trigger1 = Time = 0 && Var(10) > 999 ; make sure Var(0) has 2 digits
v = 12
value = Floor(Var(10) / 1000) - (Var(11) * 10) ; Take the first 2 digits and subtract the first.
;value = (Var(10)/100000)%10

[State -2, 3]
type = VarSet
trigger1 = Time = 0 && Var(10) > 99
v = 13
value = Floor(Var(10)/100) - (Var(11) * 100) - (Var(12) * 10)
;value = (Var(10)/10000)%10

[State -2, 3]
type = VarSet
trigger1 = Time = 0 && Var(10) > 9
v = 14
value = Floor(Var(10)/10) - (Var(11) * 1000) - (Var(12) * 100) - (Var(13) * 10)
;value = (Var(10)/1000)%10

[State -2, 3]
type = VarSet
trigger1 = Time = 0 && Var(10) > 0
v = 15
value = Var(10) - (Var(11) * 10000) - (Var(12) * 1000) - (Var(13) * 100) - (Var(14) * 10)
;value = (Var(10)/100)%10

[State -2, 3]
type = VarSet
trigger1 = Time = 0 && Var(10) > 0
v = 16
value = Var(10) - (Var(11) * 10000) - (Var(12) * 1000) - (Var(13) * 1000) - (Var(14) * 100) - (Var(15) * 10)
;value = (Var(10)/10)%10

[State -2, 19]
type = VarSet
trigger1 = Time = 0
v = 17
value = Var(10) - (Var(11) * 10000) - (Var(12) * 1000) - (Var(13) * 1000) - (Var(14) * 100) - (Var(15) * 10)
;value = Var(10)%10

[State -2, 5]
type = Explod
trigger1 = Time = 0 && Var(10) > 9999
anim = 8201 + Var(11)
postype = left
pos = 32, -16
bindtime = -1

[State -2, 6]
type = Explod
trigger1 = Time = 0 && Var(10) > 999
anim = 8701 + Var(12)
postype = left
pos = 32, -16
bindtime = -1

[State -2, 6]
type = Explod
trigger1 = Time = 0 && Var(10) > 99
anim = 8801 + Var(13)
postype = left
pos = 32, -16
bindtime = -1

[State -2, 6]
type = Explod
trigger1 = Time = 0 && Var(10) > 9
anim = 8901 + Var(14)
postype = left
pos = 32, -16
bindtime = -1

[State -2, 6]
type = Explod
trigger1 = Time = 0 && Var(10) > 0
anim = 9001 + Var(15)
postype = left
pos = 32, -16
bindtime = -1

[State -2, 6]
type = Explod
trigger1 = Time = 0 && Var(10) > 0
anim = 9101 + Var(16)
postype = left
pos = 32, -16
bindtime = -1

[State -2, 6]
type = Explod
trigger1 = Time = 0
anim = 9201 + Var(17)
postype = left
pos = 32, -16
bindtime = -1

[State -2, VarAdd]
type = VarAdd
trigger1 = MoveHit && stateno = 200
trigger1 = MoveHit && stateno = 250
trigger1 = MoveHit && stateno = 400
trigger1 = MoveHit && stateno = 450
trigger1 = MoveHit && stateno = 600
trigger1 = MoveHit && stateno = 650
v = 10
value = 1
persistent = 0


[State -2, VarAdd]
type = VarAdd
trigger1 = MoveHit && stateno = 210
trigger1 = MoveHit && stateno = 260
trigger1 = MoveHit && stateno = 410
trigger1 = MoveHit && stateno = 460
trigger1 = MoveHit && stateno = 610
trigger1 = MoveHit && stateno = 660
v = 10
value = 3
persistent = 0

[State -2, VarAdd]
type = VarAdd
trigger1 = MoveHit && stateno = 220
trigger1 = MoveHit && stateno = 270
trigger1 = MoveHit && stateno = 420
trigger1 = MoveHit && stateno = 470
trigger1 = MoveHit && stateno = 620
trigger1 = MoveHit && stateno = 670
v = 10
value = 4
persistent = 0

I've gotten the numbers to check out and everything, but for some reason, var(10) always resets to zero every time I do anything. The varadds don't do anything even when the given attacks hit. I set up a debug state to test this (using a command sends the character into an alternate standing state, in which var(10) is set to 56789, to test the digits in the scoring system), but if I leave the debug state, the variable resets to zero again. What am I doing wrong? How do I get the variable to retain its value?

Cyanide

You've told it to

Quote[State -2, 0]
type = VarRangeSet
trigger1 = Time = 0
value = 0 ; Reset the Vars that we need
first = 10
last = 18
time will = 0 any time you do anything.


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.

The Railgunner

Fixed that, but now there's this:



After correcting this, the score would display correctly, but the explods will "flicker" every time that time = 0. Basically, I want the numbers to change, but without flickering or piling on top of each other every time the score changes. How do I fix this?

Cyanide

The only decent method of doing that is recreating the explod every tick. You could also manage it by putting it in a helper and using an extra variable and doing

var(score) != var(remember score)

as the creation/removal for them


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.

MirageAtoli

Do you want to create an explod every time you update or only update the anim of the explod?
Quote from: Titiln on December 31, 2007, 10:46:10 PM
i think we should call it an "engine" so we don't look like total idiots because otherwise we'd be arguing about a "game" and that would be somehow "dumber" than arguing about an "engine" on the "internet" for countless hours

Quote from: Beatrice on March 01, 2010, 06:55:03 PM
Quote from: Iced
I for one, do not enjoy round corners!  :bigcry:
But they hurt much less when we accidentally hit them!  :S

The Railgunner

Quote from: MirageAtoli on June 27, 2010, 04:56:54 AM
Do you want to create an explod every time you update or only update the anim of the explod?

Either would work, though updating the anim would likely be less resource intensive.

Quote from: Cyanide on June 27, 2010, 04:55:30 AM
The only decent method of doing that is recreating the explod every tick. You could also manage it by putting it in a helper and using an extra variable and doing

var(score) != var(remember score)

as the creation/removal for them

How would var(remember score) work? And how could I recreate the explod every tick without screwiness?