• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Trigger ability so it can only target one unit-type

Status
Not open for further replies.
This is a pretty simple set up but works for what you want it to do :)

  • Hero Target
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacked unit)) Equal to Knight
        • Then - Actions
        • Else - Actions
          • Unit - Order (Attacking unit) to Stop
You can also make it move to the unit instead of stopping if you like.
 
its just almost the same

  • !@!
    • Events
      • Unit - A unit begins casting an Ability
    • Conditions
      • ((Triggering Unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target Unit of Ability being Cast)) Equal to Knight
        • Then - Actions
        • Else - Actions
          • Unit - Order (Triggering Unit) to Stop
          • -- Show error if you want that it can't be cast --
its just like that... i used begin casting so it would not cost mana and cooldown when the hero stops
 
jim7777: I tried that, but the event "a unit begins casting an ability" seems to register too late. That is, the unit is ordered to stop after the ability is already cast. Is there a way around this? I tried making the casting time higher than zero.
 
its just almost the same

  • !@!
    • Events
      • Unit - A unit begins casting an Ability
    • Conditions
      • ((Triggering Unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target Unit of Ability being Cast)) Equal to Knight
        • Then - Actions
        • Else - Actions
          • Unit - Order (Triggering Unit) to Stop
          • -- Show error if you want that it can't be cast --
its just like that... i used begin casting so it would not cost mana and cooldown when the hero stops
Jim7777
the event should always be
  • !@!
    • Events
      • Unit - A unit starts the effect of an ability
 
Im sorry this is how it goes.. lol

  • Hero Target
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is A Hero) Equal to True
      • (Unit-type of (Attacked unit)) Equal to Knight
    • Actions
      • Unit - Order (Attacking unit) to Stop
and this is how the ability one goes to not be able to attack knights

  • trig ability
    • Events
      • Unit - A unit begins casting an Ability
    • Conditions
      • ((Triggering Unit) is A Hero) Equal to True
      • (Unit-type of (Target Unit of Ability being Cast)) Equal to Knight
    • Actions
      • Unit - Order (Triggering Unit) to Stop
make both triggers like this, you will need both in order for it not to be able to attack or cast abilities on the knights

:)
 
yeah thats good too then you wont even need triggers for it xD

But if theres a ton of different ability's for different heros, making my 2 simple triggers will be faster and easier..
 
Last edited:
Status
Not open for further replies.
Back
Top