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

[Trigger] Trying to make a 2 second delayed snipe attack

Status
Not open for further replies.
Level 6
Joined
Dec 11, 2014
Messages
93
I'm looking to make a flavourful version of snipe for my ranger hero, where she basically takes aim (uses her stand ready animation) for about 2 seconds or so, then shoots the target for massive damage (preferably using the spell animation where it looks like she is shooting an arrow into the sky.)

I tried giving the ability to her directly, but when I give it a cast time or put any delay on it, she just kinda stands there and does nothing, which defeats the purpose of her using the animations. (It's a bit nitpicky, but to me it's like Jaina standing there doing nothing while her blizzard happens. Like what's up with that???)

So I figured it's time to finally try to figure out Dummy Units and casting abilities from them instead, now let's jump in!

My Heroes ability Snipe is based on Acid Bomb. I will also attach a screenshot of the current settings for acid bomb, maybe the problem lies there?
Then my DummyUnits Snipe ability is based on Archimonde's Finger of Death, which I believe I have it ordered right to cast? I didn't see my custom spell as an option and from guides, it looked like I needed to use the base spell for that section?
I'm not entirely sure where I am messing up, as this is my first attempt at a DummyUnit target spell.

Any advice on how to better achieve this would be appreciated. (The sound isn't necessary, I just put it in there for fun.)

P.S. All levels of snipe are the exact same, the only difference in the triggers is which snipe ability (level 1, 2, or 3) get added to the dummy unit ((All are based on Archimonde's Finger of Death.)

  • Snipe Level 1Red
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Snipe
      • (Level of Snipe for (Triggering unit)) Equal to 1
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Set VariableSet RangerLocationRed = (Position of (Triggering unit))
      • Set VariableSet SnipeTargetRed = (Target unit of ability being cast)
      • Animation - Play (Triggering unit)'s stand ready animation
      • Sound - Play ArcherYesAttack3 <gen> at 100.00% volume, located at RangerLocationRed with Z offset 0.00
      • Sound - Destroy (Last played sound)
      • Wait 1.70 seconds
      • Animation - Play (Triggering unit)'s spell animation
      • Unit - Create 1 DummyUnitRanger (Level 1) for (Owner of (Triggering unit)) at RangerLocationRed facing 0.00 degrees
      • Unit - Add a 1.20 second Generic expiration timer to (Last created unit)
      • Set VariableSet DummyRangerRed = (Last created unit)
      • Unit - Add Snipe (Dummy Unit Level 1) to DummyRangerRed
      • Unit - Order DummyRangerRed to Special Archimonde - Finger Of Death SnipeTargetRed
      • Custom script: call RemoveLocation(udg_RangerLocationRed)
      • Set VariableSet SnipeTargetRed = No unit
      • Wait 1.35 seconds
      • Animation - Reset (Casting unit)'s animation
 

Attachments

  • DummyVersionSnipe.png
    DummyVersionSnipe.png
    153.7 KB · Views: 10
  • SnipePart1.png
    SnipePart1.png
    133.9 KB · Views: 9
  • SnipePart2.png
    SnipePart2.png
    173.1 KB · Views: 9
Level 20
Joined
Feb 27, 2019
Messages
592
As with some things, it seems the very next instance in time is needed to play the animation, achieved best with a timer. If you want to keep the ability as vanilla as possible I hope this will help get you started. I use casting time for the ability. Worth to note is that I found the correct event by adding a debug message to the actions, then I realized this event fires when ability begins.
  • Trig
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • Countdown Timer - Start T as a One-shot timer that will expire in 0.00 seconds
  • Trig2
    • Events
      • Time - T expires
    • Conditions
    • Actions
      • Animation - Play Paladin 0000 <gen>'s stand victory animation
In regards to the spell you posted, I find it better to use triggering unit as much as possible because triggering unit acts as a local variable. Then it doesnt matter if you use waits or whatever. I would also rather create the dummy instantly and add a 1.7 second casting time to the ability it casts instead of using a wait because then everything happens instantly and there is no need for waits other that for the triggering unit. With that youd even make the spell mui.

Itd also be more compact if you didnt check for the level of the ability in the initial condition but instead added the same level as the triggering unit to the ability given to the dummy. Now you have removed the need for 1 trigger per player and 1 trigger per level of ability into a single trigger.
 
Last edited:
Level 6
Joined
Dec 11, 2014
Messages
93
As with some things, it seems the very next instance in time is needed to play the animation, achieved best with a timer. If you want to keep the ability as vanilla as possible I hope this will help get you started. I use casting time for the ability.
  • Trig
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • Countdown Timer - Start T as a One-shot timer that will expire in 0.00 seconds
  • Trig2
    • Events
      • Time - T expires
    • Conditions
    • Actions
      • Animation - Play Paladin 0000 <gen>'s stand victory animation
In regards to the spell you posted, I find it better to use triggering unit as much as possible because triggering unit acts as a local variable. Then it doesnt matter if you use waits or whatever. I would also rather create the dummy instantly and add a 1.7 second casting time to the ability it casts instead of using a wait because then everything happens instantly and there is no need for waits other that for the triggering unit. With that youd even make the spell mui.

Itd also be more compact if you didnt check for the level of the ability in the initial condition but instead added the same level as the triggering unit to the ability given to the dummy. Now you have removed the need for 1 trigger per player and 1 trigger per level of ability into a single trigger.
That's actually genius. I don't know why I didn't think of that, it doesn't matter if his cast time is 1.7 seconds because he isn't even visible! THANKS so much!
 
Level 20
Joined
Feb 27, 2019
Messages
592
You should be careful with the trigger. It will still finish the ability from the dummy even if the triggering unit gets stunned. That has an effect on the game play. In vanilla, if the unit is stunned, the channeled ability stops. I also found an error with me saying to create the dummy instantly. If the triggering unit gets teleported or moved, the dummy will still be close to the target and finish the ability, although to be fair thats how it was with the location previously as well.
 
Status
Not open for further replies.
Top