News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Need help with ST scoring system

Started by The Railgunner, January 20, 2009, 12:11:54 AM

Previous topic - Next topic

The Railgunner

I'm working on this scoring system, and I need help getting it to display properly.

Here it is:

[State -2, Scoring System];Counts number of hits if attacks do two hits or more
type = VarSet
trigger1 = hitcount >= 1
v = 15
value = hitcount

[State -2, Scoring System];Score for special attacks (score counter)
type = VarSet
trigger1 = var(15) >= 2 && var(9) = 4
v = 16
value = 2000+(200*hitcount)

[State -2, Scoring System];Score for LK (score counter)
type = VarSet
trigger1 = var(15) >= 2 && stateno = 250
v = 16
value = 100*hitcount

[State -2, Scoring System];Score for MK (score counter)
type = VarSet
trigger1 = var(15) >= 2 && stateno = 260
v = 16
value = 100+(100*hitcount)

[State -2, Scoring System];Score added from Super Combo, assuming no KO (score counter)
type = VarSet
trigger1 = var(15) >= 2 && var(9) = 5
v = 16
value = 15000+hitcount

[State -2, Scoring System];Resets the score counter when Sagat isn't attacking
type = VarSet
trigger1 = hitcount = 0
v = 16
value = 0

[State -2, Scoring System];Score added for weak basics
type = VarAdd
trigger1 = movehit && var(9) = 1
v = 17
value = 100

[State -2, Scoring System];Score added for medium basics
type = VarAdd
trigger1 = movehit && var(9) = 2
v = 17
value = 300

[State -2, Scoring System];Score added for strong basics and throws
type = VarAdd
trigger1 = movehit && var(9) = 3
v = 17
value = 500

[State -2, Scoring System];Score added for special moves
type = VarAdd
trigger1 = movehit && var(9) = 4
v = 17
value = 2000+(200*hitcount)

[State -2, Scoring System];Super Finish score if Tiger Genocide does only one hit
type = VarAdd
trigger1 = movehit && var(9) = 5 && hitcount = 1 && winko = 1
v = 17
value = 10000

[State -2, Scoring System];Super Finish score if Tiger Genocide does multiple hits
type = VarAdd
trigger1 = movehit && var(9) = 5 && hitcount >= 2 && winko = 1
v = 17
value = 18000+(4000*hitcount)

[State -2, Scoring System];Uses custom time counter
type = VarAdd
trigger1 = win = 1
v = 17
value = var(5)*100

[State -2, Scoring System];Adds health to the score
type = VarAdd
trigger1 = win = 1 && winperfect = 0
v = 17
value = life*15

[State -2, Scoring System];Non-Bosses
type = VarAdd
trigger1 = var(4) = 2 && target,name != "SSF2T M. Bison"
trigger2 = var(4) = 2 && target,name != "SSF2T Gouki"
trigger3 = var(4) = 2 && target,name != "SSF2T Sagat"
trigger4 = var(4) = 2 && target,name != "SSF2T Balrog"
trigger5 = var(4) = 2 && target,name != "SSF2T Vega"
v = 17
value = 30000

[State -2, Scoring System];Normal Bosses
type = VarAdd
trigger1 = var(4) = 2 && target,name = "SSF2T Sagat"
trigger2 = var(4) = 2 && target,name = "SSF2T Balrog"
trigger3 = var(4) = 2 && target,name = "SSF2T Vega"
v = 17
value = 50000

[State -2, Scoring System];Final Bosses
type = VarAdd
trigger1 = var(4) = 2 && target,name = "SSF2T M. Bison"
trigger2 = var(4) = 2 && target,name = "SSF2T Gouki"
v = 17
value = 80000

[State -2, Scoring System];Normal hit counter
type = Explod
trigger1 = var(15) >= 2 && var(9) > 5
anim = 8000
ID = 8000
pos = 8,44
postype = left
facing = 1
vfacing = 1
bindtime = 1
vel = .5,0
accel = 0,0
removetime = -2
scale = 1,1
sprpriority = 0
ontop = 1
ownpal = 0

