• 🏆 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] Forced Taunt

Status
Not open for further replies.
Level 3
Joined
May 26, 2010
Messages
24
How does one goes about making a forced taunt?
You cast an ability on a single unit, that causes the unit to attack you for 3 seconds.
The attack is forced, no other order would stop the unit from attacking you.
I have read the other posts on Hiveworkshop regarding this.
There was one asking on how to make DOTA's Axe's Berserker's Call.


I looked into that and found it not to my liking.
Firstly, the triggers doesn't seem to be MUI.
Secondly, that forced taunt was a taunt that targets every unit around the caster.
Since i am looking for a single target taunt, i tried modifying it.
The trigger broke after the first successful cast.

So, any thoughts on this?
I would like it to be GUI and MUI.
If that's too difficult( I understand that GUI is kinda inflexible, being constrained by the rules of the Trigger Editor),
could i have a solution in Jass?(Not vJass for now)
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Pick the unit ure targeting and make him/her attack the caster every 0.01 second
That does not work, because the attack will be canceled every time it is reordered.

You can possibly track orders and order the target to attack the caster, when the unit is ordered a different order, but even then attacks will be canceled.
So one could spam the stop command for instance in order to prevent attacking (the unit will still move to the target, but attacks will be canceled when a new order is issued).

Another possible way could be changing the owner of the unit, which has a ton of side effects.
 
In order to prevent attacks from being canceled, you can disable unit control for owner of taunted unit. Alternatively, you can deselect the taunted unit and force the player to deselect it every time it is selected until the taunt expires. Both solutions have their own issues, which is why DotA simply lets you cancel the attack when taunted.
 
Level 3
Joined
May 26, 2010
Messages
24
In order to prevent attacks from being canceled, you can disable unit control for owner of taunted unit. Alternatively, you can deselect the taunted unit and force the player to deselect it every time it is selected until the taunt expires. Both solutions have their own issues, which is why DotA simply lets you cancel the attack when taunted.
Both solutions are viable , what are the issues for both? I am looking to implement this in Melee, so it would be less taxing i guess?
 
Level 3
Joined
May 26, 2010
Messages
24
Hmm, then i found a way. I could use custom script to add locust to taunted unit. At point of cast, forces the unit to attack caster, and have the owner deselect the unit. Locust would be added by then. I would have a dummy cast a debuff spell on the taunted unit.
To make it MUI, i would just have a trigger checking whether the taunted unit have the taunt buff to it. Once the buff expires, the taunted unit would lose its locust effect and be ordered to stop.
If its a Hero, its even simpler!
Just order the Hero to attack the caster.
No need for the forced effect.
I can simply explain it as Hero spell resistance.
 
That's probably not a good idea because Locust makes units invulnerable. Unless you want the taunted unit to be invulnerable for the duration.

You're better off just doing

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Taunt
  • Actions
    • Unit - Order (Target unit of ability being cast) to Attack (Triggering unit)
  • Events
    • Player - Player 1 (Red) Selects a unit
    • Player - Player 2 (Blue) Selects a unit
    • Etc...
  • Conditions
    • ((Triggering unit) has buff Taunt) Equal to True
  • Actions
    • Selection - Remove (Triggering unit) from selection for (Triggering player)
This is extremely basic, but it works. The main problem is the taunted unit won't be reselected when the duration ends, which might be annoying to the player. You'd need a timer to fix that, unfortunately.
 
Last edited:
Level 3
Joined
May 26, 2010
Messages
24
Hmm whats the code?
=========================================
I had found an alternate way.
I will share it in case somebody wants to do something similar.
Screenshots will be shared later.

I went to have a look on how ppl do their MUI Gui spells, and i noticed that they tend to save their units into unit arrays. They always have a set of triggers, one the casting trigger and the loop trigger.
The casting trigger sets the variables and turns on the loop, while the loop ensures the spell works as long a condition is met. The loop is disabled initially, and the casting trigger turns it on.

I did something like this.
I set the variables in the casting trigger and in the looping trigger, i have the unit attack the caster as long as it has a taunt buff. Once the buff expires, i cleared the unit arrays and turned it off. It should be MUI like that.

Also, to discourage ppl from using the same spell twice on the same unit from two casters,
I added an If Else. If the unit already has a Taunt buff, the loop trigger will not run and the unit arrays will not be set.
 
Last edited:
Status
Not open for further replies.
Top