• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

True Taunt ability (make taunted units ignore player commands completely)

Status
Not open for further replies.
Level 12
Joined
May 16, 2020
Messages
660
Hi guys,

I read a lot of threads how to make a taunt ability that forces enemies to attack a target for X seconds.

The best I found was this:
  • Events
    • Unit - A unit Is issued an order targeting an object
    • Unit - A unit Is issued an order targeting a point
    • Unit - A unit Is issued an order with no target
  • Actions
    • Set VariableSet BerserkerCall_UnitTemp = (Triggering unit)
    • Set VariableSet BerserkerCall_Target_CV = (Custom value of BerserkerCall_UnitTemp)
    • Trigger - Turn off (This trigger)
    • Unit - Order BerserkerCall_UnitTemp to Attack BerserkerCall_Caster[BerserkerCall_Target_CV]
    • Trigger - Turn on (This trigger)

However, when testing it does not really work. The taunted unit can still be ordered to do something else - which renders the above in my opinion useless.
So as "workaround" I use another (in addition to the above) trigger that forces the taunted unit to attack the target every 0.03 seconds. But this is really inefficient and can still be circumvented by clicking very fast...

So my question: Does anyone have a better solution to make a unit completely ignore player commands while taunted?
 
Level 12
Joined
May 16, 2020
Messages
660
Thanks all.

@Solu9 I will need to investigate how to do this in my map. I think the problem is that chaning the player will require some reworks of other systems in my map. For example, I use a kill/death/last player attacker system to show who the killer of a unit is. Switching a taunted unit to another player will mess this up a bit (but I guess with Bribe's "LethalDamageEvent" that could work...)

@A]mun / @Karzama As Uncle wrote, Dota uses the same method described above. Unfortunately the ward/unselect methods don't work (ward can still be controlled, the buttons are just hidden, and unselect doesn't work because in an online game the player can still briefly select the unit and give it commands due to online delay)

@DracoL1ch Have you solved this issue in your dota map?
 
Level 12
Joined
Mar 13, 2020
Messages
421
Here is an Example how you can disable the control of the player just test it...
if i get you right thats what you want to not use any hotkeys or move or anything just seeing doing your unit was the command your enemies ability do for him...
in second 6 the enemy fears you you will have 5 seconds no control about your unit
in second 12 he fears your allie hero and he will have no control but you are still good to use anything just test it :)


