Topic: Random Triggers (or Random Numbers)

Hi, my name is Paul and I require random triggers/random numbers for my map.

  Basiclly what I need want on my is around 18  AREAS on the map, and if you enter one of these areas, you will die, all 18 areas covers all of the playable map.  This has all been set, and I have got the triggers for death set already.
  The zones dont'e kill your straight away (the triggers are disabled) but after 120 secons, another random zone (not random, but in a que) will be enabled, and so on and so forth.

  WHAT I WANT TO DO NOW!!!  Is to make sure after 120 seconds, a RANDOM zone is picked and enabled, instead of a "I know what will already happen" que.  But not only this, but I want to make sure AFTER the zone has been picked, it may not be picked again.  For example, we have 8 numbers.

1
2
3
4
5
6
7
8

120 seconds pass, Number 4 has been picked, then another 120 seconds pass, Number 7 has been picked.

1
2
3
5
6
8

And it continues like this with the available numbers.  But only one number is removed at a time (the numbers do represent the areas)

  This is a bit confusing, and  (if asked) to reveal more description, please do say so.
  If anyone can think of a code for this, thank you.  Reply soon.

Re: Random Triggers (or Random Numbers)

Tricky, but doable.  For this method you'd need two arrays, one of which is filled with your 18 areas.  selecting a random number is under math-random I believe.

VARIABLES:
int selected
bool used[18]=false
region areas[18]
EVENT:
120 seconds pass repeating
ACTIONS:
selected = random 1-18
if used[selected] = true, then call(this trigger), else nothing
select all units in (all units in areas[selected]) and kill (selected unit)
used[selected]=true

Re: Random Triggers (or Random Numbers)

If this involves math, I don't want to be a part of it. My mind is just too fragile for math.

4

Re: Random Triggers (or Random Numbers)

Yes.

5

Re: Random Triggers (or Random Numbers)

lachrimae wrote:

If this involves math, I don't want to be a part of it. My mind is just too fragile for math.

Never thought that blizzpub would become victim to random spambot thread bumps.

http://card.mygamercard.net/mini/crastor.pnghttp://myanimelist.net/signature/crast.png
"Throw away logic and kick reason to the curb"