• 🏆 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] Creep Spawn help

Status
Not open for further replies.
Level 20
Joined
Apr 14, 2012
Messages
2,901
i kind of need help making a trigger that spawns creep at one point, and orders them to attack/move to another point, without any leaks or errors.

Is this right??
--------------------------------------------------------------------------
  • Creep Spawn
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set Counter = (Counter + 1)
      • Unit - Create 3 Draenei Darkslayer for Neutral Hostile at (Center of Region 000 <gen>) facing (Position of Defender Of Light 0001 <gen>)
      • Trigger - Run Creep Stop <gen> (ignoring conditions)
--------------------------------------------------------------------------
  • Creep Stop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Counter Equal to 10
        • Then - Actions
          • Trigger - Turn off Creep Spawn <gen>
        • Else - Actions
          • Do nothing
--------------------------------------------------------------------------
  • Creep Move
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Neutral Hostile
    • Actions
      • Unit - Order (Entering unit) to Attack Unit
--------------------------------------------------------------------------
because every time i do this the units attack Unit, then go back to the center of Region 000. The units spawned become a mess. Help.
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
they r gonna keep going back because u dont send them anywere. u should change owner of entering unit to either triggering player equal to neutral hostile or owner of triggering unit. change order entering unit to order triggering unit to attack unit. as for leaks here is a link for the leak removal on this site it should help u http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Why are you using 3 triggers for this?
Also, you're leaking.

  • Creep Spawn
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set TempLoc1 = (Center of Region 000 <gen>)
      • Set CreepCounter = (CreepCounter + 1)
      • Unit - Create 3 Furbolg for Neutral Hostile at TempLoc1 facing Default building facing degrees
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack Paladin 0001 <gen>
      • Custom script: call RemoveLocation( udg_TempLoc1 )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CreepCounter Equal to 10
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
To prevent them from returning: go to Advanced -> Gameplay Constants.
Set the values "Creeps - Guard Return Distance" and "Creeps - Guard Return Time (sec)" to something very high (like 10000).
 
Last edited:
Level 6
Joined
Nov 24, 2012
Messages
198
ap0calypse,but if like that the condition will check every 5 second. and if u use two trigger
first is like you say and second is :
  • Second Trigger
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CreepCounter Equal to 10
        • Then - Actions
          • Trigger - Turn off First Trigger <gen>
        • Else - Actions
and it will check condition every 0.03 its will be more accurate
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@Wolf_Wing: the counter in my trigger is more precise than the one in your trigger by a long shot.

The timer says how fast the creeps should spawn. In my trigger, that is every 5 seconds.
The counter counts how many times a group of units has spawned. In my trigger, this is 10 times.
Once the 10th wave has spawned, it will immediately turn off the trigger.
 
Status
Not open for further replies.
Top