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

Space between units {setting a specific distance between 20 spawned units}

Status
Not open for further replies.
Level 11
Joined
Feb 14, 2009
Messages
884
I have written a trigger which spawns 20+ units in the center of a region. Is there any way of setting a space between them, as Hanyu has done on his TD map? Now, they are spawned all together one very close to another and I don't want this since I need them to move freely. Thanks in advance :D
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
kinda complicated
For Each A integer from 1 to C
-For Each B integer from 1 to V
--Create Unit in Location(Q+ ( CITR(B) x S ), W+( CITR(A) x S ) )

CITR is the "Convert integer to Real" function
Q is X coordinate of position of first unit
W is Y coordinate of position of first unit
C is number of lines of units
V is number of units in a single line
S is space between em
and A and B are usual loop counters
x and + are calculation symbols
 
Level 11
Joined
Feb 14, 2009
Messages
884
Hm, thanks a lot. I 'm gonna try it and I'll let you know. :D

{EDIT}
It works! I had some problems implementing it but now it's fine. I love you! +rep :)
 
Last edited by a moderator:
Status
Not open for further replies.
Top