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

Automatically Generated Mobs

Status
Not open for further replies.
Level 3
Joined
Dec 30, 2015
Messages
33
I'm currently making a map where I need to use mobs spawning every few seconds for various purposes. I was able to create a basic version with 6 footman spawning and having them attack-move until they kill a certain mob, but is there a way to have mobs start spawning, for example, every 20 seconds after a certain amount of time elapsed?
 
Level 17
Joined
Nov 12, 2016
Messages
780
Well this is an old trigger from one of my maps
hope it helps if you have verious regions made and selected in your trigger it will work
Events
Time - Every 720.00 seconds of game time
Conditions
Actions
Unit - Create 6 Necromancer for Player 9 (Gray) at (Center of Reion location 1) facing (X of (Center of Region location 2 <gen>)) degrees
Unit Group - Order (Units in Region location 1 <gen>) to Attack-Move To (Center of Region location 2 <gen>)
 
Level 17
Joined
Nov 12, 2016
Messages
780
no its a loop right from the start
if you set that to 20 seconds or 720 as i did the mobs will spawn every 20 or 720 seconds
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Have the periodic spawn trigger initially off (right click in Trigger Editor and turn off, do not disable). One then uses another trigger with an once off event of the desired activation time and actions to turn on the periodic spawn trigger.

Trigger: Spawn720 Activate
Event: Time elapsed 720 seconds
Action: Turn on Spawn720 Periodic

Trigger: Spawn720 Periodic (initially off)
Event: Every 20 seconds
Action: SPAWN STUFF HERE
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
The solution given by @Dr Super Good is the easiest and most logical one, but if you really have to have it in a single trigger, then you can alternatively try someting like this:

  • Events
    • Time - Elapsed game time is 720.00 seconds
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BooleanVariable Equal to False
      • Then - Actions
        • Set BooleanVariable = True
      • Else - Actions
        • Wait 20.00 game-time seconds
    • <YOUR SPAWN ACTIONS>
    • Trigger - Run (This trigger) (checking conditions)
Or something like this:

  • Melee Initialization
    • Events
      • Time - Elapsed game time is 720.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BooleanVariable Equal to False
        • Then - Actions
          • Set BooleanVariable = True
          • Trigger - Add to (This trigger) the event (Time - Every 20.00 seconds of game time)
        • Else - Actions
      • <YOUR SPAWN ACTIONS>
 
Status
Not open for further replies.
Top