• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Move entering unit to random point in entered region?

Status
Not open for further replies.
It's possible in GUI..
  • Example
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Set TempLoc = (Random point in Region 000 <gen>)
      • Unit - Move (Triggering unit) instantly to TempLoc
      • Custom script: call RemoveLocation(udg_TempLoc)
 
What i really want to do is do about 20 regions in the 1 trigger, so that's why i said move entering unit to random point in entered region

So like...

  • Teleport
    • Events
      • Unit - Unit enters <Region>
      • Unit - Unit enters <Region>
      • Unit - etc...
    • Conditions
    • Actions
      • Unit - Move entering unit instantly to random point in entered region
 
Last edited:
What i really want to do is do about 20 regions in the 1 trigger, so that's why i said move entering unit to random point in entered region

So like...

  • Events:
  • Unit - Unit enters <Region>
  • Unit - Unit enters <Region>
  • Unit - etc...
  • Conditions:
  • Actions:
  • Unit - Move entering unit instantly to random point in entered region

You got to have alot of ifs... like this maybe:

  • Events:
  • Unit - A unit enters Region 000 <gen>
  • Unit - A unit enters Region 001 <gen>
  • Unit - A unit enters Region 002 <gen>
  • Conditions:
  • Actions:
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 000 <gen> contains (Position of (Entering Unit))) Equal to True
      • Then - Actions
        • Unit - Move (Entering Unit) instantly to (Random point in Region 000 <gen>
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 001 <gen> contains (Position of (Entering Unit))) Equal to True
      • Then - Actions
        • Unit - Move (Entering Unit) instantly to (Random point in Region 001 <gen>
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 002 <gen> contains (Position of (Entering Unit))) Equal to True
      • Then - Actions
        • Unit - Move (Entering Unit) instantly to (Random point in Region 002 <gen>
      • Else - Actions
 
You got to have alot of ifs... like this maybe:

  • Events:
  • Unit - A unit enters Region 000 <gen>
  • Unit - A unit enters Region 001 <gen>
  • Unit - A unit enters Region 002 <gen>
  • Conditions:
  • Actions:
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 000 <gen> contains (Position of (Entering Unit))) Equal to True
      • Then - Actions
        • Unit - Move (Entering Unit) instantly to (Random point in Region 000 <gen>
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 001 <gen> contains (Position of (Entering Unit))) Equal to True
      • Then - Actions
        • Unit - Move (Entering Unit) instantly to (Random point in Region 001 <gen>
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region 002 <gen> contains (Position of (Entering Unit))) Equal to True
      • Then - Actions
        • Unit - Move (Entering Unit) instantly to (Random point in Region 002 <gen>
      • Else - Actions

That is what i wanted to avoid with this, but i guess i'm gonna have to do it the long way...
 
Relatively sure you can do it like this:

  • Trigger
    • Events
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Region[IntegerA] <gen> contains (Position of (Entering unit))) Equal to (==) True
            • Then - Actions
              • Unit - Move (Entering unit) instantly to (Center of Region[IntegerA] <gen>)
            • Else - Actions

Just create an array for the region, and add your regions to the array.
 
Status
Not open for further replies.
Back
Top