Even for acquiring a target and attacking a target

M4573R

New Member
Reaction score
1
EVENT*
I'd like a trigger to go off when a unit even thinks about attacking something from anywhere on the map. It could be right clicking on somebody, or auto-acquiring somebody, or ordering to attack somebody.

So far all I can catch is literally issuing an attack order.
 

Faust

You can change this now in User CP.
Reaction score
123
Right click (on an enemy = attack order): Unit is ordered targeting a unit
Order is "smart" (or "attack"), order's target unit is an enemy.

Auto acquiring:
You need a dynamic trigger for that, look up an "any unit damaged" system, and replace the Add Event line to your Add Event (specific unit event: Acquires a target
 

M4573R

New Member
Reaction score
1
The "smart" order works great for right clicking, but auto acquiring doesn't seem to work. I would use "targeted unit" and "triggering" unit right?

Edit: Woops, my Actions code was still trying to use "ordered unit" so it wasn't working for all the conditions.

Thanks!
 

vypur85

Hibernate
Reaction score
803
Code:
Event
 Map Init
Condition
Actions
 Unit group - Pick units in Playable map area....
   Loop - Actions
     Trigger - Add to SomeTrigger <gen> the event (Unit - (Picked unit) Acquires a target

Code:
Event
 A unit enters Playable map area
Condition 
Actions
 Trigger - Add to SomeTrigger <gen> the event (Unit - (Triggering unit) Acquires a target

Code:
SomeTrigger
 Event
 Condition
 Actions
   Game - Display to Allplayer.... : It fires!

Triggering unit is the unit who detects. Targeted unit is the unit who is being detected. Not sure if this fires according to what you want though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top