• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Move the player hero

Level 5
Joined
Mar 7, 2024
Messages
71
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 40
Joined
Feb 27, 2007
Messages
5,087
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
71
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
71
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 21
Joined
Aug 29, 2012
Messages
865
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