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

Conditional firing.

Status
Not open for further replies.
Level 8
Joined
Mar 20, 2007
Messages
224
Alright, I have my turret. It can either do nothing, or attack things. It will not attack anything unless given an order.

Now, an enemy footman comes into range of the turret. I order my turret to fire on the footman.

But wait! I want to check if a condition is met (is the footman the color blue, for example) - before I allow the turret to attack. If the footman is not blue, I want to stop it from firing (I assume I send it the order to stop?).

But, if this condition is met, our turret will happily fire at the footman. But wait! The footman suddenly turns purple - and I want to check whenever the turret fires (or just before), if the footman is blue - if it is not, then stop firing.

Any idea's what events I need, and how I would structure my triggers?
 
Level 25
Joined
Jun 5, 2008
Messages
2,573
You need this:

  • Unit is issued an order targeting an unit
  • Conditions - Unit type of triggering unit equal to *yourunit*
    • - Order Comparison - Issued order equal to Attack
  • Actions - If/then/else
    • - If *your conditions*
    • - Then *your actions*
    • - Else do Unit issue order - Issue triggering unit to Stop
If this helped you give me rep point :D.
 
Status
Not open for further replies.
Top