• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Random Battle Fields?

Status
Not open for further replies.
Level 23
Joined
Oct 20, 2012
Messages
3,075
Hey Guys, I need a trigger or a system that would randomize where two heroes would be in an event..

Like, for example..
a Special event timer turns o, then a trigger chooses two random heroes (controlled by two opposing players) then places them in one of the three battle fields I have..

attachment.php
attachment.php
attachment.php


and of course they are placed in two opposite start points (two small regions in the battlefields) but in the third battlefield, I also want to randomize where the heroes would show in the four small regions.. and if possible, could you guys also give me another system that would randomly open and close the gates in the third battlefield? thanks in advance! :goblin_good_job:

and ps: the region in the center of the first and second battlefields is where the prize will be placed after.. and in the third area the prize would be random.. so those center regions should not be counted as start locations...
 

Attachments

  • 1.JPG
    1.JPG
    72.5 KB · Views: 254
  • 2.JPG
    2.JPG
    101.3 KB · Views: 241
  • 3.JPG
    3.JPG
    61.5 KB · Views: 223
Level 6
Joined
Aug 27, 2008
Messages
210
In GUI it would look something like this:

  • Set Hero1 = (Random unit from (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)))
  • Set Hero2 = (Random unit from (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Not equal to (Owner of Hero1)))))
  • Set field = (Random integer number between 1 and 3)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • field Equal to 1
    • Then - Actions
      • Unit - Move Hero1 instantly to Field1Start1
      • Unit - Move Hero2 instantly to Field1Start2
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • field Equal to 1
    • Then - Actions
      • Unit - Move Hero1 instantly to Field2Start1
      • Unit - Move Hero2 instantly to Field2Start2
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • field Equal to 1
    • Then - Actions
      • Unit - Move Hero1 instantly to Field3Start1
      • Unit - Move Hero2 instantly to Field3Start2
    • Else - Actions
And if you want to randomize the last one's regions you can so the same thing inside the last If actions
Randomly opening the gates depends on whether you want to open only a certain number at a time, but it would be done as a periodic event where, once again, you generate random numbers and put them into variables.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • field Equal to 1
    • Then - Actions
      • Unit - Move Hero1 instantly to Field1Start1
      • Unit - Move Hero2 instantly to Field1Start2
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • field Equal to 1
    • Then - Actions
      • Unit - Move Hero1 instantly to Field2Start1
      • Unit - Move Hero2 instantly to Field2Start2
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • field Equal to 1
    • Then - Actions
      • Unit - Move Hero1 instantly to Field3Start1
      • Unit - Move Hero2 instantly to Field3Start2
    • Else - Actions

why do the three of the ITE's have the same condition ?
 
Status
Not open for further replies.
Top