Triggers:

  • Death Coil Disable Control
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Todesmantel
    • Actions
      • Set VariableSet DeathCoilUnit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of DeathCoilUnit[(Player number of (Owner of (Target unit of ability being cast)))]) Equal to Player 1 (Red)
        • Then - Actions
          • Selection - Select DeathCoilUnit[1] for Player 1 (Red)
          • Cinematic - Disable user control for Player Group - Player 1 (Red).
          • Trigger - Turn on Death Coil Timer Player Red <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of DeathCoilUnit[(Player number of (Owner of (Target unit of ability being cast)))]) Equal to Player 2 (Blue)
            • Then - Actions
              • Selection - Select DeathCoilUnit[2] for Player 2 (Blue)
              • Cinematic - Disable user control for Player Group - Player 2 (Blue).
              • Trigger - Turn on Death Coil Timer Player Blue <gen>
            • Else - Actions
  • Death Coil Timer Player Red
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet DeathCoilTimer[1] = (DeathCoilTimer[1] + 1)
      • Unit - Order DeathCoilUnit[1] to Move To (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeathCoilTimer[1] Greater than or equal to 5
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set VariableSet DeathCoilTimer[1] = 0
          • Cinematic - Enable user control for Player Group - Player 1 (Red).
          • Selection - Select DeathCoilUnit[1] for Player 1 (Red)
          • Set VariableSet DeathCoilUnit[1] = No unit
        • Else - Actions
  • Death Coil Timer Player Blue
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet DeathCoilTimer[2] = (DeathCoilTimer[2] + 1)
      • Unit - Order DeathCoilUnit[2] to Move To (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeathCoilTimer[2] Greater than or equal to 5
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set VariableSet DeathCoilTimer[2] = 0
          • Cinematic - Enable user control for Player Group - Player 2 (Blue).
          • -------- This Trigger under this comment its only because hes an Computer Player... and if move was his last order he wont get back in combat and do anything without AI --------
          • Unit - Order DeathCoilUnit[2] to Attack Todesritter 0002 <gen>
          • Selection - Select DeathCoilUnit[2] for Player 2 (Blue)
          • Set VariableSet DeathCoilUnit[2] = No unit
        • Else - Actions
 

Attachments

  • Disable Control (Like Fear in Wow) Example.w3m
    16 KB · Views: 11
Level 12
Joined
Mar 13, 2020
Messages
421
i mean depends on for what you need it if you have only one hero in a boss fight its fine.. if you have other building and units you can select and control it sucks a bit because you are forced to do nothing...
but maybe there is a jass command im not sure...

Ps. wenn du es genau wie in wow willst lock die kamera zu der unit und reset die dann in dem timer trigger :)

 
Last edited:
Level 12
Joined
May 16, 2020
Messages
660
Thanks a lot Pwnica, although not perfect, in my opinion that's better than what I currently use (at least the taunted player cannot click very fast to prevent some attacks) :wthumbsup:
That fear effect reminded me of Chopinski's Sylvanas hero concept, so I thought maybe he has a smart solution. He apparently uses this Fear system:


@Uncle: I don't really understand what is going on there, but might some triggers from there be useful to create a taunt, without loosing access over ALL units?



Here the trigger if anyone is interested:

  • Berserker Call
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Berserker's Call
    • Actions
      • Set VariableSet BerserkersCall_CasterTemp = (Triggering unit)
      • -------- --------
      • Set VariableSet BerserkersCall_Point = (Position of BerserkersCall_CasterTemp)
      • Unit - Create 1 Dummy (Fly/Speed 0) for Neutral Passive at BerserkersCall_Point facing Default building facing degrees
      • Set VariableSet BerserkersCall_Dummy = (Last created unit)
      • Unit - Add Berserker's Call (Dummy) to BerserkersCall_Dummy
      • Ability - Set Ability: (Unit: BerserkersCall_Dummy's Ability with Ability Code: Berserker's Call (Dummy))'s Real Level Field: Duration - Normal ('adur') of Level: 0 to (1.60 + (0.40 x (Real((Level of Berserker's Call for BerserkersCall_CasterTemp)))))
      • Ability - Set Ability: (Unit: BerserkersCall_Dummy's Ability with Ability Code: Berserker's Call (Dummy))'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to (1.60 + (0.40 x (Real((Level of Berserker's Call for BerserkersCall_CasterTemp)))))
      • Unit - Add a 0.50 second Generic expiration timer to BerserkersCall_Dummy
      • -------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of BerserkersCall_Point.) and do (Actions)
        • Loop - Actions
          • Set VariableSet BerserkersCall_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (BerserkersCall_Unit is alive) Equal to True
              • (BerserkersCall_Unit is A structure) Equal to False
              • (BerserkersCall_Unit belongs to an enemy of (Owner of BerserkersCall_CasterTemp).) Equal to True
            • Then - Actions
              • Set VariableSet BerserkersCall_CV = (Custom value of BerserkersCall_Unit)
              • Set VariableSet BerserkersCall_Caster[BerserkersCall_CV] = BerserkersCall_CasterTemp
              • Unit - Order BerserkersCall_Dummy to Neutral Brewmaster - Drunken Haze BerserkersCall_Unit
              • -------- --------
              • Unit - Order BerserkersCall_Unit to Attack BerserkersCall_CasterTemp
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (BerserkersCall_Unit is in BerserkersCall_Group.) Equal to False
                • Then - Actions
                  • Unit Group - Add BerserkersCall_Unit to BerserkersCall_Group
                  • -------- --------
                  • Set VariableSet BerserkersCall_PlayerGroup = (Player group((Owner of BerserkersCall_Unit)))
                  • Cinematic - Disable user control for BerserkersCall_PlayerGroup.
                  • Custom script: call DestroyForce(udg_BerserkersCall_PlayerGroup)
                • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation (udg_BerserkersCall_Point)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BerserkersCall_Group) Greater than 0
          • (Berserker Call Loop <gen> is on) Equal to False
        • Then - Actions
          • Countdown Timer - Start BerserkersCall_Timer as a Repeating timer that will expire in 0.03 seconds
          • Trigger - Turn on Berserker Call Loop <gen>
        • Else - Actions
  • Berserker Call Loop
    • Events
      • Time - BerserkersCall_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BerserkersCall_Group) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in BerserkersCall_Group and do (Actions)
            • Loop - Actions
              • Set VariableSet BerserkersCall_Unit = (Picked unit)
              • Set VariableSet BerserkersCall_CV = (Custom value of BerserkersCall_Unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (BerserkersCall_Unit is alive) Equal to True
                  • (BerserkersCall_Unit has buff Berserker's Call Target) Equal to True
                • Then - Actions
                  • Unit - Order BerserkersCall_Unit to Attack BerserkersCall_Caster[BerserkersCall_CV]
                • Else - Actions
                  • Unit Group - Remove BerserkersCall_Unit from BerserkersCall_Group.
                  • -------- --------
                  • Set VariableSet BerserkersCall_Caster[BerserkersCall_CV] = No unit
                  • Unit - Order BerserkersCall_Unit to Stop.
                  • -------- --------
                  • Set VariableSet BerserkersCall_PlayerGroup = (Player group((Owner of BerserkersCall_Unit)))
                  • Cinematic - Enable user control for BerserkersCall_PlayerGroup.
                  • Custom script: call DestroyForce(udg_BerserkersCall_PlayerGroup)
        • Else - Actions
          • Countdown Timer - Pause BerserkersCall_Timer
          • Trigger - Turn off (This trigger)
 
Level 12
Joined
Feb 5, 2018
Messages
521

In this thread there is an taunt I made for someone, it removes the unit selection. Works like a charm in single player, not tested in multiplayer.

Check it out :)
 
Edit: I just rewrote the whole post. It got messy with all those edits.

So here is, what seems to be, a functioning Taunt ability.
It uses a computer controlled ally which acts as a swapper controller while the unit is taunted.
All players except for swapper players have an upgrade called TauntReg which is set to level 1 when the map initializes.
When a unit is taunted it gets swapped to the corresponding computer controlled ally, thereby losing the TauntReg upgrade and therefore won't be able to use abilities, and is orders to attack the taunter for the duration of the Taunt. When the duration ends, the unit will be swapped back to the original owner, thus regaining the TauntReg upgrade and will be able to use abilities again.
I would highly recommend that your swapper ally players are used from last player (player 24) and downwards -> 23 -> 22 -> 21 etc.
Remember for each team in your map you will need a computer controlled swapper ally.

The Taunt ability should support multi-users. Please correct me if I'm wrong.

Requirements:
  • For each team in the map there needs to be a corresponding swapper ally player.
  • ALL abilities on units that are tauntable must have the Techtree - Requirement of the upgrade TauntReg.

Test map specifics:
  • Right now the taunted unit changes color for the sake of visual confirmation, just change that to "retain color" in the trigger.
  • You can see the blue unit will continuously cast Holy Light when not taunted (standard AI behavior, this is not triggered), but only attack while it is.
  • Most importantly. Even if you change the blue unit to Player 1 and taunts it, you won't be able to control it.
  • Please check the forces settings in the editor as well. It's important that you set forces up correctly.

It's been ages since I used the editor so the triggers probably look horrible



@Ugabunda @Uncle - thought you might find this interesting
 
Level 12
Joined
May 16, 2020
Messages
660
Thanks Solu! From a pure "does it work" perspective this is probably the best solution.
Especially if you add these 2 select commands to the triggers, then for the taunted player it really looks as if your taunted unit lost control, but it's still the same unit:

  • Selection - Select TauntedUnit for TauntedPlayer
  • Selection - Select TauntedUnits[Taunted_int] for TauntedPlayers[Taunted_int]

The issue with the change ownership solution is just that it conflicts a bit with other systems in my map. In my map, whenever a player unit attacks another player unit, I keep track of this "last attacker". I do this because when a player hero dies, all attacking players are credited for the kill. Hence the change ownership solution is not as easily applicable in my case, as I will need to link the computer controlled swapper unit to the player to which the unit originally belonged to, so that players who attacked the computer swapper also get credit. But I think I can do this, I will just need some time to work it out - so thanks!

One comment: Is this TauntReg even required?

Currently I don't think it does anything, as the TestUnit_1 and 2 don't even have the Upgrades and the "Taunt Setup" is just setting the TauntDuration = 5.

1641545415694.png
 
The issue with the change ownership solution is just that it conflicts a bit with other systems in my map. In my map, whenever a player unit attacks another player unit, I keep track of this "last attacker". I do this because when a player hero dies, all attacking players are credited for the kill.
Here you could do an "if" when determining the "last attacker". Some pseudo code:
Code:
if - Last Attacker has Buff of type Taunted
then - Loop through TauntedUnits
      if - TauntedUnits[integer] = Last Attacker
      then - Change Last Attacker's owner to TauntedPlayers[integer]

Implement how you see fit. Point being that you can get the true owner of the taunted unit by iterating through TauntedUnits[].

One comment: Is this TauntReg even required?
You might have version 0.2?
This is how it looks in 0.3
1641551341217.png

In version 0.3 I went from having a unit as TauntReg to use an upgrade instead.
It's also the abilities, and not the units that require this Techtree - Requirement.
I subtract the number of teams here, because I feel it's best to use the last players as swapper players. You can change this to whatever you feel like of course.
What's important is that the swapper ally players do not gain the TauntReg upgrade.

Edit:
Note that after looking through the triggers again, I can see that it's still not multi-user eligible. Well, it's multi-player eligible, but again only if each player controls one unit. Since right now, if you taunt a second unit of a player, and the last unit of that player is still taunted, the first will be stuck in an infinite ally owner state.
I'll look into this.
 
Last edited:
Alright I think everything is working properly now.
I'm now storing in a hashtable instead of variables which enables the system to handle as many taunted units as you want.
First time really using hashtables so I'm kinda surprised it works.

Anyway.
To get what player a taunted Last Attacker really belongs to (assuming Last Attacker is a unit), you now need to do (again pseudo code):
Code:
if - Last Attacker has Buff of type Taunted
then -
TempPlayer* = Load (key Player.) of (Key(Last Attacker).) from TauntedHash
*TempPlayer is just a player variable to add a reference to the original owner of the taunted unit.

Something along those lines. You have to work this out on your own to fit it to your map.

I've added a TauntBuffer unit so the players can see the Taunted Buff on a taunted unit along with some visuals.
Everything else should be the same.


Edit:
I've uploaded the system in the spells section -
Taunt System
 
Last edited:
Level 12
Joined
May 16, 2020
Messages
660
It's also the abilities, and not the units that require this Techtree - Requirement.
I subtract the number of teams here, because I feel it's best to use the last players as swapper players. You can change this to whatever you feel like of course.
What's important is that the swapper ally players do not gain the TauntReg upgrade.

And you use this "dummy upgrade" to prevent the neutral player from activating any abilities, correct?
Maybe I can just change the AI, but just an idea?

I've added a TauntBuffer unit so the players can see the Taunted Buff on a taunted unit along with some visuals.
Everything else should be the same.

Thanks a lot - looks already better :)
 
And you use this "dummy upgrade" to prevent the neutral player from activating any abilities, correct?
Maybe I can just change the AI, but just an idea?



Thanks a lot - looks already better :)

Oh yeah sure. If you can limit the use of abilities in general for a certain player that should do the trick as well.
Keep me informed if you come up with anything.
 
Status
Not open for further replies.
Top