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

[Spell] Blink Strike

Status
Not open for further replies.
Level 3
Joined
Oct 31, 2014
Messages
55
hi guys, i wanted to make a skill similar to the blink of rikimaru with the move instantly action but doens't work well (im a real noob and sorry for my english)
can someone help me please?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Make an ability based of Channel (Neutral Hostile - Hero) and name it Blink Strike... or whatever you want to call it.
Then make an ability based of Blink (Night Elf - Hero)

For the Blink Strike ability, change the following fields:
Data - Disable Other Abilities - false
Data - Follow Through Time - 0.00
Data - Options - Visible
Data - Target Type - Unit Target
Stats - Targets Allowed - Allied, Enemy, Ground, Not self
Also change stuff like range, cooldown, mana cost, tooltips, art, etc.

For the Blink Strike ability, change the following fields:
Data - Maximum Range - (To the maximum range that you want + 100)
Data - Minimum Range - 0.00
Stats - Cooldown - 0.00
Stats - Hero Ability - false
Stats - Mana Cost - 0

Then make the trigger:
  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blink Strike
        • Then - Actions
          • Unit - Add Blink to (Casting unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) belongs to an ally of (Owner of (Casting unit))) Equal to False
            • Then - Actions
              • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 50.00 damage of attack type Spells and damage type Normal
            • Else - Actions
              • Do nothing
          • Unit - Order (Casting unit) to Night Elf Warden - Blink ((Position of (Target unit of ability being cast)) offset by 33.00 towards ((Facing of (Target unit of ability being cast)) + 180.00) degrees)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blink
        • Then - Actions
          • Wait 0.01 game-time seconds
          • Unit - Remove Blink from (Casting unit)
        • Else - Actions
This will cause the ability to deal 50 damage if the target is an enemy
It will teleport the caster to 33 units behind the target unit but if the target has more collision than 33 then it will look weird sometimes.

Add Blink Strike to the unit you want to let it have.

Then you are done :D
 
Level 3
Joined
Oct 31, 2014
Messages
55
wow thanks! works just fine but there is something that annoys me, the damage applies first and then he blinks. its there a way to make both happen at the same time?
 
Level 8
Joined
Jul 8, 2013
Messages
249
The above trigger has several issues and potential issues with it:

1) the trigger leaks a point
2) because the trigger moves the unit via an actual blink, there will be a delay before the unit moves. Not only does this guarantee that the damage happens before the movement, but it ALSO leaves you wide open to a bug occurring if your unit gets stunned while trying to cast the blink etc.
3) the triggered damage will be reduced by armor value because the damage type is Normal instead of Universal. Always remember this: when triggering damage, the only 2 damage types that matter are Normal which is reduced by armor and Universal which is not.
4) the unit will face the direction it was facing before, rather than the target of the attack.

Do use the channel ability as he suggested, but don't use an actual blink ability. Instead just create a variable called TempPoint and do this:

  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink Strike
    • Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Move (Triggering unit) instantly to TempPoint, facing TempPoint
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Universal
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
Replace the special effect thunderclap with whatever flashy cool thing you want to appear at the actual point you go to.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
That depends...

If you want to do that you need a wait so you can make it happen a bit later (to match the blink)
But if you do that you will be having a problem if that ability is cast 2 times at the same time. (Rare occasion but possible)
You just have to add variables because targeted unit of ability being cast will be removed when the wait triggers.
So the new Trigger will look like this:
  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- TempCaster and TempTarget are Unit variables --------
      • Set TempCaster = (Casting unit)
      • Set TempTarget = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blink Strike
        • Then - Actions
          • Unit - Add Blink to (Casting unit)
          • Unit - Order (Casting unit) to Night Elf Warden - Blink ((Position of (Target unit of ability being cast)) offset by 33.00 towards ((Facing of (Target unit of ability being cast)) + 180.00) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) belongs to an ally of (Owner of (Casting unit))) Equal to False
            • Then - Actions
              • Unit - Cause TempCaster to damage TempTarget, dealing 50.00 damage of attack type Spells and damage type Normal
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blink
        • Then - Actions
          • Wait 0.01 game-time seconds
          • Unit - Remove Blink from (Casting unit)
        • Else - Actions
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
The above trigger has several issues and potential issues with it:

