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

[System] Spawn System

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
Hi guys,
I encountered some problems with my old spawn system, and I need a new one, a good triggerer please, the system should look like this:

1-20 MAX types for and area, meaning 1-20 different type that you can choose will spawn in the region you want, also it should have a limit of how much units per type it should have, each type should have their own limit, all spawns are heroes!. also you can set on each single spawn the level.

Create some variables like:
Type:
Level:
Area:
Limit Unit:
Cooldown of spawning new unit:

It would be very helpful if someone can take this request, Thanks in advance.

GUI please.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I made you such a system.

It should be quite self explenatory ;)
Test it and you'll see...

EDIT: By the way, do you want the new wave timer to start right after the previous wave finnished spawning?
Or do you want to start the timer whenever the entire previous wave is dead? I can change that if you want to :)

Also: if you want to start the waves for the first time, you don't have to do it in the map initialization trigger.
Just run Start Spawn for the first time in whatever trigger you have that should start these waves.

EDIT 2: For those who are interested in the triggers but don't want to download the test map:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Testing purpose... --------
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • -------- Define the wave level --------
      • Set LevelIndex = 1
      • -------- Define the last level of all spawns --------
      • Set MaxSpawnLevel = 5
      • -------- Define the area's --------
      • Set SpawnArea[1] = Rect 000 <gen>
      • Set SpawnArea[2] = Rect 001 <gen>
      • Set SpawnArea[3] = Rect 002 <gen>
      • Set SpawnArea[4] = Rect 003 <gen>
      • -------- Define the type of the units --------
      • Set UnitType[1] = Dark Ranger
      • Set UnitType[2] = Firelord
      • Set UnitType[3] = Mountain King
      • Set UnitType[4] = Paladin
      • Set UnitType[5] = Blademaster
      • -------- Define the level of the units --------
      • Set UnitLevel[1] = 4
      • Set UnitLevel[2] = 3
      • Set UnitLevel[3] = 6
      • Set UnitLevel[4] = 5
      • Set UnitLevel[5] = 7
      • -------- Define which area the units should spawn --------
      • Set UnitSpawn[1] = 1
      • Set UnitSpawn[2] = 1
      • Set UnitSpawn[3] = 2
      • Set UnitSpawn[4] = 4
      • Set UnitSpawn[5] = 3
      • -------- Define how many units should spawn --------
      • Set UnitLimit[1] = 12
      • Set UnitLimit[2] = 17
      • Set UnitLimit[3] = 15
      • Set UnitLimit[4] = 20
      • Set UnitLimit[5] = 14
      • -------- Define how long it takes untill the next spawn starts --------
      • Set UnitSpawnDelay[1] = 20.00
      • Set UnitSpawnDelay[2] = 23.00
      • Set UnitSpawnDelay[3] = 18.00
      • Set UnitSpawnDelay[4] = 16.00
      • Set UnitSpawnDelay[5] = 25.00
      • -------- Define the cooldown between units spawning --------
      • Set UnitSpawnCooldown[1] = 1.00
      • Set UnitSpawnCooldown[2] = 0.70
      • Set UnitSpawnCooldown[3] = 0.50
      • Set UnitSpawnCooldown[4] = 1.20
      • Set UnitSpawnCooldown[5] = 0.90
      • -------- Run the start spawn trigger --------
      • Trigger - Run Start Spawn <gen> (checking conditions)
  • Start Spawn
    • Events
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitLimit[LevelIndex] Greater than (>) 0
        • Then - Actions
          • Set TempLoc = (Center of SpawnArea[UnitSpawn[LevelIndex]])
          • Unit - Create 1 UnitType[LevelIndex] for Player 12 (Brown) at TempLoc facing Default building facing (270.0) degrees
          • Hero - Set (Last created unit) Hero-level to UnitLevel[LevelIndex], Hide level-up graphics
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Set UnitLimit[LevelIndex] = (UnitLimit[LevelIndex] - 1)
          • Countdown Timer - Start CooldownTimer as a One-shot timer that will expire in UnitSpawnCooldown[LevelIndex] seconds
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LevelIndex Less than (<) MaxSpawnLevel
            • Then - Actions
              • Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in UnitSpawnDelay[LevelIndex] seconds
              • Countdown Timer - Create a timer window for SpawnTimer with title Next spawn in:
              • Set SpawnTimerWindow = (Last created timer window)
              • Countdown Timer - Show SpawnTimerWindow for Player 1 (Red)
              • Set LevelIndex = (LevelIndex + 1)
            • Else - Actions
              • Game - Display to (All players) the text: Waves done!
  • Spawn Cooldown
    • Events
      • Time - CooldownTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Pause CooldownTimer
      • Trigger - Run Start Spawn <gen> (checking conditions)
  • Spawn Delay
    • Events
      • Time - SpawnTimer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Next wave starts!
      • Countdown Timer - Pause SpawnTimer
      • Countdown Timer - Destroy SpawnTimerWindow
      • Trigger - Run Start Spawn <gen> (checking conditions)
 

Attachments

  • SpawnSystem.w3x
    17.7 KB · Views: 63
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
Somehow it causes some mistakes ot my map dunno why, but some units will be invulnerable.

The mistakes might be caused by me using JNGP in order to create the triggers.
I'll take a quick look and correct it for you.

What do you mean with some units will be invulnerable?
Could you give me an example?

EDIT: the test map works with the normal WE editor so that's not the problem.
It might be that some other triggers in your map are causing it not to work?
Can I take a look or are you going to try and figure this out yourself :)?

You have tryed the test map I suppose?
 
Last edited:
Status
Not open for further replies.
Top