• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

All hero teleport

Status
Not open for further replies.
Level 4
Joined
Sep 27, 2009
Messages
119
If your heroes are created VIA triggers you might want to use a variable (can be an array - Unit) for those each time a hero is created. For each player when they get a unit use the Set Variable: Last Created unit trigger. If you have arrays its Set Variable [Index] : Last Created unit and such. Then you can make a trigger to move all the variable units to the location of your desire.

Assuming you have the hero selection with units and circles and stuff:
  • A Trigger:
  • Events: Unit enters Starting Area
  • Conditions: Owner of Entering Unit equal to Player 1
  • Actions: Set Player 1 Hero to Entering Unit
Starting Area being a region, Entering unit being the unit that just was created and entered the area, Player 1 Hero being the variable used to store the unit.

Now to move.
  • Move:
  • Events: A unit dies.
  • Events: (Your unit) dies.
  • Conditions: Dying unit is equal to (your unit)
  • Actions: Move (use hero varriables here) to (point of desired teleportation)
Note: The second Events on the second trigger is Unit Specific and requires no Condition.
 
Last edited:
Level 9
Joined
Aug 1, 2008
Messages
453
  • Hero teleport
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) controller) Equal to User
            • Then - Actions
              • Unit - Move (Picked unit) instantly to (Center of (Playable map area))
            • Else - Actions
 
Level 4
Joined
Sep 27, 2009
Messages
119
Yeah... that does it up alot better and is cleaner... been a while since I've actually triggered, mostly working on my terraining skills. :hohum:
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Hero teleport
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) controller) Equal to User
            • Then - Actions
              • Unit - Move (Picked unit) instantly to (Center of (Playable map area))
            • Else - Actions

matching (((Picked unit) is a hero... -> matching (matching unit) is a hero...

And it leaks a location + unit group.
 
Level 6
Joined
Mar 22, 2009
Messages
276
try this

  • tele hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to YOURBOSS
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to YOURLOCATION
 
Status
Not open for further replies.
Top