1) the trigger leaks a point
2) because the trigger moves the unit via an actual blink, there will be a delay before the unit moves. Not only does this guarantee that the damage happens before the movement, but it ALSO leaves you wide open to a bug occurring if your unit gets stunned while trying to cast the blink etc.
3) the triggered damage will be reduced by armor value because the damage type is Normal instead of Universal. Always remember this: when triggering damage, the only 2 damage types that matter are Normal which is reduced by armor and Universal which is not.
4) the unit will face the direction it was facing before, rather than the target of the attack.

Do use the channel ability as he suggested, but don't use an actual blink ability. Instead just create a variable called TempPoint and do this:

  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink Strike
    • Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Move (Triggering unit) instantly to TempPoint, facing TempPoint
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Universal
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
Replace the special effect thunderclap with whatever flashy cool thing you want to appear at the actual point you go to.

1) Yea I have never actually cared so much about leaks and didnt check this one for any.

2) Damage was indeed noticed before the actual blink, (see other reply)
Noone said that it may not be possible for other players to counter you right? So the Stun is kinda not a bug.
The Damage should indeed be on the Blink part of the trigger. (Notice that Ability Being Cast is not Blink Strike any more)

3) Can I assume that the point of that it always deals 50 damage is also an issue?
The amount of damage, damage type and attack types are not part of the ability. They are part of the variable effect. Therefor they can be changed and so I dont have anything to do with what it should be.
Maybe he wanted the damage to be reduced by armor for example.

4) Yea that could be something weird but as I dont really know how channel works and the caster is still channeling when he blinks, i cant seem to set the angle to the target.

New Trigger:
  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blink Strike
        • Then - Actions
          • -------- TempCaster and TempTarget are Unit variables --------
          • Set TempCaster = (Casting unit)
          • Set TempTarget = (Target unit of ability being cast)
          • Unit - Add Blink to (Casting unit)
          • Unit - Order (Casting unit) to Night Elf Warden - Blink ((Position of (Target unit of ability being cast)) offset by 33.00 towards ((Facing of (Target unit of ability being cast)) + 180.00) degrees)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blink
        • Then - Actions
          • Wait 0.01 game-time seconds
          • Unit - Remove Blink from (Casting unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempTarget belongs to an ally of (Owner of TempCaster)) Equal to False
            • Then - Actions
              • Unit - Cause TempCaster to damage TempTarget, dealing 50.00 damage of attack type Spells and damage type Normal
            • Else - Actions
        • Else - Actions
 
Level 8
Joined
Jul 8, 2013
Messages
249
2) Damage was indeed noticed before the actual blink, (see other reply)
Noone said that it may not be possible for other players to counter you right? So the Stun is kinda not a bug.
The Damage should indeed be on the Blink part of the trigger. (Notice that Ability Being Cast is not Blink Strike any more)

Right, damage happened before the blink and he didn't want that. My trigger solves that, your trigger still doesn't really. The problem is that his unit is going to have a cast point >0 so there will be a delay between being ordered to blink and actually blinking.

No see, the bigger problem is that if the blink is interrupted in your trigger (by a stun, by stop canceling, etc.) then the blink ability IS NOT REMOVED. That means that the unit can later blink wherever it wants one time.

And with regard to damage ignoring armor, that was one of the things I was saying was a potential issue but not necessarily an issue. I just wanted to explain to him how triggered damage works.

which variable type is that variable?
In my trigger, TempPoint is a point. In Wietlol's trigger, TempCaster is a unit and TempTarget is a unit.
 
Level 3
Joined
Oct 31, 2014
Messages
55
Melth i have an issue with your trigger, when i cast the skill i do blink, it consumes the mana but doesn't activate the cooldown of the skill and it doesn't deal the damage either
 
Level 8
Joined
Jul 8, 2013
Messages
249
Figured out a solution. First of all, move the damage part of the trigger above the move instantly. That solves the damage problem you were having (since I assumed the order was arbitrary, the version I actually tested with had had those switched).

