Blink ability with triggers makes unit go too far.

whoopwhoop

Cool Member
Reaction score
1
I recently found out about Warcraft 3 again, but I kind of forgot how I to do it, so I'm relearning everything again.

I made a Blink ability for a Hero that teleports her a small step closer to the targeted point every 0.05 seconds, until she reaches it.
At first the ability worked perfectly, so I moved on to the next hero, but now that I tested it again, she first teleports to the targeted location and then moves further.
I can't figure out what I did wrong, because I didn't change anything in the triggers, and it used to work, it would be nice if someone can find what's wrong.

Trigger:
  • Blink
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink (Sorceress)
    • Actions
      • -------- ----- --------
      • Set Caster = (Triggering unit)
      • Set Caster_Point = (Position of (Triggering unit))
      • Set Target_Point = (Target point of ability being cast)
      • Set TravelDistance = (Distance between Caster_Point and Target_Point)
      • -------- ----- --------
      • Trigger - Turn on Blink Move <gen>
      • Wait 0.51 seconds
      • Trigger - Turn off Blink Move <gen>
      • Custom script: call RemoveLocation(udg_Caster_Point)
      • Custom script: call RemoveLocation(udg_Target_Point)


Trigger:
  • Blink Move
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • -------- ----- --------
      • Set TravelDistance = (TravelDistance + ((Distance between Caster_Point and Target_Point) / 10.00))
      • Set Temp_loc = (Caster_Point offset by TravelDistance towards (Angle from Caster_Point to Target_Point) degrees)
      • -------- ----- --------
      • Unit - Move caster instantly to Temp_loc
      • Animation - Play Caster's spell attack animation
      • -------- ----- --------
      • Unit - Create 1 DummyUnit (Sorceress) for (Owner of Caster) at (Caster_Point) facing (Facing of Caster) degrees
      • Set Dummy = (Last created unit)
      • Unit - Move Dummy instantly to (Caster_Point)
      • Animation - Play Dummy's spell attack animation
      • Unit Group - Add Dummy to Unit_Group
      • Animation - Change Dummy's vertex coloring to (40.00%, 40.00%, 100.00%) with 30.00% transparency
      • Unit - Add a 0.35 second Generic expiration timer to Dummy
      • -------- ----- --------
      • Special Effect - Create a special effect at Temp_loc using Abilities\Spells\Items\AIma\AImaTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Temp_loc)



I know the triggers are messy, I'm still learning.

EDIT: I was also wondering if someone knows how to make floating text go up and fade out.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
could you repost this but just copy and paste the triggers and put [.wc3] [./wc3] without the . plz? its harder to read it like that when you are so used to MUI

and it appears that you should use casting unit, not triggering unit, if the trigger is caused by a cast thats how you identify the unit in the trigger, and i am not exactly sure what you are trying to do, there are a few different ways you can blink, is it just forward a specific distance? or is it just a normal cast? or is it a unit targetting cast like a blinkstrike?
 

whoopwhoop

Cool Member
Reaction score
1
Oh, sorry I fixed it now, I already was wondering how I had to do that.

The ability is like Blink, but instead of instantly moving to the target point, it moves the unit 1/10th of the distance every 0.05 sec, so it *should* reach the target point after 0.50 seconds.

But what it does now is, move the unit instantly to the target point, and then it moves further with the trigger.

Changing it to casting unit didn't work.

EDIT managed to get it to work by adding another point variable and changing the TravelDistance thingy.

This is the trigger now, in case anyone else also has this problem:
Trigger:
  • Blink Move
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • -------- ----- --------
      • Set Temp_loc2 = (Position of Caster)
      • Set TravelDistance = (Distance between Caster_Point and Target_Point) / 10.00)
      • Set Temp_loc = (Temp_loc2 offset by TravelDistance towards (Angle from Caster_Point to Target_Point) degrees)
      • -------- ----- --------
      • Unit - Move caster instantly to Temp_loc
      • Animation - Play Caster's spell attack animation
      • -------- ----- --------
      • Unit - Create 1 DummyUnit (Sorceress) for (Owner of Caster) at (Caster_Point) facing (Facing of Caster) degrees
      • Set Dummy = (Last created unit)
      • Unit - Move Dummy instantly to (Caster_Point)
      • Animation - Play Dummy's spell attack animation
      • Unit Group - Add Dummy to Unit_Group
      • Animation - Change Dummy's vertex coloring to (40.00%, 40.00%, 100.00%) with 30.00% transparency
      • Unit - Add a 0.35 second Generic expiration timer to Dummy
      • -------- ----- --------
      • Special Effect - Create a special effect at Temp_loc using Abilities\Spells\Items\AIma\AImaTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Temp_loc)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top