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

Scripting Monster Spawn

Status
Not open for further replies.
Level 1
Joined
Dec 5, 2013
Messages
5
Hi guys,
I started a new map but I have problems with triggers because I never use it before,I
would like a system of spawn/wave like that:

The waves spawn only x secondes after all monsters of the last wave are dead

The monsters spawn randomly around (ex 20 at 50m) heroes and attack them

All waves can be changed (number of monsters,type of monster)

There is a wave for all players(ex: if they are 2 players and the wave 1 is 5 zombies, 5zombies will spawn to attack the hero of player 1 and 5 zombies will spawn to attack the heroes of player 2

Thank!

Sry for my bad english
 
Last edited by a moderator:
Level 26
Joined
Aug 18, 2009
Messages
4,097
I started a new map but I have problems with triggers because I never use it before

That you should do. If you just want to copy triggers from here that you do not understand, which would be a request by the way, you can make zero adjustments and exactly acquiring what you want can be a problem because for this, we would need to know the task as exactly and it may be environment-dependent. So it's better to learn the methods and at least vaguely get the logic beneath it. Get a basic grasp about triggers, they are fundamental for every customized scenario you want to realize in wc3.
 
Level 1
Joined
Dec 5, 2013
Messages
5
Yes,someone helped me to create the system but we have a problem,the number of zombie in the first wave is wrong,and the second wave don't spawn,we don't find where is the bug :angry:

Its the system:

1386372360-settings.png


1386372379-loop.png


1386372382-order-loop.png


1386372386-order-zombies.png


1386372390-zombie-death.png


1386372393-variables.png
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
This is way more complicated than it needs to be.

To make a wave system. You need a unit type array filled with the units you want to spawn. You need an integer array to keep track of how many units you want to spawn.
And an integer that starts at 0
Then in a periodic trigger increase the integer and use that integer as the index for the unit type array and the number of units you want to spawn.
 
Level 6
Joined
Jan 8, 2009
Messages
140
mocked this up for you, the events can be changed but as it is you set the type by typing 'type: x' x being the unit type array number then set the number with 'number: x' x being the number of units. when the units are all dead the next wave should spawn.
 

Attachments

  • spawn.w3x
    9.6 KB · Views: 55
Level 1
Joined
Dec 5, 2013
Messages
5
I don't really understand :( , i must totally restart my triggers or change the first part 'setting' ?
 
Level 6
Joined
Nov 5, 2013
Messages
132
Okay, after 3 hours I have resolved the problem.
Now pay attention:

1) Edit the unit group variable "ZS_Group". Look at the picture "VariableEdited".
2) On Loop change ZS_Current_Types [ZS_LoopC] with ZS_Current_Types [ZS_LoopB] and update the ZS_Group. Look "LoopEdited".
3) Update the others ZS_Group in all triggers. Look "OrderZombiesEdited" and "ZombieDeathEdited".

Now you have the correct number of zombies per wave/player and correct spawns in all waves.
Have nice zombies day! :)
 

Attachments

  • VariableEdited.jpg
    VariableEdited.jpg
    123.4 KB · Views: 104
  • LoopEdited.jpg
    LoopEdited.jpg
    258.1 KB · Views: 140
  • OrderZombiesEdited.jpg
    OrderZombiesEdited.jpg
    221.9 KB · Views: 111
  • ZombieDeathEdited.jpg
    ZombieDeathEdited.jpg
    274.5 KB · Views: 127
Status
Not open for further replies.
Top