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

Spawn System

Status
Not open for further replies.
Level 4
Joined
Aug 31, 2011
Messages
88
Hi guys,

I need willing volunteer who can create a spawn system for my map. I have already searched for the spawn system, but most of them are respawn systems which I don't need.

Map explanation

Each player gets a spawn (different unit types, different amounts of each type) on a fixed map locations (in players' bases) every 60 secs.

System should adjust to few things:
1. Some events or upgrades would add new spawn type units, or they would increase the numbers of spawned units.
2. Every player has few spawning locations inside their bases, which would spawn different units.
3. Some spawning locations might share some of the same unit types.

For example
Player 1 - Humans, would have 3 bases (Barracks, Church, Aviary), Barracks would spawn 3 footmen and 3 archers, Church - 2 priests and 2 zealots, etc. By using upgrade "Stables", you would add 2 knights to the Barracks spawn, but not to the other spawns. By using upgrade "Fanaticism", you would add 2 more zealots to the Church spawn.

Can anyone create this kind of spawn system for me or give me some guidelines of how to do it?

Thanks in advance!
 
Level 16
Joined
Apr 20, 2014
Messages
522
I have never made it but it does not look complicated.

You can do this with quite a lot of conditions (there may be a way to optimisize this).

Create a first trigger who launch the spawn every X seconds.
Then, you must determine which units are spawned.

If upgrade1 is researched, then spawn Y units at location.
Else, spawn Z units.


Do you need more indications or you have an idea now?
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
A better way is not to use a big IF tree, instead have an array variable for each type of unit that can be created that stores how many of that unit type should be created for a particular player. Array indices [1] through [24] are used for this. Then in your periodic trigger check each of the different arrays and create that many of each type of unit. If it shouldn't be any, a 0 in the array will produce 0 units automatically.
 
Level 4
Joined
Aug 31, 2011
Messages
88
So basically I would need one unit type array variable, one array variable for unit count and one array variable for players (force) and set them into a different loops for different players?

Edit: Solved in another thread. Ty Pyrogasm!
 
Last edited:
Status
Not open for further replies.
Top