• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make a sucsessfull attack movement? (Like Kodotag)

Status
Not open for further replies.
Level 11
Joined
Nov 1, 2008
Messages
828
  • Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Unit Group - Pick every unit in (Units of type Kodo) and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Picked player))))))
This trigger doesn't work at all, it does attack but it attacks the wrong buildings and after awhile they get stuck. What must i do?

+rep!


edit: Like for example if the kodos killed some units they get stuck because they have nothing else to do.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Ditch the player group thing.

set unit group = units in playable map area matching unit is alive and owner of matching unit is *your condition*
Custom script: set bj_wantDestroyGroup = true
Unit group - pick all units matching unit type of matching unit == kodo and matching unit is alive and owner of matching unit is an enemy of P12
loop
set unit = random unit from unit group
if unit not equal to null then
order picked unit to attack unit // not sure if you want to use attack-move

Remove leaks: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 11
Joined
Nov 1, 2008
Messages
828
Ahh thanks, all going well, exsept. How would i add the "loop"? So the kodo doesn't go back to where it started when its finnished.

Also, i would like it to attack move,

So far i have this,
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Set unit_group_kodo = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to (Picked player)))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in unit_group_kodo and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Unit-type of (Matching unit)) Equal to Kodo) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))
          • Then - Actions
            • Set Unit = (Random unit from unit_group_kodo)
          • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top