• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Single Target Taunt

Status
Not open for further replies.
Level 5
Joined
May 1, 2009
Messages
52
Right... Ive been trying to make a single target taunt ability
The taunt ability is meant to PERMANENTLY force the target to attack you untill aggro/threat resets (casting spells, movement etc resets aggro/threat btw)

Problem is in my ability i just did "Order targetted unit to attack triggering unit"
But this gives totally no reaction from my target if other units are near he will keep attacking the target he was attacking.

Then i tried doing "every 0.01 sec Order targetted unit to attack triggering unit" but that made the attack animation of my target to become very weird... It would attack me tho but it just looked very very weird and it moved with pauses if i kited it...

Oh and dont give me the idea of using the area of effect taunt and making my target have a certain classifications since that wont work since its meant to work on multiple mobs...

(if it is only possible with jass, then just say that instead of typing down a whole jass thing, cuz i wont use it)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1- Save the Caster Handle as (x) in the Target Handle. (On Hashtable)
2- Add the target to a unit group
3- In a periodic trigger every 0.05 do
- Pick every unit in Group
If/Then/Else
If (Picked Unit) current order not equal to attack
Order (Picked Unit) to attack (Load [x] in the (Picked Unit) handle)

etc...

Means: Save the Caster in some variable (Hash, unit index, etc.) and order in a periodic trigger the target to attack the caster ONLY IF the target isn't currently attacking the caster.
 
Level 5
Joined
May 1, 2009
Messages
52
I did what you said, Still didnt work and had same effect

This is why:
My target is ordered to attack once i come in range automaticly (not triggerred or anything thats just how enemy units behave :p)
this order doesnt stop inbetween his 'attack cooldown'
so he is ordered to attack whole the time as long as enemies are near even tho you dont actually see him attack cause his attack might be on 'cooldown'
meaning your trigger cant get inbetween that.

with 'attack cooldown' i btw reffer to attack speed,
if he attacks every 5 seconds then in the 5 seconds between each attack
he is still ordered to attack byt just waiting for those seconds to pass
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
But the unit remains forced to attack you, and the animation isn't bugged since it's only forced to attack you when he has a different order than attacking you. If he has a 5s attack cd, he will just run behind you untill he's able to attack again, but he's attacking.

That's what taunt does... Force a unit to attack the caster.
 
Level 5
Joined
May 1, 2009
Messages
52
Yeah but he isnt forced to attack me, cause your trigger only forces him to attack me when he isnt attacking but he is attacking hwole the time so it doesnt work

EDIT: Forgot to mention that i discovered that i got an outdated version on my laptop since i couldnt use hastables but it still is basicly the same ill just post the triggers of what i did.

  • Taunt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Taunt
      • (Unit-type of (Casting unit)) Equal to Silver Knight
    • Actions
      • Set SilverKnight = (Casting unit)
      • Set TauntTarget = (Targetted unit of ability being cast)
      • Trigger - Turn on Taunt Force <gen>
  • Taunt Force
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of TauntTarget) Not equal to (Order(attack))
        • Then - Actions
          • Unit - Order TauntTarget to Attack SilverKnight
        • Else - Actions
          • Do nothing
Ill update my wc3 later, gotta go now.
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
The problem with that is that he could be attacking someone else and he would still be attacking :)

This is the same than Legion Commander's ultimate in Dota, but I can't figure how to achieve it.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's. If he's forced to attack the caster during a period of time. He could order to attack someone else, and it would still be attacking.
 
Level 5
Joined
Jan 12, 2010
Messages
132
If u know to use hashtable this will be a child job.
  • Map init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Taunt_table = (Last created hashtable)
  • Taunt cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Taunt
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in Taunt_group) Equal to False
        • Then - Actions
          • Hashtable - Save 5.00 as 1 of (Key (Target unit of ability being cast)) in Taunt_table
          • Hashtable - Save Handle Of(Triggering unit) as 2 of (Key (Target unit of ability being cast)) in Taunt_table
          • Unit Group - Add (Target unit of ability being cast) to Taunt_group
        • Else - Actions
          • Hashtable - Save 5.00 as 1 of (Key (Target unit of ability being cast)) in Taunt_table
          • Hashtable - Save Handle Of(Triggering unit) as 2 of (Key (Target unit of ability being cast)) in Taunt_table
          • Hashtable - Save Handle Of(Triggering unit) as 3 of (Key (Target unit of ability being cast)) in Taunt_table
  • Taunt event
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
      • (Number of units in Taunt_group) Greater than or equal to 1
    • Actions
      • Unit Group - Pick every unit in Taunt_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set Temp_real = (Load 1 of (Key (Picked unit)) from Taunt_table)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_real Greater than or equal to 0.05
                • Then - Actions
                  • Hashtable - Save (Temp_real - 0.05) as 1 of (Key (Picked unit)) in Taunt_table
                  • Set Temp_unit = (Load 2 of (Key (Picked unit)) in (Last created hashtable))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Current order of (Picked unit)) Not equal to (Order(attack))
                          • (Load 3 of (Key (Picked unit)) in Taunt_table) Not equal to Temp_unit
                    • Then - Actions
                      • Unit - Order (Picked unit) to Attack Temp_unit
                    • Else - Actions
                • Else - Actions
                  • Unit Group - Remove (Picked unit) from Taunt_group
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Taunt_group
  • Taunt check
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is in Taunt_group) Equal to True
      • (Triggering unit) Not equal to (Load 2 of (Key (Attacking unit)) in Taunt_table)
    • Actions
      • Hashtable - Save Handle Of(Triggering unit) as 3 of (Key (Attacking unit)) in Taunt_table
 
Level 5
Joined
May 1, 2009
Messages
52
Updated my wc3

Anyway, Still doesnt work with your triggers
The target now looks at the taunter for like 1 second sometimes attacking once
and then turns back to his previous target...

Also using 'stop' has the same effect if i putted it in my first trigger
And if i putted stop in the loop he obviously just stood frozen so stop definatly doesnt help

Oh and the target isnt player controlled btw its just neutral hostile mobs incase someone got that wrong :p

EDIT: And yeah i dont have alot of experience with hashtables but i just copied the whole trigger checked it 3 times when i noticed it failed to make sure i made no mistake but nah it doesnt wrok.
 
Last edited:
Status
Not open for further replies.
Top