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

Status
Not open for further replies.
Level 3
Joined
May 20, 2009
Messages
21
I'd simply like a specific unit to spawn depending on the starting race the player selected. So Protoss = Zealots. Zerg = Zerglings, Terran = Marines.
You'd start with your main build obviously
 
Level 4
Joined
Jul 4, 2009
Messages
77
If you are talking about what units spawn right at the begining of the map near your main command building. You can actually set this in the Data Editor.

Find the RACES DATA section, and look for the field Starting Units+
In that, you can set what units and how many of each will spawn for that race at the start of a map.

You also MUST have the "Melee - Set Starting Units for All players" action in your map initialization trigger. (even if your map isnt a melee map.)
 
Level 9
Joined
Nov 4, 2007
Messages
931
I think he means it in more of a footmen frenzy kind of spawning where its continuous rather than placed at start only. Either way both can be done via either trigger or data editor, depending on your preference.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Using triggers, you can look up the player attribute for their Race. You can then pass that through multiple selection (bunch of if statmenets) and then adjust the game acordingly.
If you are using a trigger based spawner, (I imagine you are), you simply use a variable for the spawn type and set that depending on the outcome of the multiple selection.

If you are using an data based spawn system (yes, it is possible to make a footman frenzy map with no custom triggering at all), you use a validator to check player race. You give the main building all spawners (for all races) but let the validators enable only the one for the player's race. The same can be applied to upgrade paths and everything.
 
Level 3
Joined
May 20, 2009
Messages
21
Oh you answered me question, so do you know how to make the specfic unit a variable, I can go from there, i understand variables, but not sure how set or make one
 
Level 9
Joined
May 9, 2009
Messages
536
To make a specific unit a variable, you need to create a global variable and set it to that unit. Global variables are created in the same white box as triggers and folders. If you wanted unit TYPE, its the same thing, but you set the type of unit.
 
Status
Not open for further replies.
Top