• 🏆 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 create a non-selectable summon that follows you?

Status
Not open for further replies.
Level 2
Joined
Jan 5, 2013
Messages
8
I know this is possible because in the Warcraft custom map Defense of the Shrines (A DotA rip-off using Touhou characters), a hero, Youmu Konpaku, has her ghost-self follow her around whenever she casts that summon ability. It cannot be selected but it follows her around as well as attack whenever a unit is close.

Is it using a 'Follow Unit' trigger or is there something more?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Add an ability called "Locust" to that unit.
The ability in hexadecimal form is 'Aloc', here's how you add the ability to the summoned unit (assuming you "create" the unit via trigger);
  • Summon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Unit - Create 1 Summon for (Triggering player) at TempLoc facing Default building facing degrees
      • Set SummonUnit = (Last created unit)
      • Custom script: call UnitAddAbility(udg_SummonUnit, 'Aloc')
      • Custom script: call RemoveLocation(udg_TempLoc)
This will make your unit to be unselectable.

You can also add this ability via Object Editor.

For the trigger to follow the unit, perhaps it uses interval or one-time follow order, it must have some algorithm of an AI, you need to create it (trigger it) to behave like human-owned unit.
 
Level 6
Joined
Nov 24, 2012
Messages
218
I had a trigger doing this in one of my maps.

I have a wolf unit that has a spell creating 7 transparent illusions of itself (same unit but with locust ability and changed transparency).
Upon creation, all I did was order it to right click the main wolf unit (I have a feeling follow will work the same).
Now they will follow you everywhere, and target whatever the main wolf attacks via right clicks, else it attacks random (only if main wolf is attacking also).
 
Status
Not open for further replies.
Top