Random Triggers
Apr 22 2008, 5:46 am
By: Gold_Member  

Apr 22 2008, 5:46 am Gold_Member Post #1



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 :D) on how to do the random person picker? Thanks in advance!



None.

Apr 22 2008, 5:55 am Kenoli Post #2



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.

Apr 22 2008, 7:21 am NudeRaider Post #3

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.)




Apr 23 2008, 12:17 am Falkoner Post #4



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.

Apr 23 2008, 12:22 am O)FaRTy1billion[MM] Post #5

👻 👾 👽 💪

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...
Code
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!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Apr 23 2008, 1:43 am Gold_Member Post #6



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.

Apr 23 2008, 1:48 am Falkoner Post #7



Well then you need to make it so that it rerandomizes until a player currently in the game is picked.



None.

Apr 23 2008, 2:27 am Gold_Member Post #8



so what...make it preserve all the triggers......? how would i go about doing that



None.

Apr 23 2008, 2:46 am Nukes_are_nice Post #9



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.

Apr 23 2008, 3:14 am O)FaRTy1billion[MM] Post #10

👻 👾 👽 💪

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!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Apr 23 2008, 5:38 am Wormer Post #11



Working with switches is so boring. I'd advice you to randomize a death counter like this:
Code
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.

Apr 23 2008, 11:26 pm Nukes_are_nice Post #12



Quote from O)FaRTy1billion[MM]
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.

Apr 24 2008, 4:06 am O)FaRTy1billion[MM] Post #13

👻 👾 👽 💪

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!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Apr 24 2008, 4:27 am Falkoner Post #14



Farty is right, you don't want to have too many constants when it comes to things that really should be variable.



None.

Apr 24 2008, 6:44 am NudeRaider Post #15

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". :P




Apr 24 2008, 8:11 am Wormer Post #16



Quote
Also to prevent a trigger from rerunning unwantedly you can just remove the "preserve trigger". :P
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. :bleh:



Some.

Apr 24 2008, 8:56 am NudeRaider Post #17

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:
Quote from Nukes_are_nice
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...




Apr 24 2008, 2:50 pm rockz Post #18

ᴄʜᴇᴇsᴇ ɪᴛ!

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?"

Apr 24 2008, 8:31 pm O)FaRTy1billion[MM] Post #19

👻 👾 👽 💪

Quote from rockz
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!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Apr 25 2008, 4:38 am rockz Post #20

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from O)FaRTy1billion[MM]
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?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:57 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[06:57 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[06:57 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[06:56 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[06:56 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[06:56 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[06:56 am]
maxar39174 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[05:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[05:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[05:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
Please log in to shout.


Members Online: Roy, KiFxierkia15