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

Spawning specific units depending on a specific condition. And creating a UI mass

Status
Not open for further replies.
Level 3
Joined
May 20, 2009
Messages
21
So I'm making a map, I do not know how to spawn a specific unit type. Example. Player owns a nexus would be the condition/event. Then spawn a specific unit type depending on the building, which in this case would be a zealot.
So player builds nexus, then the player gets a continous spawn of zealots at a specific point. Help would be greatly apreciated plox.

Also, if anyone can help. How would I go about setting up a massing system without having to use units, I rather use a UI box, where players can open it, then it would list in this case 7 diffrent points to mass to. The player clicks it then all units mass to it.

Edit: If anyone needs clarification on my horrible vocabularly just say so, I'm not good at explaining things.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
The spawning could be done with data editor. First create an effect of type "spawn unit", with your specified unit type. Then create a permanent buff, set period to spawn cooldown and periodic effect to the effect you created. Then add the buff to the behavior list of the building. (you need to create an effect and buff for each unit type you want to spawn)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Be warned that spawning too many units at the same position too quickly will be highly demanding on the players' processor due to the displacement calculations and will result in poor playability or performance of the map. In short avoid spawning units inside tight groups of units via triggers or effects.

It is advisable to spawn units 1-2 at a time and get them to move immediatly to some gathering point to help prevent any frame dropping from occuring. This prevents too much time being spent calculating free positions for a units to spawn while still letting them gather in convenient positions.

Additionally considering upgrading spawn quality over spawn quantity if such a decission arises. Spawning 100s of weak units a minute per player may sound like a good idea for epic battles but places horriable strain on the game engine which will result in people not playing your map due to low frame rates or slow game speed.
 
Status
Not open for further replies.
Top