Trigger(GUI) request!

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,605
I want a trigger which will pick every lazy unit(lazy unit=unit that doesn't have an order,or an unit that has been ordered to do a command like attack/move but for various reasons it has stopped) and make it attack move to a location again.I have something like this in mind
  • MoveLazyCreeps
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set LazyCreeps = (Units in (Playable map area) owned by Player 1 (Red))
      • Unit Group - Pick every unit in LazyCreeps and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Triggering unit)) Equal to (Order(nothing))
            • Then - Actions
              • Unit Group - Order LazyCreeps to Attack-Move To (Center of Creep Attack1 <gen>)
            • Else - Actions
but this is not working.Someone can fix this trigger or simply make a new one to help me?+rep for any help!
 
ok, i kindof suck badly at triggers, but i think 'nothing' isnt a string is it? probly it is, but as i said, im noob at triggering. this is probly wrong, but since its in the map initialization it will only do that when the game starts, and not after that.. so if a unit stops it wont do anything. maybe change the Event to Every X seconds of game?
Maybe add a condition making it Check every X seconds if the units are doing 'nothing'? Idk, its only my attempt to help
 
I don't know if there is such thing as "order equal to no order".

Maybe you could use something like

  • Conditions
    • (Current order of Peasant 0103 <gen>) Not equal to (Order(stop))
    • (Current order of Peasant 0103 <gen>) Not equal to (Order(smart))
    • (Current order of Peasant 0103 <gen>) Not equal to (Order(attack))
List all the orders it can have, and if it's none of those, then the unit is idle.
 
Is this one better?
  • MoveLazyCreeps
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set LazyCreeps = (Units in (Playable map area) owned by Player 1 (Red))
      • Unit Group - Pick every unit in LazyCreeps and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Triggering unit)) Not equal to (Order(stop))
              • (Current order of (Triggering unit)) Not equal to (Order(hold position))
              • (Current order of (Triggering unit)) Not equal to (Order(move))
              • (Current order of (Triggering unit)) Not equal to (Order(attack))
              • (Current order of (Triggering unit)) Not equal to (Order(patrol))
            • Then - Actions
              • Unit Group - Order LazyCreeps to Attack-Move To (Center of Creep Attack1 <gen>)
            • Else - Actions
 
And...how about this?
  • MoveLazyCreeps
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set LazyCreeps = (Units in (Playable map area) owned by Player 1 (Red))
      • Unit Group - Pick every unit in LazyCreeps and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Not equal to (Order(stop))
              • (Current order of (Picked unit)) Not equal to (Order(hold position))
              • (Current order of (Picked unit)) Not equal to (Order(move))
              • (Current order of (Picked unit)) Not equal to (Order(attack))
              • (Current order of (Picked unit)) Not equal to (Order(patrol))
            • Then - Actions
              • Unit Group - Order LazyCreeps to Attack-Move To (Center of Creep Attack1 <gen>)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_LazyCreeps)
Maker i also sent a pm to you...check your inbox.
 
  • MoveLazyCreeps
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set LazyCreeps = (Units in (Playable map area) owned by Player 1 (Red))
      • Unit Group - Pick every unit in LazyCreeps and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Not equal to (Order(stop))
              • (Current order of (Picked unit)) Not equal to (Order(hold position))
              • (Current order of (Picked unit)) Not equal to (Order(move))
              • (Current order of (Picked unit)) Not equal to (Order(attack))
              • (Current order of (Picked unit)) Not equal to (Order(patrol))
            • Then - Actions
              • Temp_Loc_1 = (Center of Creep Attack1 <gen>)
              • Unit - Order (Picked unit) to Attack-Move To (Temp_Loc_1)
              • Custom script: call RemoveLocation(udg_Temp_Loc_1)
            • Else - Actions
          • Custom script: call DestroyGroup(udg_LazyCreeps)
 
Last edited:
Thx Maker,gonna try it!+rep once more.
Ok,here it is
  • MoveLazyCreeps
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set LazyCreeps = (Units in (Playable map area) owned by Player 1 (Red))
      • Unit Group - Pick every unit in LazyCreeps and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Not equal to (Order(stop))
              • (Current order of (Picked unit)) Not equal to (Order(hold position))
              • (Current order of (Picked unit)) Not equal to (Order(move))
              • (Current order of (Picked unit)) Not equal to (Order(attack))
              • (Current order of (Picked unit)) Not equal to (Order(patrol))
            • Then - Actions
              • Set AttackPoint = (Center of Creep Attack1 <gen>)
              • Unit - Order (Picked unit) to Attack-Move To AttackPoint
              • Custom script: call RemoveLocation(udg_AttackPoint)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_LazyCreeps)
 
Status
Not open for further replies.
Back
Top