# Make a trigger that selects multiple random things

#### Ioannes

##### Oh man, I shot Marvin in the face.
There's these 6 regions and I could use some help making a trigger that selects at random 2 of them (and creates a building in the center). Selecting one at random is easy but when I try to select two there is a chance that it picks the same region twice

Any help will be appreciated and rep'd.

#### Dinowc

##### don't expect anything, prepare for everything
I really don't know why were you ignoring my post, maybe you're not familiar with Jass?
anyway, I'll try again:

Trigger:
• MapInit
• Events
• Map initialization
• Conditions
• Actions
• Set Region[0] = Region 1 &lt;gen&gt;
• Set Region[1] = Region 2 &lt;gen&gt;
• Set Region[2] = Region 3 &lt;gen&gt;
• Set Region[3] = Region 4 &lt;gen&gt;
• Set Region[4] = Region 5 &lt;gen&gt;
• Set Region[5] = Region 6 &lt;gen&gt;

Trigger:
• CreateRandom
• Events
• Player - Player 1 (Red) skips a cinematic sequence
• Conditions
• Actions
• Set Count = 5
• For each (Integer A) from 0 to 5, do (Actions)
• Loop - Actions
• Set Index[(Integer A)] = (Integer A)
• For each (Integer B) from 0 to 1, do (Actions)
• Loop - Actions
• Set RandomInt = (Random integer number between 0 and Count)
• Set Point = (Center of Region[Index[RandomInt]])
• Special Effect - Create a special effect at Point using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
• Special Effect - Destroy (Last created special effect)
• Custom script: call RemoveLocation(udg_Point)
• Set Index[RandomInt] = Count
• Set Count = (Count - 1)

to demonstrate you that this is really working, here's a test map

#### Ioannes

##### Oh man, I shot Marvin in the face.
I really don't know why were you ignoring my post, maybe you're not familiar with Jass?
anyway, I'll try again:

Trigger:
• MapInit
• Events
• Map initialization
• Conditions
• Actions
• Set Region[0] = Region 1 &lt;gen&gt;
• Set Region[1] = Region 2 &lt;gen&gt;
• Set Region[2] = Region 3 &lt;gen&gt;
• Set Region[3] = Region 4 &lt;gen&gt;
• Set Region[4] = Region 5 &lt;gen&gt;
• Set Region[5] = Region 6 &lt;gen&gt;

Trigger:
• CreateRandom
• Events
• Player - Player 1 (Red) skips a cinematic sequence
• Conditions
• Actions
• Set Count = 5
• For each (Integer A) from 0 to 5, do (Actions)
• Loop - Actions
• Set Index[(Integer A)] = (Integer A)
• For each (Integer B) from 0 to 1, do (Actions)
• Loop - Actions
• Set RandomInt = (Random integer number between 0 and Count)
• Set Point = (Center of Region[Index[RandomInt]])
• Special Effect - Create a special effect at Point using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
• Special Effect - Destroy (Last created special effect)
• Custom script: call RemoveLocation(udg_Point)
• Set Index[RandomInt] = Count
• Set Count = (Count - 1)

to demonstrate you that this is really working, here's a test map
Yep, I have no idea how Jass works ^^ Care to explain the logic behind the second half?

#### WolfieeifloW

##### WEHZ Helper
There's no real JASS in there, except the one Custom script.
Which is removing the location so it doesn't leak.

General chit-chat
Help Users
• No one is chatting at the moment.
• Ghan:
I really do not want to move to California otherwise I might consider it.
• The Helper:
yeah California is not anywhere you really want to live
• The Helper:
That is why I did not take the job Blizzard offered me back in the day, there is no way I could have moved my family there on what they were offering, not even close and that was like 20 years ago
• The Helper:
yeah they wanted me on the tech support team when they did not get me they got one of the next MVPs in Dinobot
• The Helper:
Dinobot was one of the youngest of the MVPs tkron probably could have worked for Blizzard but he had a good job in Chicago doing business programming already
• The Helper:
Dinobot probably still works for Blizzard would love to reconnect with that guy
• The Helper:
I wonder what ever happened to Wargasm?
• The Helper:
This new version of Xenforo really is awesome
• Ghan:
Wargasm is still around. He works for the domain registrar where thehelper.net is kept.
• Varine:
Is sqrage still around?
• The Helper:
I have not seen him on lately the forum says he was last on 2 years ago
• The Helper:
How are you doing Varine have not seen you around in a minute
• thewrongvine:
lol I live in CA
• thewrongvine:
I've got some friends in animation department who have been applying for Blizzard, doing interviews and such. They said the workplace seems nice, though now it'd be all remote work I suppose
• The Helper:
good for them I live close to Austin and am trying to get my kids interested in getting into Games but not having much luck. I would never let them move to Cali.
• The Helper:
unless it was huge money
• The Helper:
and even then with the taxes I really could never let them move there
• thewrongvine:
Haha fair enough, I have no interest in CA at all as a living place either. Really only here just for the work in LA, but hopefully once I get settled enough in my work, I can move out
+1
• Ghan:
+1
• jonas:
" a traditionally-sized California family of one person "
+1

### Members online

No members online now.