1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Makeshift Taunt Ability

Discussion in 'World Editor Help Zone' started by Mechcash, Sep 13, 2020.

  1. Mechcash

    Mechcash

    Joined:
    May 30, 2018
    Messages:
    246
    Resources:
    0
    Resources:
    0
    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!
     
  2. HerlySQR

    HerlySQR

    Joined:
    Jun 26, 2020
    Messages:
    702
    Resources:
    0
    Resources:
    0
    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
     
  3. [db]east

    [db]east

    Joined:
    Feb 27, 2019
    Messages:
    144
    Resources:
    0
    Resources:
    0
    You can use (Matching unit) to refer to the unit being matched.
    "matching (Matching unit) belongs to an enemy of"
     
  4. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    365
    Resources:
    0
    Resources:
    0
    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.
     

    Attached Files:

  5. Mechcash

    Mechcash

    Joined:
    May 30, 2018
    Messages:
    246
    Resources:
    0
    Resources:
    0
    Thanks for your hard work O-O! Appreciated man.
     
  6. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    365
    Resources:
    0
    Resources:
    0
    No problem. :)