[State -2, Scoring System];Super Combo hit counter, assumes no KO
type = Explod
trigger1 = var(15) >= 2 && var(9) = 5 && p2life > 0
anim = 8200
ID = 8200
pos = 8,44
postype = left
facing = 1
vfacing = 1
bindtime = 1
vel = .5,0
accel = 0,0
removetime = -2
scale = 1,1
sprpriority = 0
ontop = 1
ownpal = 0

[State -2, Scoring System];Super Combo Finish if the Tiger Genocide did multiple hits
type = Explod
trigger1 = var(15) >= 2 && var(9) = 5 && winko = 1
anim = 8100
ID = 8100
pos = 8,44
postype = left
facing = 1
vfacing = 1
bindtime = 1
vel = .5,0
accel = 0,0
removetime = -2
scale = 1,1
sprpriority = 0
ontop = 1
ownpal = 0

[State -2, Scoring System];Super Combo finish if the Tiger Genocide only did one hit
type = Explod
trigger1 = var(15) = 1 && var(9) = 5 && winko = 1
anim = 8700
ID = 8300
pos = 8,44
postype = left
facing = 1
vfacing = 1
bindtime = 1
vel = .5,0
accel = 0,0
removetime = -2
scale = 1,1
sprpriority = 0
ontop = 1
ownpal = 0

[State -2, Custom Time]
type = VarSet
trigger1 = roundstate = 2
v = 5
value = 99

[State -2, Custom Time]
type = VarAdd
trigger1 = (GameTime%60) = 0
v = 5
value = -1

[State -2, Custom Win Counter]
type = VarAdd
trigger1 = win = 1
v = 4
value = 1

[State -2, Custom Win Counter]
type = VarAdd
trigger1 = lose = 1
v = 4
value = -1

[State -2, Move Type Vars];Weak Basics
type = VarSet
trigger1 = stateno = 200
trigger2 = stateno = 250
trigger3 = stateno = 400
trigger4 = stateno = 450
trigger5 = stateno = 600
trigger6 = stateno = 650
trigger7 = stateno = 700
v = 9
value = 1

[State -2, Move Type Vars];Medium Basics
type = VarSet
trigger1 = stateno = 210
trigger2 = stateno = 260
trigger3 = stateno = 410
trigger4 = stateno = 460
trigger5 = stateno = 610
trigger6 = stateno = 660
trigger7 = stateno = 710
v = 9
value = 2

[State -2, Move Type Vars];Strong Basics and throws
type = VarSet
trigger1 = stateno = 220
trigger2 = stateno = 270
trigger3 = stateno = 420
trigger4 = stateno = 470
trigger5 = stateno = 620
trigger6 = stateno = 670
trigger7 = stateno = 720
trigger8 = stateno = 810
v = 9
value = 3

[State -2, Move Type Vars];Special attacks
type = VarSet
trigger1 = stateno = 1000
trigger2 = stateno = 1010
trigger3 = stateno = 1020
trigger4 = stateno = 1100
trigger5 = stateno = 1110
trigger6 = stateno = 1120
trigger7 = stateno = 1300
trigger8 = stateno = 1301
trigger9 = stateno = 1302
trigger10 = stateno = 1400
trigger11 = stateno = 1401
trigger12 = stateno = 1402
trigger13 = stateno = 1500
trigger14 = stateno = 1501
trigger15 = stateno = 1502
trigger16 = stateno = 1503
trigger17 = stateno = 1600
trigger18 = stateno = 1601
trigger19 = stateno = 1602
v = 9
value = 4

[State -2, Move Type Vars];Tiger Genocide
type = VarSet
trigger1 = stateno = 4100
trigger2 = stateno = 4101
trigger3 = stateno = 4105
trigger4 = stateno = 4110
trigger5 = stateno = 4111
v = 9
value = 5


For the record, var(16) counts the score only for the visible sprite counter, while var(17) adds points to the total score. Var(9) tells the score counter whether the the attack is a weak basic, medium basic, strong basic, special, or Super. Var(4) counts the wins for the "complete" score addition, and var(5) counts the time, for the time points.

Cyanide

Descriptive...

Display properly HOW?

More info in what the problem is. I'm not slogging through all that without something to look for.


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

