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

Move entering unit to random point in entered region?

Status
Not open for further replies.
Level 10
Joined
Sep 6, 2008
Messages
423
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)
 
Level 12
Joined
Mar 10, 2008
Messages
869
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:
Level 8
Joined
Aug 3, 2008
Messages
391
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
 
Level 12
Joined
Mar 10, 2008
Messages
869
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...
 
Level 4
Joined
May 6, 2007
Messages
87
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.
Top