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

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,243
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