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

Makeshift Taunt Ability

Status
Not open for further replies.
Level 7
Joined
May 30, 2018
Messages
290
I made this really really bad taunt ability

  • Taunt Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Taunt
    • Actions
      • Unit Group - Add all units of (Units within 300.00 of (Position of (Casting unit)) matching (((Target unit of ability being cast) belongs to an enemy of (Owner of (Casting unit)).) Equal to True).) to Group_Taunt
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Group_Taunt.) Equal to True
        • Then - Actions
          • Unit Group - Order Group_Taunt to Attack (Casting unit)
          • Wait 3.25 seconds
          • Unit Group - Remove (Attacking unit) from Group_Taunt.
          • Custom script: call DestroyGroup(udg_Group_Taunt)
        • Else - Actions
and this to prevent the taunted player to select his unit

  • Taunt Check
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Triggering unit) is in Group_Taunt.) Equal to True
    • Actions
      • Selection - Remove (Triggering unit) from selection for (Triggering player)
The problem is the taunting unit gets added to the unit group itself and therefore it is also deselected after using its own ability. Does somebody has an idea how to fix this.

Thanks!
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
This trigger has a lot of errors.
  1. Taunt is an ability with no target, you can't use "Target unit of ability being cast" for that.
  2. "Triggering unit is in Group_Taunt" triggering unit is the casting unit, so what? And that if/then/else is unnecessary.
  3. "Remove attacking unit" attacking unit is only when the event is "Unit is attacked" not always a unit is attacked, replace it for
    • Unit Group - Remove all units of Group_Taunt
    But I don't think if this is necessay if you will delete it later.
  4. You did wrong your memory leak clean, because you create a pointer before to asign it a variable instead of make the variable be the pointer, the correct will be:
    • Set Group_Taunt=Units within 300 etc
 
Level 12
Joined
Feb 5, 2018
Messages
521
I made it for you. Copy taunt and unit indexer folder from the test map.

The way I made it like this, is that now you will have an invidual Time Varible for each casting unit, meaning that the units in the TauntCheckGroup will always be deselected as long as the time is greater than 0.00 and the caster is alive.

If the caster dies, or the time reaches 0.00 the triggers are turned off and the deselection is turned off.

It's completely MUI.

The test map includes neutral units casting the taunt and some footmans. Feel free to test it, I added game text messages, so you can see how it works.
In single player you can see the logs :)

I also added some trigger comments for better understanding. The most useful thing for you to change is Taunt_Time. Tweak it to your desires.
 

Attachments

  • taunt.w3m
    24.2 KB · Views: 33
Level 7
Joined
May 30, 2018
Messages
290
I made it for you. Copy taunt and unit indexer folder from the test map.

The way I made it like this, is that now you will have an invidual Time Varible for each casting unit, meaning that the units in the TauntCheckGroup will always be deselected as long as the time is greater than 0.00 and the caster is alive.

If the caster dies, or the time reaches 0.00 the triggers are turned off and the deselection is turned off.

It's completely MUI.

The test map includes neutral units casting the taunt and some footmans. Feel free to test it, I added game text messages, so you can see how it works.
In single player you can see the logs :)

I also added some trigger comments for better understanding. The most useful thing for you to change is Taunt_Time. Tweak it to your desires.

Thanks for your hard work O-O! Appreciated man.
 
Status
Not open for further replies.
Top