• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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