Move the player hero

Level 5
Joined
Mar 7, 2024
Messages
79
Is there a way that when the event starts, all of the player's heroes will teleport to the selected location? The teams' civilians will not be teleported, my map has player 1 to player 6.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
That doesn’t check player number and will move every hero that exists on the map (that doesn’t have Locust). If you want to filter out by player I would add an additional filter condition:
  • (Player number of (Owner of (Matching Unit))) less than or equal to 6
You could also do a loop over each player’s units but that’s more work and if this isn’t being done hundreds of times per second the difference won’t matter.
 
Level 5
Joined
Mar 7, 2024
Messages
79
That's easy enough

  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions) // This is a boolean condition
    • Loop - Actions
      • Unit - Move (Picked unit) instantly to (Your Location)
Does this cause neutral hostile heroes to be teleported as well?
 
Level 5
Joined
Mar 7, 2024
Messages
79
That doesn’t check player number and will move every hero that exists on the map (that doesn’t have Locust). If you want to filter out by player I would add an additional filter condition:
  • (Player number of (Owner of (Matching Unit))) less than or equal to 6
You could also do a loop over each player’s units but that’s more work and if this isn’t being done hundreds of times per second the difference won’t matter.
The start event repeats every 200 seconds or so. All hero players will be teleported to the selected map, and the hero must have the item Kelen's Dagger of Escape. If the hero does not have that item, he will not be teleported, can you help me with this?
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
Does this cause neutral hostile heroes to be teleported as well?

Yes, that would teleport all heroes in the map. You need to add the condition above if you want to filter out which heroes are teleported. As for the dagger, add in this boolean condition as well

  • ((Matching unit) has an item of type Kelen's Dagger of Escape) Equal to True
 
Top