Waves of mobs attacking a point

aralite

New Member
Reaction score
0
Okay i have this trigger
Trigger:
  • Zonespawn
    • Events
      • Unit - Searchlight 0155 <gen> Dies
    • Conditions
    • Actions
      • Set Spawngroup = (Random 10 units from (Units in Zone3 Spawn <gen>))
      • Trigger - Turn on Waves <gen>

Trigger:
  • Waves
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 3 Blackblight Ghoul for Player 11 (Dark Green) at (Center of Zone3 Spawn <gen>) facing Default building facing degrees
      • Unit - Create 1 Blackblight Abomination for Player 11 (Dark Green) at (Center of Zone3 Spawn <gen>) facing Default building facing degrees
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)
      • Unit - Order (Random unit from (Units in Zone3 Spawn <gen>)) to Attack-Move To (Center of Zone3 start <gen>)

is there an easier, less random way to do this? it works fight for now...can anyone clean this trigger up and make it every unit in region, instead of a random unit?
 

jackall

You can change this now in User CP.
Reaction score
37
use a For Integer A and place the order action in it, that way you will use only 1 order instead of 13
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just use a simply Unit-Group... Like:
Trigger:
  • Order Units in Region
    • Events
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Zone3 Spawn <gen>))
      • Set TempPoint = (Center of (Zone3 start <gen>))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
 

aralite

New Member
Reaction score
0
Just use a simply Unit-Group... Like:
Trigger:
  • Order Units in Region
    • Events
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Zone3 Spawn <gen>))
      • Set TempPoint = (Center of (Zone3 start <gen>))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)

does the picked unit order all units to go, or just one?
 

TheCrystal

New Member
Reaction score
36
Both ways are inefficient, it's best to have several triggers for something like this.

Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Center of Rect 000 <gen>)
      • Set TempPoint2 = (Center of (Playable map area))
      • Unit - Create 5 Footman for Player 1 (Red) at TempPoint facing Default building facing (270.0) degrees
      • Unit Group - Order (Last created unit group) to Attack-Move To TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)

TempPoint2 is the attack location.

Have another trigger do this:
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Owner of (Triggering unit)) Equal to (==) Player 12 (Brown)
        • Multiple ConditionsOr - Any (Conditions) are true
          • Conditions
            • (Issued order) Equal to (==) (Order(none))
            • (Issued order) Equal to (==) (Order(stop))
            • (Issued order) Equal to (==) (Order(hold))
    • Actions
      • Set TempPoint2 = (Center of (Playable map area))
      • Unit - Order (Triggering unit) to Attack-Move To TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint2)

This prevents units from say, stop moving and from simply deciding to take a nap. The "none" part may activate in between attacks (killed their attacking unit) but it doesn't really stop the gameplay.

Edit: I don't think the unit group leaks, since the BJ says (for those JASS oriented people)
JASS:
function CreateNUnitsAtLoc takes integer count, integer unitId, player whichPlayer, location loc, real face returns group
    call GroupClear(bj_lastCreatedGroup)
    loop
        set count = count - 1
        exitwhen count < 0
        call CreateUnitAtLocSaveLast(whichPlayer, unitId, loc, face)
        call GroupAddUnit(bj_lastCreatedGroup, bj_lastCreatedUnit)
    endloop
    return bj_lastCreatedGroup
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top