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

Creating a random unit?

Status
Not open for further replies.
Level 49
Joined
Apr 18, 2008
Messages
8,421
Hey guys. I've been doing... Stuff with the Galaxy Editor for some time now, and now I'm trying to make a simple trigger. But for that I'll have to first know... Is there any way to create a random unit out of a group of units? I know that in WC3 you could've used this "Random Unit" unit in the "Neutral Hostile" tab and make every single unit you want to be randomed a Neutral Hostile unit, but I don't think there is such an option in SC2. If you didn't understand... What I want is that when the game starts, a unit is created for each and every player in their own starting location, and the unit is NOT pre-defined(Marine, Hydralisk etc) but rather random and will vary from each time you start the game. I hope you understand what I mean. I also need the same thing for whenever only one unit is left alive(Unit Dies, if there is 1 or less units alive then Destroy last unit alive and Create random unit for each player at their own starting location... Etc).

Off topic: The multi-boards look SO awesome. :D
 
Okay, read that:
1) there is a button, where the save file, load file is, and at the right side, next to the
'Test map' button, there is a 'x='. Click it to create a new global variable.
2) Now you can give your variable a different type. It should be set to integer as standard.
3) under the variable type, there you can set the arrays. The max array is the maximal
value, the array can have. Example: Set max array to 5, then the array number can't be
higher than 5.
 
Level 49
Joined
Apr 18, 2008
Messages
8,421
Ooh, thanks guys! It works now. ^^
Very awesome. Now I can proceed to making the map. :p

EDIT: Another question... How to check if a player is playing, and if he IS playing(not just 'Computer' but actual player\human), THEN create a unit for him... And if he's not, then do nothing? I've made an "If\Then\Else" but it is very confusing. I think I managed to create a condition, but conditions are EVEN MORE confusing. :p
 
Status
Not open for further replies.
Top