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?
 
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.
Back
Top