I've fixed the problem, but I need to make the explod follow Sagat (like the lifebars), but still move the way it does (it moves onto the screen from the left, slows down, then comes to a stop). Also, the explod repeats over and over.

Rajaa Retired

if you aren't using a helper for the explods, then you can forget about properly binding them to the screen. You can expect the explods will repeat if you have them in the -2 state which it seems like you do. You will need to use -1 for the frames in the animation for the explod so it won't loop.

The Railgunner

-1 States? Isn't that AI?

Could you please be more clear? I have little experience with hekper states.

Rajaa Retired

Summon a helper and make sure it is not spammed, put the explods in there, then bind the helper appropriately to the screen position you want.

You might be changing some of your triggers on the explod to be like, "root,var(&&)" and you can use the parentvarset or parentvaradd sctrls inside of the helper state.

when i said give the animation a -1 for the frames in the animation, i meant... use -1 for the frames in the animation of the explod. i don't know how to say that part simpler :P

The Railgunner

Quote from: Rajaa on January 20, 2009, 06:53:56 AM
Summon a helper and make sure it is not spammed, put the explods in there, then bind the helper appropriately to the screen position you want.

This is the part I need help on. I can't bind the helper to the screenpos, and I can't stop the explod from looping. I really need more detail about how to do this.

MikeDaBike

This should work:

[State -2, Scoring System - move HC]
type = ModifyExplod
trigger1 = numExplod(8000)&&var(50)<100
ID = 8000
pos = 8+(var(50):=var(50)+1),44
postype = left

[State -2, Scoring System - remove HC]
type = RemoveExplod
trigger1 = numExplod(8000)&&var(50)=100
trigger1 = (var(50):=0)+1
id = 8000


Notes:
-you need one var to store your moving progress (var(50) in this example, change it to any available var)
-it is moving 100 pixels in 100 ticks you can change that value to make it move to any X-position you want
-you should change the ID for all the explods to 8000 (I dont see any reason why they have different IDs)
-in your explod controllers change the removetime to -1
Latest Creation: SSBB Assist Trophies

Rajaa Retired

^you and you vars ;P

with the helper, you can just bind the helper using "posset" and just leave the explod with bindtime=-1 at "pos=0,0" inside of the helper. You can then manage your explods with modifyexplods and removexplods inside of the helper state, it's much easier that way, i speak from the experience. :P

The Railgunner

I tried the code MikeDaBike provided, and while it did fix one of my problems (the binding one), I don't know how to make var(50) detect the distance that the explod went. Also, it no longer slows down, and it still loops. Any suggestions? I really don't have much experience with helpers.

Rajaa Retired

I told you how to prevent looping, in the animations use a frame time of zero for the explods animation that you want it too stop on, i don't know how you have your animations set up but it's usually 1 animations for each set of sprite group for this situation.


Also what do you mean "detect the distance that the exlod went"? It sounds impossible, unless the explod is binded to with a helper.
a helper is really not that had to use, just summon it and coding with it is the same you'll just be needing to know triggers and sctrls like this:


parentvarset
parentvaradd
parent, used with most triggers, this just bases it off the parent conditions. parent, animelem=41, etc....
root, used with most triggers, this just bases it off the root conditions. root, stateno=2000, etc....
numhelper
bindtoroot
bindtoparent
parentdist
rootdist

MikeDaBike

Quote from: Vegeta 20XX, Attorney At Law on January 22, 2009, 01:08:51 AM
I tried the code MikeDaBike provided, and while it did fix one of my problems (the binding one), I don't know how to make var(50) detect the distance that the explod went. Also, it no longer slows down, and it still loops. Any suggestions? I really don't have much experience with helpers.

var(50) holds the distance that the explod went. Change the var(50)<100 and var(50)=100 trigger parts to something like 150 or 75 etc.

If its still looping you got to change the time of the last element of your animation (in the .air file) to -1 (->infinite) and the removetime of your explod(s) to -1.

