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

[Solved] Struggeling with blink ability and attacking afterwards

Status
Not open for further replies.
Level 7
Joined
Mar 10, 2005
Messages
55
Hey,
I'm struggeling myself getting a kind of blink spell to work. My hero teleports behind the enemy and does his damage but then he has a high probability to wander off and attack another enemy even if the trigger tells him otherwise. Could you please help me? (Also tried "Starts the effect of an ability" which makes no difference at all)
blink spell.png

I'll include the map.
Thanks in advance!
 

Attachments

  • Unit-Skill-Testmap2.w3x
    7.3 MB · Views: 13
Last edited:
Level 7
Joined
Mar 10, 2005
Messages
55
I googled a little and found that you can't set the X/Y in the gui. How do I replace the move unit correctly? I have the coordinates (hopefully) saved in the between-point so that I can probably use this X and Y and then I'm not sure if I can use the facing towards the other point.
 
I googled a little and found that you can't set the X/Y in the gui. How do I replace the move unit correctly? I have the coordinates (hopefully) saved in the between-point so that I can probably use this X and Y and then I'm not sure if I can use the facing towards the other point.
call SetUnitX(udg_CasterUnit, GetLocationX(udg_BetweenPoint))
call SetUnitY(udg_CasterUnit, GetLocationY(udg_BetweenPoint))
 
Level 7
Joined
Mar 10, 2005
Messages
55
thanks a lot, the facing now happens upon attacking, so no more fixes needed!

blink spell fixed.png


Just in case anybody will need this in the future, here is the working - mostly gui - trigger for teleporting a unit behind the enemy dealing 5x strength as damage.
It's just frustrating that there are functions which will kill the actions afterwards you you have to learn it the hard way why it happens ;-)
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
order unit to attack x - is not continuous. it fires once, and then any orders that unit recieves afterwards will overwrite it. If you want to ensure that the caster will continue to attack that unit (and not be able to recieve other orders) untill he is done you can do this a number of ways.

I would try this first (least amount of work) - activate another looping trigger that the unit will be in untill it has looped for the amount of times you want - that keep ordering the unit to attack the target unit.

another approach - pause the attacking unit and manually play the attack animation while triggering the damage to the target.

skills like shockwave and stampede (based on channel) which do attribute based damage
pretty sure you can alter the original abilities to do this with Damage engine

a healing potion which heals percentage of your health over time
the way to create this -

(with a unit indexer that assigns custom value)

after casted puts the unit in a unit group.

every second (or less, wtvr) for each unit in this unit group:

add life to the unit how you want.

PotionCounterVariable[custom value of picked unit] = PotionCounterVariable[custom value of picked unit]+1

- if PotionCounterVariable[custom value of picked unit]> 30 (or the amount of time you want)
then -
set PotionCounterVariable[custom value of picked unit] = 0
remove picked unit from unit group.

(it would also make sense to add to the trigger so that it would only be looping while there are units in the unit group)



I hope that was clear enough to be helpful...
 
Level 7
Joined
Mar 10, 2005
Messages
55
thanks for your answer, I relocated the question for your last answers here:

order unit to attack x - is not continuous.
this isn't important. It's just that your hero in the game attacks the unit he casted his spell on attacks the same unit afterwards and not wanders off attacking another random unit.
 
Last edited:
Status
Not open for further replies.
Top