• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Creeps Stopping on Attack Order

Status
Not open for further replies.
Level 4
Joined
Apr 15, 2008
Messages
82
Hello Hive.

I've been having problems with a little defense map I'm making, where creeps spawn and go on an attack order to a hero. That whole spawning and moving thing works fine, but if a player moves their hero, or puts it on a patrol order, the creeps stand still. Is there any way to fix this?
 
Level 4
Joined
Apr 15, 2008
Messages
82
Post the triggers please, how can we know what's wrong? :S

mk...one sec

  • SpawnCreeps
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • creepsspawned Less than 40
        • Then - Actions
          • Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • defeat[1] Equal to False
                  • ((Picked player) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 creeplevel[creepcurrentlevel] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
                  • Unit - Set life of (Last created unit) to (creephealth[creepcurrentlevel] + (creephealth[creepcurrentlevel] / creepbonushealth))
                  • Unit Group - Add (Last created unit) to playerscreep[1]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • inigloo[1] Equal to False
                    • Then - Actions
                      • Unit - Order (Last created unit) to Attack The One 0013 <gen>
                    • Else - Actions
                      • Unit - Order (Last created unit) to Right-Click Igloo 0003 <gen>
                • Else - Actions
          • Player Group - Pick every player in Player Group - Player 2 (Blue) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • defeat[2] Equal to False
                  • ((Picked player) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 creeplevel[creepcurrentlevel] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
                  • Unit - Set life of (Last created unit) to creephealth[creepcurrentlevel]
                  • Unit Group - Add (Last created unit) to playerscreep[2]
                  • Unit - Order (Last created unit) to Attack The One 0014 <gen>
                • Else - Actions
          • Player Group - Pick every player in Player Group - Player 3 (Teal) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 creeplevel[creepcurrentlevel] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
                  • Unit - Set life of (Last created unit) to creephealth[creepcurrentlevel]
                  • Unit - Order (Last created unit) to Attack The One 0015 <gen>
                • Else - Actions
          • Player Group - Pick every player in Player Group - Player 4 (Purple) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 creeplevel[creepcurrentlevel] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
                  • Unit - Set life of (Last created unit) to creephealth[creepcurrentlevel]
                  • Unit - Order (Last created unit) to Attack The One 0016 <gen>
                • Else - Actions
          • Set creepbonushealth = (creepbonushealth - 0.50)
          • Set creepsspawned = (creepsspawned + 1)
        • Else - Actions
          • Trigger - Turn off (This trigger)
im not sure how this will help you...

The problem im having is just that a unit that is attack-moving to a unit will stop moving if the unit it is moving to moves around.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
How about moving creepbonushealth and creepsspawned to the very beginning of the trigger, right under 'Actions'. So far it seems to me you use these variables all the way through the triggers but set them at the end, so it doesn't know what these variables are set to.
 
Level 4
Joined
Apr 15, 2008
Messages
82
How about moving creepbonushealth and creepsspawned to the very beginning of the trigger, right under 'Actions'. So far it seems to me you use these variables all the way through the triggers but set them at the end, so it doesn't know what these variables are set to.

I cleaned up the trigger a lot, but i still encounter the problem.
  • SpawnCreeps
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • creepsspawned Less than 40
        • Then - Actions
          • For each (Integer A) from 1 to 8, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • defeat[(Integer A)] Equal to False
                  • ((Player((Integer A))) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 creeplevel[creepcurrentlevel] for Player 12 (Brown) at (Center of (Playable map area)) facing Default building facing degrees
                  • Unit - Set life of (Last created unit) to (creephealth[creepcurrentlevel] + (creephealth[creepcurrentlevel] / creepbonushealth))
                  • Unit Group - Add (Last created unit) to playerscreep[(Integer A)]
                  • Set creepsspawned = (creepsspawned + 1)
                  • Set creepbonushealth = (creepbonushealth - 0.50)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • inigloo[(Integer A)] Equal to False
                    • Then - Actions
                      • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Player((Integer A)))) and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to The One
                            • Then - Actions
                              • Unit - Order (Last created unit) to Attack (Picked unit)
                            • Else - Actions
                    • Else - Actions
                      • Unit - Order (Last created unit) to Right-Click Igloo 0003 <gen>
                • Else - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top