• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

what is the best arrangement trigger to spawn units for a test map?

Status
Not open for further replies.
Level 16
Joined
May 2, 2011
Messages
1,351
Hello,

so I am making a map where you can test units vs each other. the player select tested units simply by going through circle of power. and then types begin to input number for each unit.


now the player has chosen the unit types and the number of units for each type and for each team.

the last step where Im stuck is how to efficientively spawn the units? I had this idea as spawn order starting from the middle of the arena:

11 9 7 5 3 1 2 4 6 8 10
VS
11 9 7 5 3 1 2 4 6 8 10

it can also be vertical if needed. though the problem will be that some units have less collision size than others.

I thought of the idea of having a pivot where the spawning location rotats around. do you think there is better way?
 

Attachments

  • TrainingGroundV0.0.w3x
    61 KB · Views: 16

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
I'm not entirely sure what you need help with.

Anyway, I guess you could create like 5 Rows for each team with each row representing a category of units.

Row 1 = Melee Attack Range
Row 2 = Short Attack Range
Row 3 = Medium Attack Range
Row 4 = Long Attack Range
Row 5 = Flying

Row 1 would be in front and it would work it's way up with Row 5 being the furthest one back.

To spawn the units properly you could calculate how many units have been input for each Row and use that number to determine the starting offset from it's Row Region.

So if you have 10 Grunts (Row 1) then the starting point for the first Grunt would be the center of Row Region offset by -45*10 (-450). Each Grunt would then spawn +100 offset to the right.

So if Row 1 is at the coordinates 0,0 (center of the map) then it would spawn the Grunts at these coordinates:
Grunt 1 = -450,0
Grunt 2 = -350,0
Grunt 3 = -250,0
Grunt 4 = -150,0
Grunt 5 = -50,0
Grunt 6 = 50,0
Grunt 7 = 150,0
Grunt 8 = 250,0
Grunt 9 = 350,0
Grunt 10 = 450,0

This formula would probably have to be adjusted to account for different amounts of units.
 
Status
Not open for further replies.
Top