• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Ordering my dummy to cast a spell

Status
Not open for further replies.
Level 5
Joined
Jun 28, 2008
Messages
127
How do I make my dummy unit cast a spell when the hero casts a spell. I have my hero casting thunder clap (holy nova is custom name) and I want my dummy to cast essence of blight (holy nova heal is custom name) at the same time.

Here is where i'm at so far.

  • Holy Nova
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Holy Nova
    • Actions
      • Set caster = (Triggering unit)
      • Unit - Create 1 Dummy Unit for (Owner of caster) at (Position of caster) facing (Facing of caster) degrees
      • Set dummy = (Last created unit)
      • Unit - Set level of Holy Nova Heal for dummy to (Level of Holy Nova for caster)
Thanks :thumbs_up:
 
Level 8
Joined
Aug 4, 2006
Messages
357
To make it work, you only need to add one more line. However, you have a point leak so I cleaned that up for you with some custom script.
  • Holy Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Nova
    • Actions
      • Set caster = (Triggering unit)
      • Set tempPoint = (Position of caster)
      • Unit - Create 1 Dummy Unit for (Owner of caster) at tempPoint facing (Facing of caster) degrees
      • Set dummy = (Last created unit)
      • Unit - Set level of Holy Nova Heal for dummy to (Level of Holy Nova for caster)
      • Unit - Order dummy to Undead Obsidian Statue - Essence of Blight
      • Custom script: call RemoveLocation(udg_tempPoint)
You need to make a point variable called tempPoint. If you want to know more about leaks, find out here: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-memory-leaks-5889/ among other places.
 
Level 5
Joined
Jun 28, 2008
Messages
127
@maskedpoptart - Thanks for the help, unfortunately it still doesn't work!

The dummy doesn't cast the spell I want him to (the essence of blight)... :(

Maybe there is another way to order a unit to cast a spell? Just guessing here lol

Thanks
 
Level 8
Joined
Aug 4, 2006
Messages
357
I'd suggest making the dummy visible for testing purposes. Do you see it spawn? Do you see it not cast the spell? Also, make sure the Text - Order String of your dummy's ability is "replenishlife" (order string for essence of blight). Keep in mind you may not see any units being healed if they are all at full health. I don't know what else could be the problem.
 
Status
Not open for further replies.
Top