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

A wii little help enchancing this trigger

Status
Not open for further replies.
Level 8
Joined
Nov 21, 2008
Messages
316
I want to make it so the units stop after they reach the attack point.
what line do i add?
  • Grunt Wave
    • Events
      • Time - Every 2.25 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to Player 11 (Dark Green)) or ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
      • Set TempGroup2 = (Units in (Playable map area) matching ((((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Flag of Death)))
      • Set Unitposition = (Position of (Random unit from TempGroup2))
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Spawn_Point2[1] = (Random point in SpawnRegions2[(Random integer number between 1 and 3)])
          • Unit - Create 1 Grunt for Player 12 (Brown) at Spawn_Point2[1] facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To Unitposition
          • Unit - Create 1 Grunt for Player 11 (Dark Green) at Spawn_Point2[1] facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To Unitposition
          • Custom script: call RemoveLocation (udg_Spawn_Point2[1])
          • Custom script: call RemoveLocation (udg_Spawn_Point2[bj_forLoopAIndex])
          • Wait 0.00 seconds
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call RemoveLocation(udg_Unitposition)
and this if not the same way.

  • Orc Attack
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set DoingNothingGroup = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to Player 11 (Dark Green)) or ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
      • Set TempGroup2 = (Units in (Playable map area) matching ((((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Flag of Death)))
      • Set Unitposition = (Position of (Random unit from TempGroup2))
      • Unit Group - Pick every unit in DoingNothingGroup 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)) Equal to (Order(<Empty String>))
            • Then - Actions
              • Unit - Order (Picked unit) to Attack-Move To Unitposition
            • Else - Actions
      • Custom script: call DestroyGroup(udg_DoingNothingGroup)
      • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call RemoveLocation(udg_Unitposition)
 
Level 8
Joined
Nov 21, 2008
Messages
316
ya pharoah i realize once there is "no unit" the orcs wont attack anything, but thats not the problem. When the orcs reach the attack point of the unit which is usually a player, that player will have already left that position. So now that the orc doesnt find the player or any units in sight. it then runs all the way back up to where it spawns from. Thats the annoying part. I want them to simply stop after they reach the attack point and then wait til the second trigger initiates(when they are sent to another position.)

Otherwise the units clog up when running back to the original spawn because other units are spawning and heading usually downward.
 
Did you set "Creeps - Guard Return Distance" and "Creeps - Guard Return Time (sec)" in the Gameplay Constants to an infinite number, e.g. 999999.00? You can also add a trigger like
  • Trg
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Creep) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Current order of (Picked unit)) Equal to (order(<Empty String>))
          • Then - Actions
            • Set Point1 = (Position of (Picked unit))
            • Unit - Order (Picked unit) to Move to Point1
            • Custom script: call RemoveLocation (udg_Point1)
          • Else - Actions
Basically, if the least amount of time they wait before they go all the way back is 1 second, use this event, else, if the time they wait before they go back is less, use a lower periodic event.
This trigger will basically define if the creeps are "idle". To get "Empty String" in the "Order comparison", when you are about to add an order, delete the default Stop and press enter, leaving the field completely blank (don't even press spacebar, just don't type anything).
 
Status
Not open for further replies.
Top