• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Target point of ability being cast

Status
Not open for further replies.
Level 1
Joined
Feb 18, 2015
Messages
3
Been at this for a while but whenever I try to get the "Target point of ability being cast", it just targets the center of the map. Not really sure why. The trigger works fine except that BarrageTarget always goes to the center of the map.

  • Barrage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Barrage
    • Actions
      • Unit - Pause (Triggering unit)
      • Animation - Play (Triggering unit)'s attack animation
      • Set BarrageUnit = (Triggering unit)
      • Set BarrageTarget = (Target point of ability being cast)
      • Trigger - Turn on BarrageAttack <gen>
      • Trigger - Turn on BarrageEffect <gen>
The ability Barrage is Dispel Magic and BarrageAttack just loops an attack animation.


  • BarrageEffect
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Point = (Position of BarrageUnit)
      • Unit - Create 1 Barrage Unit for (Owner of BarrageUnit) at Temp_Point facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Unit - Turn collision for (Last created unit) Off
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Set BarrageRegionPoint1 = (BarrageTarget offset by (-100.00, 100.00))
      • Set BarrageRegionPoint2 = (BarrageTarget offset by (100.00, -100.00))
      • Set Temp_Point = (Random point in (Region(BarrageRegionPoint1, BarrageRegionPoint2)))
      • Unit - Make BarrageUnit face Temp_Point over 0.50 seconds
      • Unit - Order (Last created unit) to Attack Ground Temp_Point
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call RemoveLocation (udg_BarrageRegionPoint1)
      • Custom script: call RemoveLocation (udg_BarrageRegionPoint2)


The trigger is only half done so nothing will stop the loops.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Because "Target point of ability being cast" is not always used.

If I cast "Defend", "Summon Water Elemental", "War Stomp", "Berserk", etc.
What is the target point do you think?

The target point is nothing... which means (0, 0) in location coordinates, which is the center of the map in almost every map.

You might try "Position of (Targeted unit of ability being cast)", but I dont guarantee 100% that it has a target unit either.
 
Level 1
Joined
Feb 18, 2015
Messages
3
The base spell for my custom ability is "Dispel Magic" so "Target point of ability being cast" should work.
 
Level 1
Joined
Feb 18, 2015
Messages
3
Turns out pausing the triggering unit was messing it up. Removed that action and it started working right.
 
Status
Not open for further replies.
Top