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

[Trigger] Creep spawns

Status
Not open for further replies.
Level 6
Joined
Apr 30, 2008
Messages
153
  • test spawns
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: test spawn has star...
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Wait 1.00 game-time seconds
          • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
  • on and off spawns
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn off test spawns <gen>
      • Game - Display to (All players) the text: test spawn has stop...
      • Wait 15.00 game-time seconds
      • Trigger - Turn on test spawns <gen>
      • Game - Display to (All players) the text: test spawn has star...
if not i was wondering if theres a way to make a spawn like that but not be so huge.
 
Level 6
Joined
Apr 30, 2008
Messages
153
i want to spawn 1 unit at a time over a sertin amount of time then stop for a sertin amount of tim when start back up again.
i tried just having a trigger like this but is so big and anoying
  • zombie spawn 1 lvl1
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
    • Actions
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 1.50 game-time seconds
      • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
 
Last edited by a moderator:
Level 12
Joined
Apr 27, 2008
Messages
1,228
  • test spawns
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: test spawn has star...
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Wait 1.00 game-time seconds
          • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
  • on and off spawns
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn off test spawns <gen>
      • Game - Display to (All players) the text: test spawn has stop...
      • Wait 15.00 game-time seconds
      • Trigger - Turn on test spawns <gen>
      • Game - Display to (All players) the text: test spawn has star...
if not i was wondering if theres a way to make a spawn like that but not be so huge.
  • test spawns
    • Events
    • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: test spawn has star...
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Wait 1.00 game-time seconds
          • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Game - Display to (All players) the text: test spawn has stop...
This will generally do it.
If you want something more specific ask for it.
P.s. This will spawn 30 zombies at a rate of 1/s (for 30 seconds). Then 15 seconds of nothing and again the same.
 
Level 2
Joined
Jun 9, 2008
Messages
9
This should also work i guess:

  • test spawns
    • Events
      • Map initialization
    • Conditions
      • spawn Equal to True
    • Actions
      • Game - Display to (All players) the text: test spawn has star...
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Wait 1.00 game-time seconds
          • Unit - Create 1 Zombie for Player 12 (Brown) at (Center of Zombie spawn 1 <gen>) facing Default building facing degrees
      • Wait 35.00 game-time seconds.
      • Trigger - Run test spawns <gen> (checking conditions)
If you wanna turn it off, just set spawn=false, to turn it on again set spawn=true and run the trigger.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
If you wanna turn it off, just set spawn=false, to turn it on again set spawn=true and run the trigger.

You know, there already is a turn on/off a trigger GUI action.
And until U.A.MEDIC says exactly what he wants no one will be able to make any trigger(s) that are more accurate than what I did.
 
Level 2
Joined
Jun 9, 2008
Messages
9
You know, there already is a turn on/off a trigger GUI action.
And until U.A.MEDIC says exactly what he wants no one will be able to make any trigger(s) that are more accurate than what I did.

Yes you made the most accurate one, i just suggested another method. Turn on/off wouldnt work on my trigger because Map initialization isnt fired more then once (thus you need to run the trigger)
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
This trigger is leaking. Also, using Waits inside Loops is bad.

Create a Point variable, I'll name it "YourPointVariable" in this case.
  • test spawns
    • Events
    • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Set YourPointVariable = Center of Zombie spawn 1 <gen>
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Zombie for Player 12 (Brown) at YourPointVariable facing Default building facing degrees
          • Custom script: call DestroyGroup(bj_lastCreatedGroup)
      • Custom script: call RemoveLocation(udg_YourPointVariable)
 
Level 1
Joined
Nov 2, 2007
Messages
5
Instead of a create action try:
Ordering an invisible,neutral passiv building to train the unit and use a second trigger to change ownership of that trained unit. That would solve the leak and you wouldnt need to use the wait action.
  • give spawns
    • Ereignisse
      • Time - Every 45.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer G) from 1 to 20, do (Actions)
        • Schleifen - Aktionen
          • Unit - Order spawner[1] to train/upgrade to a Warrior
  • spawning Kopieren
    • Ereignisse
      • Unit - A unit finishes training of unit
    • Bedingungen
      • (Unit-type of (Triggering unit)) Gleich Spawn A
    • Aktionen
      • Unit - Change ownership of (Trained unit) to (Player(12)) and change color
You just have to give neutral passiv money and change the training time of the desired unit.
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Priwin, just no.

  • Spawn turn on
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn on Spawn <gen>
      • Trigger - Turn on Spawn turn off <gen>
      • Countdown Timer - Start abv as a One-shot timer that will expire in 30.00 seconds
  • Spawn turn off
    • Events
      • Time - abv expires
    • Conditions
    • Actions
      • Trigger - Turn off Spawn <gen>
      • Trigger - Turn off (This trigger)
  • Spawn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set point = (Center of Rect 000 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at point facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_point)
This will spawn 1 unit per second for 30 seconds every 45 seconds.
Rui, you are not supposed to: call DestroyGroup(bj_lastCreatedGroup)
And your trigger will spawn 15 units instantly.
So use a wait, no matter how bad or not it is, for a GUI map a Polled wait in a loop will not make a big difference.
Or use what I made(GUI)
P.s. This is simple GUI 'system'. When you turn on the spawn turn on trigger, you should also run it so that creeps will start spawning, instead of starting after 45 seconds.
 

Attachments

  • poi.w3x
    16.4 KB · Views: 36
Level 12
Joined
Apr 27, 2008
Messages
1,228
It is messy.
Oh, you do not need to give the player any gold or lumber, you make the price of the unit 0.
You must have a building, you must have a player you may assign that building to(assuming that you have AI for every player except the playing/available for playing slots).
And after all when the unit gets trained, it is created by some native function.
Why shouldn't we use that native function, but make a blablabala.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Cheers mate, you got my nick right. This is quite rare, anywhere.
P.s.
I am not sure why you want to spawn units for some time rather than spawning a number of units.
 
Last edited:
Status
Not open for further replies.
Top