Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: How to detect both teams having same minereal
How to detect both teams having same minereal
Dec 14 2008, 9:24 pm
By: Oo.DaMeiN.oO  

Dec 14 2008, 9:24 pm Oo.DaMeiN.oO Post #1



I need to know how to detect when at the end of the timer if both teams have the exact same minereal count.

Thanks.



None.

Dec 14 2008, 9:29 pm Biophysicist Post #2



You can do it manually with a bunch of Accumulates conditions.

Or, you can put the following trigger:

Conditions:
Countdown timer is at most 0 seconds.
Player 1 accumulates at least one mineral.
Player 2 accumulates at least one mineral.
Actions:
Subtract 1 mineral for player 1.
Subtract 1 mineral for player 2.

Then, if one team has 0 mins but the other team has more than 0, they had different mineral amounts when the timer expired.

(You can also increment a DC every time you subtract a mineral, then use that to give the minerals back after the check.)



None.

Dec 14 2008, 9:36 pm Oo.DaMeiN.oO Post #3



Okay, I guess I could do that.. but is there a way to do it within one trigger?

The problem is; this is a game that the minereals vary from 0 to anywhere to roughly 300.

The thing is set up like this.

You kill an enemy, you get +1 minereal.

You retrieve a flag, you get +15 minereals.

So.. you see my problem in using accumilation?



None.

Dec 14 2008, 9:43 pm Biophysicist Post #4



I just told you... Create a bunch of triggers that reduce both players minerals by 1 when the timer expires if both players have at least one mineral, and make 300 copies. Then detect if both players have 0 minerals or if one player has more that 0. (If they both have more than 0, keep subtracting.)



None.

Dec 14 2008, 9:45 pm Oo.DaMeiN.oO Post #5



I know you told me.. but you must of missed the part in my post about "one trigger".

Because I re-call doing this before, without having to subtract anything.. I just can't remember it.



None.

Dec 14 2008, 9:51 pm Biophysicist Post #6



I have no clue, then.

WAIT! I do!

Create a DC called Score. Whenever a player gets their minerals increased, increase their Score DC by the same amount. (So increase by 1 for a kill, or by 15 for a flag return.) If both player's Score DCs are greater than 0, decrease them both by 1. Then, if they have the same mineral amount, they will both have their Score DC at 0.



None.

Dec 14 2008, 10:09 pm NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Well you can do binary count-offs (subtract 256,128,64,32,16,8,4,2,1 minerals) which will do the trick within one trigger loop, but thats 8 triggers + 8 triggers to compare if one team has reached zero before the other.

If you don't want to spend more than one trigger then do what TZ suggested. But that method will take several trigger loops.

There's no 'greater than' / 'smaller than' / 'equals' operation in sc triggering. You have to build your own functions if you need that.

I have no idea how you would have done a compare function without using subtract.

Also, TZ, about your solution: How would you detect mineral increase?




Dec 14 2008, 10:13 pm Biophysicist Post #8



He said it only occours when you kill an enemy or retrieve a flag.



None.

Dec 15 2008, 12:19 am Falkoner Post #9



Transfer both into separate death counts, until one is out, the first one to run out is lower, if both run out at the same time, then they are the same, once you're done with that, transfer the minerals back, Binary Count-Offs is pretty much essential for easy triggering.

Rather than copying the trigger 300 times like said before, just use Binary Countoffs to transfer it with less triggers.



None.

Dec 15 2008, 12:43 am rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

http://www.staredit.net/wiki/Resource_Sharing
Take a look at resource sharing too.

It essentially detects when two people DON'T have the same minerals.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 15 2008, 1:57 am Decency Post #11



Posted this in the SniperForums but figured I'd copy here too:


Team HOT
Conditions:
- Countdown Timer is exactly zero.
- Current Player has accumulated the most Ore.
Actions:
- Set "HOT Winning."
- Preserve Trigger.

Team COLD
Conditions:
- Countdown Timer is exactly zero.
- Current Player has accumulated the most Ore.
Actions:
- Set "COLD Winning."
- Preserve Trigger.

All Players
Conditions:
- "HOT Winning" is set.
- "COLD Winning" is set.
Actions:
- Set countdown timer to 180 seconds.
- Clear "HOT Winning."
- Clear "COLD Winning."

Then just change the victory conditions to if "HOT Winning" is set and "COLD Winning" is cleared to victory HOT; vice versa for the other team. This allows for indefinite overtime periods.



None.

Dec 15 2008, 3:11 am Biophysicist Post #12



Oh, good one! Yah, Most does weird stuff at times...

That's your best solution, go with that.



None.

Dec 15 2008, 5:34 am NudeRaider Post #13

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

omg, that's like kills to cash perfect. When both players have the most minerals they have the same. Simple yet efficient. Yeah sorry for not thinking about it.




Dec 17 2008, 4:21 am Falkoner Post #14



I never remember those Most triggers, they do come in handy a lot though..



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
Please log in to shout.


Members Online: Roy, C(a)HeK