• 🏆 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!

Trigger(GUI) request!

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
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!
 
Level 4
Joined
Jul 2, 2008
Messages
110
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
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
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.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
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
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
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.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • 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:
Level 15
Joined
Aug 11, 2009
Messages
1,606
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.
Top