• 🏆 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!

How to summon 2 heroes at once

Status
Not open for further replies.
Level 3
Joined
Oct 22, 2022
Messages
13
SO I'm making 2 custom heroes (Mage A cannot attack but can only use spells while Hero A can attack and his abilities are for tanking/offense) however both of them are connected to each other, if one dies so does the other, now how do I make it so that when Hero A is trained/revived then Mage A will spawn right next to him? Also if you guys know how to make them follow one another when the other is too far away (ex. Mage A walks 10 meters away from Hero A, then Hero A would immediately follow her and vice versa.) please let me know.
 
Level 20
Joined
Aug 29, 2012
Messages
837
This is one way of how you can do the summon thing

  • Test
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Triggering unit) Equal to Paladin 0000 <gen>
    • Actions
      • Hero - Instantly revive Archmage 0001 <gen> at (Position of Paladin 0000 <gen>), Hide revival graphics
      • Unit - Move Archmage 0001 <gen> instantly to (Position of Paladin 0000 <gen>)
(Yes it leaks, that's just for the sake of the example)

Then you can do the same trigger by reversing the heroes. You get the idea :) It also depends how exactly your heroes are summoned/revived I guess
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
The following requires "leash" logic. Every few seconds check distance between the two heroes and if it is bigger than the leash range then you remove control (might be possible with new natives?) of the mage and order them to follow or move to the main hero. If the main hero is teleported, you might need to teleport the mage as well.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
worried teleport would sometimes cause crashes if the unit doesn't exist
You can check for existance if you want. Even then, moving null/nil is likely quite safe.
maybe just order unit to location of other unit, of course use a point variable that does not leak.
This requires that all points on the map be accessible without teleport.
 
Status
Not open for further replies.
Top