I want to make a random unit spawn. I want the game to choose from only 6 custom units. Its a AoS map but I want to create diffrent units for each team. Make any sence?
Trigger2 Events - Every 5 seconds of the game time Conditions - None Actions: Create 1 Random_Unit [Random integer between 1 and 6] for player1 at center of <region>
Ohh..I diddnt know there was a random unit type variable anyway thanks alot.
Moderator Edit: Ok im not noob i just misread what Mini-Me wrote. Anyway I did what he said and it wont work and i don't know why. This is what my trigger looks like..
Event - Every 30 seconds of game time.
Action - Pick every unit in (unit of type Barracks)and do actions. Create 1 Random_Unit(Random number between 1 and 6) for (Picked Player) at (Position of picked unit.
Set (Var_rnd_unit) to (random number between 1 and 6)
This is done by making an integer variable (Var_rnd_unit), and the random can be done with (math - random number)
Then the next action
If (Var_rnd_unit) is equal to (1)
Then (unit - create (1) (unit1) at (location1)
Else If (Var_rnd_unit) is equal to (2)
Then (unit - create (1) (unit2) at (location1)
Etc. This can be done with the actions {if/then/else}, {unit - create unit facing angle}. The condition is an integer comparison.
Maybe this helps. Goodluck.
(P.S. These triggers are done by heart, not through the editor, will contain flaws.)
How is that better? First of all you have to understand that the person asking the question is a beginner in map making cause he is asking this kind of thing. Your way is messy and requires more work, did you say its better only because its made by you? Or then this is just a way for you to raise your post count...
What Mini-Me is saying is to create a variable titled Random_Unit, of type Unit-Type and with an array length of 6. Have a trigger initialize the array by setting each array element equal to a seperate unit. Then using the time: periodic event, use the unit: create action to create 1 unit of type Random_Unit. For the index number in brackets, use the Math - Random Number function, with limits set between 1 and 6.
How is that better? First of all you have to understand that the person asking the question is a beginner in map making cause he is asking this kind of thing. Your way is messy and requires more work, did you say its better only because its made by you? Or then this is just a way for you to raise your post count...
Hmm, i think you're being rather negative here. I'll rephrase though, to soothe your troubled mind.
1st:Go to trigger editor 2ndress Ctrl+B to enter the Boolean edits 3rd:Make a boolean with Random_creep(unit-type) and array(6)and a boolean Random_INT(integer) 4th:Create the trigger(New trigger-name) 5th:Make an event(right clik-new event) 6th:Event=every (40 seconds or w/e) 7th:conditions doesnt matter-jump to actions 8th:Set Variable=Random_creep(1-6)=the units you want 9th:Set Random_Int=Random Integer number between 1-6 10th:Create 1 Random_Creep(Set this to:Random_Integer from boolean at top)at location(temp location) facing degrees
Ok I got it to work. I had already made the right trigger but I accidently set it to create 1 random unit for (picked player) instead of (owner of picked unit). I knew the right trigger just diddnt know why it wouldn't work. But it's fixed now so thank you all for the help.