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

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