• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Order Units problem

Status
Not open for further replies.
Level 1
Joined
Aug 13, 2009
Messages
2
My Problem to order the units controled by the computer intelligent so that thay attack the heros from the human players.

I tried this trigger
  • Order Units
  • Events
    • Time - Every 4.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units owned by Player 12(Brown)) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack (Random unit from NotP12Units)
NotP12Units are the heros controled by the human players that have to
survive and player 12 is the computer player

But with this trigger it only attack a random survivor and so all creeps change their target every 4 sec. Thist make the map to easy

I Need a Trigger were the creeps attack the unit that is closest and it would be good when only units are picked if they don't have a target so that the units that already have a target don't get a new.

It would be great if someone could help me!
 
Last edited:
Level 6
Joined
Mar 22, 2009
Messages
276
This trigger will order p12's units to attack a random enemy unit.
It wont change its target unless the targeted unit run away.
In case that the target run, p12's unit will attack the nearest one.
I cant tell if this is the one you needed but I hope this can help you give an idea. :cute:

  • attack one target
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set notP12 = (All enemies of Player 12 (Brown))
      • Player Group - Pick every player in notP12 and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • Set NotP12unit = (Picked unit)
              • Unit Group - Add NotP12unit to Notp12unitGP
      • Set No_Target = (Units owned by Player 12 (Brown) matching (((Matching unit) is in Got_Target) Equal to False))
      • Unit Group - Pick every unit in No_Target and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Got_Target
          • Unit - Order (Picked unit) to Attack (Random unit from Notp12unitGP)
  • remove from got target
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is in Got_Target) Equal to True
    • Actions
      • Unit Group - Remove (Killing unit) from Got_Target
      • Unit Group - Remove (Attacking unit) from Got_Target
Good luck!:wink:
 
Last edited:
Level 1
Joined
Aug 13, 2009
Messages
2
Thx for your answer swipe5weep

I will try your trigger, but tomorow i fly in the holidays, so i must wait.

And for those how had the same problem like me i made a one too. But i can't say if it's easier or better than swipe5weep's cause i don't realy had time to test it.
  • Events
    • Time - Every 0.04 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Order(attack)) unequal (Current order of (Picked unit))
          • Then - Actions
            • Unit - Order (Picked unit) to Attack (Random unit from NotP12Units)
          • Else - Actions
 
Status
Not open for further replies.
Top