Second, add in Pause triggering unit right before the instant move and unpause triggering unit right after the instant move. That solves the cooldown.

  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink Strike
    • Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Universal
        • Else - Actions
      • Unit - Pause (Triggering unit)
      • Unit - Move (Triggering unit) instantly to TempPoint, facing TempPoint
      • Unit - Unpause (Triggering unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
 
Level 8
Joined
Jul 8, 2013
Messages
249
No problem. Now that it's working, allow me to complicate your life with some suggestions for improvements:

1) You may have noticed that the blinking unit always moves to a spot just southwest of the enemy (assuming both are ground units and take up pathing space). If you want to avoid that, you could do one of the following:

Define another point variable TempPoint2 (and add another custom script removing that location at the end of the trigger to clear the leak).

If you want to blink to right behind the target then:
  • Set TempPoint2 = (TempPoint offset by -100.00 towards (Facing of (Target unit of ability being cast)) degrees)
And then set the point you move instantly to and the point the special effect is created at to TempPoint2 instead of TempPoint (but still have the facing degree when you move instantly be TempPoint if you want to face the target)

If you want to blink to a random spot around the target then same thing but instead
  • Set TempPoint2 = (TempPoint offset by 100.00 towards (Random angle) degrees)
2) I don't think Wietlol told you to change Channel's Data- Base Order ID. If this unit will never use another ability based on channel, that's fine. However, if you want multiple abilities based on channel, change the base order ID for each of those to something different or the abilities will interfere with each other and bug.

3) If you want to make the blinking unit appear to attack the target, you could consider adding something like this:
  • Animation - Change (Triggering unit)'s animation speed to 300.00% of its original speed
  • Unit - Make (Triggering unit) face TempPoint over 0.00 seconds
  • Animation - Play (Triggering unit)'s attack animation
  • Wait 0.20 game-time seconds
  • Animation - Change (Triggering unit)'s animation speed to 100.00% of its original speed
  • Animation - Reset (Triggering unit)'s animation
Put that right after the unit is moved. Like most triggered animations it will work a little sloppily and it will technically be happening after the damage (but with the highly boosted animation speed, that may not be obvious). If you want it to look like an attack is going on though, something like that is the way to go.
 
Level 3
Joined
Oct 31, 2014
Messages
55
i have a problem with the blink behind target, when i changed the point you move instantly to PointTemp2 the hero teleport to the center of the map o_O
 
Level 8
Joined
Jul 8, 2013
Messages
249
When referencing things multiple times, (Triggering Unit, etc.) store them into a variable. Variables are faster than functions.

Yeah, you can do that and it helps with some things like having different abilities interact with each other or with abilities that require multiple triggers to work, but I've never noticed a difference in speed.

i have a problem with the blink behind target, when i changed the point you move instantly to PointTemp2 the hero teleport to the center of the map o_O

That generally means the point you were supposed to go to (TempPoint2) was not defined for some reason. For example, the location was removed. What does your trigger look like now? (If you didn't already know, to paste a trigger in here you first get to it in the world editor and right click the page symbol at the top of the trigger functions then click copy as text. Then paste it here, select it in the text box here, and click the gear icon that says "wrap trigger tags around text")
 
Level 3
Joined
Oct 31, 2014
Messages
55
  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink Strike 1
    • Actions
      • Set TempPoint2 = (TemPoint offset by -100.00 towards (Facing of (Target unit of ability being cast)) degrees)
      • Set TemPoint = (Position of (Target unit of ability being cast))
      • Set CasterPoint = (Position of (Triggering unit))
      • Special Effect - Create a special effect at CasterPoint using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((Real((Agility of (Triggering unit) (Include bonuses)))) x 4.50) damage of attack type Spells and damage type Universal
        • Else - Actions
      • Unit - Pause (Triggering unit)
      • Unit - Move (Triggering unit) instantly to TempPoint2, facing TemPoint
      • Unit - Unpause (Triggering unit)
      • Custom script: call RemoveLocation (udg_TemPoint)
something like this :p
 
Level 8
Joined
Jul 8, 2013
Messages
249
Well there's your problem! TempPoint2 is being defined as TempPoint1 with an offset before TempPoint exists! That's impossible so the world editor has no idea what you want to do and defaults to the center of the map.

Put TempPoint2 below TempPoint 1 at the beginning and the problem should be solved.

Also, at the end, you want to copy and paste that RemoveLocation line twice and change the second one to remove TempPoint2 and the third one to remove CasterPoint. (Otherwise TempPoint2 and CasterPoint will leak).
 
Status
Not open for further replies.
Top