Staredit Network

Staredit Network -> UMS Assistance -> Whomever has the most minerals...
Report, edit, etc...Posted by KhaosKreator on 2005-08-24 at 21:31:01
Ok, there are seven human players in a map, and one computer.

How would I make it so, when a player has the most minerals, a unit (zerg deflier) is created for him? And if two or more players are tied for the most minerals, the unit needs to be removed as well.

I also need to make it so only 1 deflier is ever in play at any one time.
The minerals will be changing throughout the game.

So if the minerals are like...
P1 = 0
P2 = 0
P3 = 0
P4 = 0
P5 = 0
P6 = 0
P7 = 0
Then there is no Deflier.

And if the minerals are like...
P1 = 0
P2 = 0
P3 = 0
P4 = 2
P5 = 0
P6 = 3
P7 = 0
Then Player 6 has a Deflier.

And if the minerals are like...
P1 = 0
P2 = 3
P3 = 4
P4 = 4
P5 = 2
P6 = 2
P7 = 1
Then there is no Deflier.
Etc.

Any ideas?

EDIT: If it helps, the most minerals anyone will ever be getting is 4.
Report, edit, etc...Posted by MapUnprotector on 2005-08-24 at 21:35:03
Use the most resources condition smile.gif

Not sure about the tie thing though.
Report, edit, etc...Posted by KhaosKreator on 2005-08-24 at 21:51:36
QUOTE(devilesk @ Aug 24 2005, 08:35 PM)
Not sure about the tie thing though.
[right][snapback]297668[/snapback][/right]


Yea, that's the hardest part. tongue.gif

If I were to use "most resources condition", would 2+ defliers be created in the event of a tie? I don't frequently use that action so I'm not sure how exactly it would react.
Report, edit, etc...Posted by EzDay281 on 2005-08-24 at 21:54:27
It would be whoever is at the top of the list, which will be the most recent person to get enough mineral to tie.
Or atleast, that's what I believe would happen.
Since there's only 4 minerals tops, you could have triggers to check if there are any ties.
Report, edit, etc...Posted by Vindexus on 2005-08-24 at 22:07:29
Trigger
Players:All players
Conditions:
¤ Current player has most minerals
¤ Current player commands 0 Defilers
Actions:
¤ Center location 'Defiler Creation' on 'Home Base' owned by Current Player
¤ Create one Defiler for current player at 'Defiler Creation' for Current Player
¤ Preserve Trigger


I'm not exactly sure how to check for ties. Maybe something like if Current Player has most resources and foes has most resources, remove all Defilers.
Report, edit, etc...Posted by LegacyWeapon on 2005-08-24 at 22:09:15
Or all players commands at least 2 defilers, remove all...
Report, edit, etc...Posted by Vindexus on 2005-08-24 at 22:15:24
QUOTE(LegacyWeapon @ Aug 24 2005, 09:09 PM)
Or all players commands at least 2 defilers, remove all...
[right][snapback]297696[/snapback][/right]

Yeah, but wouldn't you just keep getting a defiler and losing it over and over?
Report, edit, etc...Posted by SacredElf on 2005-08-24 at 22:23:51
QUOTE
Yeah, but wouldn't you just keep getting a defiler and losing it over and over?


no, it will erase defilers when a ties happend
Report, edit, etc...Posted by KhaosKreator on 2005-08-24 at 22:24:33
QUOTE(Vindexus @ Aug 24 2005, 09:15 PM)
Yeah, but wouldn't you just keep getting a defiler and losing it over and over?
[right][snapback]297702[/snapback][/right]


Eureka!

I did exactly that and added a switch so it didn't repeat.
Just add hyper triggers and it's good to go!

Thanks anyways guys.
Report, edit, etc...Posted by Urmom(U) on 2005-08-24 at 22:31:33
man 7 minutes too late. and i was gonna suggest teh same thing too!
Report, edit, etc...Posted by (U)Bolt_Head on 2005-08-24 at 22:51:23
Conditions:
-Current player has the most minerals
-Switch01 is clear
-Current player commands at exactly zero defiler.
Actions:
-Set Switch 01
-Subtract 1 mineral for current player
-Preserve Trigger

Conditions:
-Current player has the most minerals
-Switch01 is set
Actions:
-Clear Switch01
-Add 1 mineral for current player
-Create one Defiler for Current player
-Preserve Trigger

Conditions:
-Switch01 is set
Actions:
-Clear Switch01
-Add 1 mineral for current player
-Remove all defiler for all players
-Preserve Trigger




Ok I'm only doing this cause i doubt you did it correctly. When more than one player tie for the most minerals then the conditions are still true for "most minerals".

Anyways this is what I'm doing... I use a switch to make the player check the "most minerals" condition twice (subtracting a mineral on the first one). If the player has a lead (not a tie) then he will satisfiy the condition even after having one subtracted. If the player has a tie then he will no longer have the most after having one subtracted.
This would then mean that he WAS tied for the most so it will remove everyones defiler.

If I planned this correct these 3 triggers will do all of it for you.
Report, edit, etc...Posted by KhaosKreator on 2005-08-24 at 23:00:38
That's all fine and dandy Bolt_Head, but messing with the minerals is an undesirable side effect. (Not to mention that the deflier can't be utilized.)

Nice try though. I've already got it working. cool1.gif
Report, edit, etc...Posted by Heimdal on 2005-08-25 at 01:33:18
Running 2 triggers in succession like that, you will barely notice the minerals change. Very elegant solution, bolt.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-08-25 at 11:13:40
QUOTE(Heimdal @ Aug 25 2005, 12:33 AM)
Running 2 triggers in succession like that, you will barely notice the minerals change.  Very elegant solution, bolt.
[right][snapback]297819[/snapback][/right]