The slow down could be a problem with this method, since the pos parameters of explods are int values. If you really want a perfect simple slow down you really need a helper to work with velocities and/or character (float) pos.
Anyway here is a solution with explod pos calculation (a very complicated though):
pos = 8+(var(50):=var(50)+1-!(GameTime%4)*(var(50)=[50,75])-(GameTime%2)*(var(50)=[76,100])),44
If you change the maxpos (->100 atm) you also got to change the intervals used in this calculation (let me know if you dont know how to do that). Since it's getting very complicated you are maybe better off using a helper.

Latest Creation: SSBB Assist Trophies

Rajaa Retired

You're going to kill him :gonkgoi:

While it possible to measure the distance the helper went now that i look at mikes code. it's not worth the hassle, just use a helper vegeta, for all that is good, learn to use a helper!!

helper

The Railgunner

Seriously, could someone help me with Sagat's scoring system? Please?

Cyanide

Oh ffs, they're TRYING to. Throw them a bone would you?

Create a helper.

Using the helper BIND IT to the left/right side of the screen with posset

Inside the helper have it run your state -2 stuff using ROOT redirects.

trigger1 = root, var(groan) = 1000 or whatever

If all you're doing is crying for help without giving any real detail on what's giving you problems the help you get will be very, very general. You're saying "the explods loop" they've told you WHY that happens. Have you tried to fix it using their solution yet? They're giving you really really simple things to do, yet we have no notion if you're trying them, or whats going wrong when you do. It sounds to me like this piece of code is over your head right now and you should focus on some lower level stuff first. Like how to stop an explod looping or creating a helper would be good starts.


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

Quote from: Cyanide on January 24, 2009, 05:09:35 AM
Oh ffs, they're TRYING to. Throw them a bone would you?

Create a helper.

Using the helper BIND IT to the left/right side of the screen with posset

Inside the helper have it run your state -2 stuff using ROOT redirects.

trigger1 = root, var(groan) = 1000 or whatever

Where exactly do I put that trigger? In the helper or the explod?

Cyanide

QuoteInside the helper have it run your state -2 stuff using ROOT redirects.

trigger1 = root, var(groan) = 1000 or whatever
Quoting myself for emphasis...

Do you know how helpers work? At all?


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

Quote from: Cyanide on January 24, 2009, 07:40:46 AM
Do you know how helpers work? At all?

NO, damn it. That's why I want HELP.

Quote from: Kenshiro 20XX on January 20, 2009, 06:47:57 AM
I have little experience with helper states.

Cyanide

Thank you. A helper is effectively another instance of a player character. helper
That will tell you everything about what is required to create one (double clicking the sctrl in FF will also be effective) Create it when roundstate = 2 (fight time) and make sure it's not spammed.

You'll need a special state for the helper. Something your character isn't using. Probably worth making it invisible too. Once you have the helper. Go through the process of making it bind to the side of the screen. This will be done EXACTLY the same way as you'd do it with the character. Exactly. Anything your character can do, your helper can do. There is no difference, at all.

Once you have it binding correctly. Move all your explod creation stuff from -2 into the helper state. Leave the varsets and add's where they are.

Your explods will now have to be triggered by redirects. You obviously KNOW what these are because you're making use of them already. In this case you'll be using parent, or root. I suggest root as it's going to probably give us less trouble.

Bind your explods to the helper with bindtime = -1, that way they will stick to the helper as it moves round the screen.

For your looping problem... You've been TOLD the answer here. This is what the last frame of your animation should look like if you choose to edit in text.

group,image, x,y, -1
That -1 means the animation will NEVER time out. You should remove the explod manually if you have to get rid of it.

Looking at your explods, they will all sit on top of each other because you've told them to. I thought there were generally about 8 of them and they were changed based on the value of the variables. If they're meant to be removed and recreated it's because the value of them should be changing. In this case they're recreated every tick and when the value changes the explod changes with it.

This doesn't really look like the scoring system code i've seen before. That cascaded the variables up each time a multiple of 10 was reached.

If you don't understand any of this, say so. Hiding ignorance doesn't help anyone. And that's not an insult. It's much easier to help someone out when they admit they know nothing about something, than helping someone who claims to know what they're doing and then rants at you for not providing working code.


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

Quote from: Cyanide on January 24, 2009, 08:07:47 AM
make sure it's not spammed.

I honestly don't know how to do this. Also, the helper doesn't move, but is fixed to one place.