• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,345
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: 15

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
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