He wouldn't notice it at all. Thanks smile.gif

KhaosKreator: What do you mean the defiler can't be utalized? How did you do it?

Edit: Just realized you attached the map.

Oh i see what you did, you disabled the triggers with a switch after receaving two defilers and enabled it again any time one of the players got an extra mineral.

Here is my improved verison.
[attachmentid=13259]
Report, edit, etc...Posted by KhaosKreator on 2005-08-25 at 20:09:42
QUOTE((U)Bolt_Head)
QUOTE(Heimdal @ Aug 25 2005, 12:33 AM)
Running 2 triggers in succession like that, you will barely notice the minerals change.  Very elegant solution, bolt.
He wouldn't notice it at all. Thanks smile.gif


I don't mean to keep bumping this topic up, but are you implying that, by using bolt's triggers, conditons that activate for player X when he has "at most or exactly" 3 minerals, won't activate even if he has exactly 4 minerals? Because I was under the knowledge that they would using those triggers. confused.gif

My map is working fine as is, I would just like to clarify for future reference.
Report, edit, etc...Posted by M_s4 on 2005-08-25 at 22:20:15
Why dont u close the topic then tongue.gif
Report, edit, etc...Posted by Heimdal on 2005-08-26 at 09:21:32
"at most" means "no more than." So if the condition is "at most 3," the trigger will not fire if you have 4. It will fire for 0, 1, 2, and 3.

I think I found a bug in bolt's triggers. In the case where there is a tie, are you guaranteed that the 3rd trigger will fire for the same player that the first did before the second fires for a different player? If you are, then it's fine. Otherwise you may need to use a death counter as a switch for each player.
Report, edit, etc...Posted by PCFredZ on 2005-08-26 at 13:27:39
QUOTE(Heimdal @ Aug 26 2005, 09:21 AM)
"at most" means "no more than."  So if the condition is "at most 3," the trigger will not fire if you have 4.  It will fire for 0, 1, 2, and 3.

I think I found a bug in bolt's triggers.  In the case where there is a tie, are you guaranteed that the 3rd trigger will fire for the same player that the first did before the second fires for a different player?  If you are, then it's fine.  Otherwise you may need to use a death counter as a switch for each player.
[right][snapback]298722[/snapback][/right]

The checks run through all triggers for 1 player at a time, so it should be fine.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-08-26 at 17:05:19
Heimdal if there is a tie the 3rd trigger will fire resetting that players minerals and the switch before the next player checks his triggers. There are not waits that would cause it to do otherwise.



Sample

Player 1: 3 minerals
Player 2: 3 minerals
Player 3: 2 minerals

This is the order of events.

Trigger 1 for player 1 cause tie satisfies it
-Player 1 now has 2 minerals
Trigger 2 for player 1 does not fire (no longer has most minerals)
Trigger 3 fires for player 1
-Player 1 now has 3 minerals and switch is cleared again.

Next Player
Trigger 1 for player 2 cause tie satisfies it
-Player 1 now has 2 minerals
Trigger 2 for player 2 does not fire (no longer has most minerals)
Trigger 3 fires for player 2
-Player 2 now has 3 minerals and switch is cleared again.

Next Player
None of player 3’s triggers fire cause he doesn’t have the most at any time.

The trick is everything is reset completed and reset before the next player gets a chance to run his triggers. Because of this the players can share the same switch (and locations if needed).
Report, edit, etc...Posted by Heimdal on 2005-08-26 at 17:55:34
Right, I just wasn't sure about the order in which the players executed the triggers. Looks good.
Report, edit, etc...Posted by KhaosKreator on 2005-08-26 at 22:13:10
QUOTE(Heimdal @ Aug 26 2005, 08:21 AM)
"at most" means "no more than."  So if the condition is "at most 3," the trigger will not fire if you have 4.  It will fire for 0, 1, 2, and 3.


Yes, I know that. My question was based on the fact that his triggers reduce the players mineral count.

So using bolt's example above. Would this trigger activate if it was in the same map in that exact same scenario?
__________________________

Condition: Player 1 has exactly 3 minerals.
Action: Display text message "You have 3 minerals! If you have 4, then something is wrong with these triggers!"
__________________________

Understand my query now?
Report, edit, etc...Posted by PCFredZ on 2005-08-26 at 22:25:47
QUOTE(KhaosKreator @ Aug 26 2005, 10:13 PM)
Yes, I know that. My question was based on the fact that his triggers reduce the players mineral count.

So using bolt's example above. Would this trigger activate if it was in the same map in that exact same scenario?
__________________________

Condition: Player 1 has exactly 3 minerals.
Action: Display text message "You have 3 minerals! If you have 4, then something is wrong with these triggers!"
__________________________

Understand my query now?
[right][snapback]299193[/snapback][/right]

The trigger will run right if you put it separate from the triggers he posted (i.e., not in between 2 of his triggers).
Report, edit, etc...Posted by KhaosKreator on 2005-08-27 at 02:29:02
QUOTE(PCFredZ @ Aug 26 2005, 09:25 PM)
The trigger will run right if you put it separate from the triggers he posted (i.e., not in between 2 of his triggers).
[right][snapback]299205[/snapback][/right]


Oh cool. I did not know exactly how that worked.

Thanks.
Next Page (1)