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

Random Spawn Unit Trigger

Status
Not open for further replies.
Level 5
Joined
Jun 13, 2012
Messages
113
So I have already made a random unit group with units I want to spawn. It works but the issue is that when I do

Unit - Create 2 WaveSpawns[(Random integer number between 1 and Random_Count)] for Player 12 (Brown) at Temp_Point facing (Position of (Triggering unit))

it selects 2 units randomly and summons them twice. So for example, if it picks a footman it will spawn 2 of them. So if I were to say spawn 8 units I would get 8 footmen if selected in the random group.

What I want to do is use Unit Create to create 2 random units literally, so 1 footman 1 grunt on to a position
So if I did create 8 units it would create 8 random ones. Right now I have to do this 3 times

Unit - Create 2 WaveSpawns[(Random integer number between 1 and Random_Count)] for Player 12 (Brown) at Temp_Point facing (Position of (Triggering unit))

Unit - Create 2 WaveSpawns[(Random integer number between 1 and Random_Count)] for Player 12 (Brown) at Temp_Point facing (Position of (Triggering unit))

Unit - Create 2 WaveSpawns[(Random integer number between 1 and Random_Count)] for Player 12 (Brown) at Temp_Point facing (Position of (Triggering unit))

Just to have random units spawn, I just want to know if there is a more effective way of doing it without having to do that 3 times.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
So if I did create 8 units it would create 8 random ones. Right now I have to do this 3 times
That is 3 random unit pairs or 6 units in total. 3 x 2 = 6. You would need to repeat the action 4 times for 8 random unit pairs or 8 times for 8 random units.
Just to have random units spawn, I just want to know if there is a more effective way of doing it without having to do that 3 times.
Use a for integer loop to repeat a single copy of the action 8 times. That is what loops are for.
 
Level 5
Joined
Jun 13, 2012
Messages
113
Hey I got a quick question, So this is my random group list. Every time the game makes a unit from the group it lags. Any way to reduce that lag?

upload_2020-2-15_22-21-59.png
 

Attachments

  • upload_2020-2-15_22-21-53.png
    upload_2020-2-15_22-21-53.png
    75.9 KB · Views: 27
Status
Not open for further replies.
Top