• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Dummy Unit?

Status
Not open for further replies.
Level 6
Joined
Feb 16, 2014
Messages
193
So heres what i wanted to happen:
When the unit uses an item on an area or unit then a dummy unit(like mortar team) will be created at the position of the unit using the item,that created unit will use Attack Ground on the point of the target point of the item being used.i made this trigger but it didnt work what am i doing wrong?
  • M202A2
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to M202A2
    • Actions
      • Unit - Create 1 M20 for (Owner of (Hero manipulating item)) at (Position of (Hero manipulating item)) facing Default building facing degrees
      • Wait 0.01 seconds
      • Unit - Order (Last created unit) to Attack Ground (Target point of ability being cast)
 
Level 21
Joined
Aug 13, 2011
Messages
739
To get both the position of the triggering unit (the unit using the item) and the targeted point, use these instead:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to M202A2ItemAbility
Then refer to the unit as triggering unit or casting unit instead of hero manipulating item.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Yeah, Tickles is right. I see what your trying to do. The item your using has an ability, so when the item is used, the ability takes effect. "A Unit Starts the Effect of an Ability" will detect this.

Here is the trigger you need:

  • Mortar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Water Elemental
    • Actions
      • Unit - Create 1 Mortar Team for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack Ground (Target point of ability being cast)
I recommend you research what memory leaks are so you can fix those.
 
Level 6
Joined
Feb 16, 2014
Messages
193
Maybe the Unit - Remove (Last created unit) from game would take care of the leak?
EDIT: well the remove last created unit thing didnt work very well because the other units still didnt get removed so i did the Unit - add expiration timer but i have a new problem,how to remove the unit's death sound ?
 
Last edited:
Expiration timers, though needed, do not remove leaks, as units are not leaks. The leaks are Position of Triggering Unit and Target Point of Ability being cast. Store them into variables and use 'call RemoveLocation(udg_<name>)'.

To remove death sound, you can have a trigger run when a dummy dies then remove it.
 
Level 6
Joined
Feb 16, 2014
Messages
193
Expiration timers, though needed, do not remove leaks, as units are not leaks. The leaks are Position of Triggering Unit and Target Point of Ability being cast. Store them into variables and use 'call RemoveLocation(udg_<name>)'.

To remove death sound, you can have a trigger run when a dummy dies then remove it.

Um what kind of trigger, i dont know what it is(tried finding it but still cant find it)
 
Status
Not open for further replies.
Top