• 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.

Unit can be killed by particular unit

Status
Not open for further replies.
Level 30
Joined
Aug 29, 2012
Messages
1,383
If you're using the latest version of the editor, you can do it easily with triggers like so:

  • Farm
    • Events
      • Unit - Farm 0000 <gen> Takes damage
    • Conditions
      • (Damage source) Not equal to Guard Tower 0001 <gen>
    • Actions
      • Event Response - Set Damage of Unit Damaged Event to 0.00
It will check any damage dealt to the farm, and if the attacker isn't that specific guard tower, then the damage is nullified
 
Last edited:
Level 3
Joined
Nov 23, 2023
Messages
8
If you're using the latest version of the editor, you can do it easily with triggers like so:

  • Farm
    • Events
      • Unit - Farm 0000 <gen> Takes damage
    • Conditions
      • (Damage source) Not equal to Guard Tower 0001 <gen>
    • Actions
      • Event Response - Set Damage of Unit Damaged Event to 0.00
It will check any damage dealt to the farm, and if the attacker isn't that specific guard towerd, then the damage is nullified
It works perfectly! Thank you!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,876
You can also prevent the attack entirely using this Event, which is most likely all you need:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • ((Attacked unit) Equal to Farm 0000 <gen>
    • ((Attacking unit) Not equal to Guard Tower 0001 <gen>
  • Actions
    • Unit - Order (Attacking unit) to Stop
But Chaosium's method is nice because it's going to prevent ALL damage which could help in some cases like splash damage or damaging spells.

Combine both for the best results, in my opinion.

If you want every Farm to be immune to this Guard Tower then you need to rely on the Unit-Type Comparison condition:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • (Unit-type of (Attacked unit)) Equal to Farm
    • ((Attacking unit) Not equal to Guard Tower 0001 <gen>
  • Actions
    • Unit - Order (Attacking unit) to Stop
And if you want every Farm to be immune to every Guard Tower then you can do this:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • (Unit-type of (Attacked unit)) Equal to Farm
    • (Unit-type of (Attacking unit)) Equal to Guard Tower
  • Actions
    • Unit - Order (Attacking unit) to Stop
These two triggers are more Generic which is often needed if you want things to work for more than 1 unit at a time.
 
Last edited:
Status
Not open for further replies.
Top