Hey all, I need some help with a new map I am attempting to make. I am making a game similar to phantom bgh in a sense of the random picking triggers. I need these random picking triggers to pick 1 person at random, spawn that 1 person a unit (tagger) and then the rest that weren't picked (tagees) to all spawn the same unit in the appropriate spot. I figure I have to use switches, can someone outline the basics (in trigger form
) on how to do the random person picker? Thanks in advance!
None.
The easiest way to pick a player at random is probably to use some switches.
This article should give you some idea about how to do it.
None.
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
Just randomize start location and have always P1 be Phantom. (It won't always be the first player of the pregame lobby.)
That works, but the same start location will always be the Phantom, so if it's the top left, then every game it will be the top left, random start locations are like that, they only change color, and what slot the player is in, so that if you make a map where locations matter, the triggers won't get screwed up with the wrong player running the triggers or at the wrong locations.
Switch randomization is the perfect system for you, since most Phantom maps have 8 players, 8 is a perfect combination of switches.
A tutorial with switch randomization can be found here:
http://Falkoner.CoW.GooglePages.com/Switches.html
None.
Here is a very non-specific way to do it (meaning I was too lazy to write triggers.)
Make a trigger that does this...
Randomize Switch 1
Randomize Switch 2
Randomize Switch 3
Here is a table for which switches will be set/cleared for each player...
Player Switch 1 Switch 2 Switch 3
1 Cleared Cleared Cleared
2 Cleared Cleared Set
3 Cleared Set Cleared
4 Cleared Set Set
5 Set Cleared Cleared
6 Set Cleared Set
7 Set Set Cleared
8 Set Set Set
I've also confirmed that they all occur about the same number of times. >.>
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
Ok, to kenoli and fartybillion, I have set the switches for 8 players, and all the possible outcomes, and so on, I have it set where the condition for each player is the different combo of set and cleared switches, and the action is that when those conditions are met that is spawns one zerg drone for the player of the met condtitions:
Players:
player 1
Conditions:
Switch 01 is set
Switch 02 is set
Switch 03 is set
Actions:
Create 1 Zerg Drone for Player 1
(so on for players 2-8)
so far I think the trigger works, but I have encountered where its a random process but it chooses the switch trigger for say, player 8, but player 8 does not exists in the current game, i confirmed this by starting up a game with 3 players and no one got the 1 zerg drone that the "It" player is supposed to recieve, did I do something wrong? Thanks for all the help so far!
None.
Well then you need to make it so that it rerandomizes until a player currently in the game is picked.
None.
so what...make it preserve all the triggers......? how would i go about doing that
None.
Simply do this:
Players:
All players
Condition:
Elapsed time is at most 10 sec (let it time to choose some1) (You dont need this if the drone isn't going to die)
All players bring exactly 0 Zerg Drone to Anywhere
Action:
Randomize Switch 1
Randomize Switch 2
Randomize Switch 3
Preserve Trigger
I didn't tested it, but I think it should work.
None.
Eh. I wouldn't do elapsed time.... You can do the same thing, but without the elapsed time if you are careful.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
Working with switches is so boring. I'd advice you to randomize a death counter like this:
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Actions:
Modify death counts for All players: Set dcRandom for 1.
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Actions:
Randomize sRandom.
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Switch sRandom is set.
Actions:
Modify death counts for All players: Add dcRandom for 1 (=2^0).
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Actions:
Randomize sRandom.
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Switch sRandom is set.
Actions:
Modify death counts for All players: Add dcRandom for 2 (=2^1).
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Actions:
Randomize sRandom.
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Switch sRandom is set.
Actions:
Modify death counts for All players: Add dcRandom for 4 (=2^2).
Trigger
Owners: All Players
Conditions:
Switch sRandomized is cleared.
Actions:
Set sRandomized.
And then check deaths of dcRandom unit which would be random number form 1 to 8.
BTW, In your map you might also want to have triggers executed only for one (no matter what) player. You might use a technic of choosing a
leader for whom triggers would be executed. If you feel like you need it in your map I could explain.
Some.
Eh. I wouldn't do elapsed time.... You can do the same thing, but without the elapsed time if you are careful.
What i mean, if that maybe drone is going to die during the game, so the triggers will re-randomize switches because All players will bring 0 Zerg Drone to Anywhere.
Elapsed time will stop triggers from running once game is really started and Drone may die.
None.
Set a switch or something. Elapsed time is gross.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
Farty is right, you don't want to have too many constants when it comes to things that really should be variable.
None.
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
Hm? Why use a switch when you can use a simple and failsafe condition? I'd go for elapsed scenario time too.
Also to prevent a trigger from rerunning unwantedly you can just remove the "preserve trigger".
Also to prevent a trigger from rerunning unwantedly you can just remove the "preserve trigger".
Actually you can't because the trigger would be executed only for the one player and when the conditions met again it still could be executed for the other.
Some.
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
I referred to this:
Simply do this:
Players:
All players
Condition:
Elapsed time is at most 10 sec (let it time to choose some1) (You dont need this if the drone isn't going to die)
All players bring exactly 0 Zerg Drone to Anywhere
Action:
Randomize Switch 1
Randomize Switch 2
Randomize Switch 3
Preserve Trigger
I didn't tested it, but I think it should work.
It will run for all players in the beginning and, if you remove the preserve, will never run again.
However I'd simplify it by also replacing the conditions with always.
HoweverČ I'd even more simplify it by just randomizing start locations...
A side effect of elapsed time: If drone player drops, you'll get a new drone player for someone else. The chance of nobody getting one is minuscule.
Also, instead of 3 switches, randomize the same switch 3 times and add to a death counter, 4, 2, 1, giving you 8 combinations.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"
Also, instead of 3 switches, randomize the same switch 3 times and add to a death counter, 4, 2, 1, giving you 8 combinations.
That requires more triggers... That would probably be better if you are randomizing like 6 switches (which I have done in the past.
) I was doing weighted probability.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
That requires more triggers... That would probably be better if you are randomizing like 6 switches (which I have done in the past.
) I was doing weighted probability.
It uses less strings/switches, though, and as you said, allows weighted probability with ease.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"