Attck all in way

Status
Not open for further replies.
Level 4
Joined
Aug 19, 2009
Messages
65
I want to make something like DoTa units that spawn go attack other base but still attacks all the other units in the way... my prob is thatr when they attack some stay behind :((:spell_breaker:pls help:spell_breaker:
 
You can order units to "Attack/move" to a target point and use several rects (used as waypoints) in a line to make the units go from one rect to another. That is a quite basic issue, you should find that on AOS/TD tutorials.
Some units may stand still if they cast spells or are stopped through other things. To fix that problem, you need to pick all units that have no command and order them to run to the point they are supposed to run. If you cannot realize this, you can still make them run to the enemy base.
 
This is an example out of my map. My custom function UnitGoOnPushing(unit) is a wrapperfunction that simply orders the units to go to their next specified waypoint. You should replace that with a simple "issue order picked unit to attack/move to center of (target area)" in order to make this work.
Code:
        [b]Set Tempgroup = (Units in (Playable map area) matching ((String((Current order of (Matching unit)))) = <Empty String>)))
        Unitgroup - Pick every unit in Tempgroup and do (Actions)
            Actions[/b]
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    'IF'
                        (Player number of (Owner of (Picked unit))) <= 2
                    'THEN'
                        [b]Custom script:   call UnitGoOnPushing(GetEnumUnit())[/b]
                    'ELSE'
        Custom script:   [b]call DestroyGroup(udg_Tempgroup)[/b]
 
That IS gui.. try this... (Same code.. just with gui tags)
  • Set Tempgroup = (Units in (Playable map area) matching ((String((Current order of (Matching unit)))) = <Empty String>)))
  • Unitgroup - Pick every unit in Tempgroup and do (Actions)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'
          • (Player number of (Owner of (Picked unit))) <= 2
        • 'THEN'
          • Custom script: call UnitGoOnPushing(GetEnumUnit())
        • 'ELSE'
  • Custom script: call DestroyGroup(udg_Tempgroup)
 
Status
Not open for further replies.
Back
Top