• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit spawn after 1st wave killed

Status
Not open for further replies.
Level 1
Joined
Feb 19, 2012
Messages
4
I searched all thread but i didnt find any answer.
Here is the problem:
I made some waves for my war3 map, and i want second wave to start after last unit of 1st wave is killed. How to do that? I dont know to make that trigger. Please help me.

sry for bad english.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Here is my trigger in my map. Every unit of player 12 (brown) has food of 1 or more. When brown has no food, (no units), this trigger runs.

  • Next Round Copy
    • Events
      • Player - Player 12 (Brown)'s Food used becomes Less than 1.00
    • Conditions
    • Actions
      • -------- Setting an integer variable preparing for next round --------
      • Set Pointer = (Pointer + 1)
      • -------- Just some victory music --------
      • Sound - Play GoodJob <gen>
      • Sound - Play Human3 <gen>
      • -------- Message saying round complete --------
      • Game - Display to (All players) for 15.00 seconds the text: |cffffcc00Round Co...
      • -------- Players get some money --------
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Player - Add 750 to (Picked player) Current gold
      • -------- Waiting 20 secs before next round --------
      • Wait 20.00 seconds
      • -------- Last Wave is 24 --------
      • -------- I dont want another wave to spawn after 24 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Pointer Equal to 25
        • Then - Actions
          • Trigger - Run Victory <gen> (checking conditions)
        • Else - Actions
          • Trigger - Run Spawn Units <gen> (checking conditions)
  • Spawn Units
    • Events
      • Time - Elapsed game time is 40.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Pointer Not equal to 1
        • Then - Actions
          • Unit - Create EnemyCount[Pointer] EnemyType[Pointer] for Player 12 (Brown) at Enemy_Spawn facing Default building facing degrees
          • Game - Display to (All players) for 15.00 seconds the text: (|c00FFFF00Level + ((String(Pointer)) + (: |r + ((Name of (Last created unit)) + ( ( + ((String(EnemyCount[Pointer])) + )))))))
          • Sound - Play CreepAggroWhat1 <gen>
          • If (Pointer Less than or equal to 20) then do (Sound - Play War2IntroMusic <gen>) else do (Do nothing)
        • Else - Actions
          • Trigger - Run Orc Wave <gen> (checking conditions)
And this is how you set your units.

  • Set Enemies
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Grunt
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Tauren
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Raider
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Wind Rider
      • Set EnemyCount[x] = 45
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Blademaster
      • Set EnemyCount[x] = 1
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Abomination
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Meat Wagon
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Necromancer
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Gargoyle
      • Set EnemyCount[x] = 45
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Lich
      • Set EnemyCount[x] = 1
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Huntress
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Druid of the Talon (Night Elf Form)
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Archer
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Hippogryph Rider
      • Set EnemyCount[x] = 45
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Demon Hunter
      • Set EnemyCount[x] = 1
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Footman
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Sorceress
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Knight
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Gryphon Rider
      • Set EnemyCount[x] = 45
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Blood Mage
      • Set EnemyCount[x] = 1
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Fel Beast
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Vile Temptress
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Bloodfiend
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Infernal Juggernaut
      • Set EnemyCount[x] = NumberOfEnemies
      • Set EnemyAttack[x] = move
      • -------- -------------------------------------------- --------
      • Set x = (x + 1)
      • Set EnemyType[x] = Teivel
      • Set EnemyCount[x] = 1
      • Set EnemyAttack[x] = move
 
Level 1
Joined
Feb 19, 2012
Messages
4
Store every unit in the 1st wave into a group. If a unit dies remove it from the grop. If the group is empty then the the next wave could start.
Can you little help me with that?

Radicool your trigger is little complicating for me.
 
Last edited:
Level 16
Joined
Jun 24, 2009
Messages
1,409
Ofc. A few minutes and I add it.

@Radicool
you should put them into hidden tags

edit:
Here you are. The possible simpliest one.

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_SpawnGroup = CreateGroup()
      • Set UnitType[0] = Priest
      • Set UnitType[1] = Peasant
      • Set UnitType[2] = Footman
      • Set UnitType[3] = Knight
      • Set SpawnPoint = (Center of (Playable map area))
  • Start
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Trigger - Run Spawn Waves <gen> (ignoring conditions)
  • Wave End Check
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to UnitType[Wave]
    • Actions
      • Unit Group - Remove (Triggering unit) from SpawnGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpawnGroup is empty) Equal to True
        • Then - Actions
          • Set Wave = (Wave + 1)
          • Trigger - Run Spawn Waves <gen> (ignoring conditions)
        • Else - Actions
  • Spawn Waves
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • Unit - Create 1 UnitType[Wave] for Neutral Hostile at SpawnPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to SpawnGroup
If you want to change the number of spawns at different rounds then just change the "10" in the loop into an array integer variable, give it the index "Wave" and add the numbers at the init trigger as you can see at the unit types.
 
Level 1
Joined
Feb 19, 2012
Messages
4
thank you
EDIT:
Ofc. A few minutes and I add it.

@Radicool
you should put them into hidden tags

edit:
Here you are. The possible simpliest one.

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_SpawnGroup = CreateGroup()
      • Set UnitType[0] = Priest
      • Set UnitType[1] = Peasant
      • Set UnitType[2] = Footman
      • Set UnitType[3] = Knight
      • Set SpawnPoint = (Center of (Playable map area))
  • Start
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Trigger - Run Spawn Waves <gen> (ignoring conditions)
  • Wave End Check
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to UnitType[Wave]
    • Actions
      • Unit Group - Remove (Triggering unit) from SpawnGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpawnGroup is empty) Equal to True
        • Then - Actions
          • Set Wave = (Wave + 1)
          • Trigger - Run Spawn Waves <gen> (ignoring conditions)
        • Else - Actions
  • Spawn Waves
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • Unit - Create 1 UnitType[Wave] for Neutral Hostile at SpawnPoint facing Default building facing degrees
          • Unit Group - Add (Last created unit) to SpawnGroup
If you want to change the number of spawns at different rounds then just change the "10" in the loop into an array integer variable, give it the index "Wave" and add the numbers at the init trigger as you can see at the unit types.

I get the folowing error when i wanted to enable the trigger :
http://upload.slike.com/slike/LItQJ.jpg
I am not good with custom script. (kinda stupid)
 
Last edited:
Level 5
Joined
Jan 13, 2008
Messages
96
or you can do trigger like this way:
event - elapsed game time is ... seconds.
action - create 1 Footman for Player 1(red) at Center of playable area...
unit move-atackto at what playable area you want
- wait (how much time you want to have between waves) seconds
and again - create 1 footman for player 1(red) at center.....
this is easiest way, i think...
 
Status
Not open for further replies.
Top