Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: CobraKill on May 29, 2013, 10:43:28 PM

Title: Creating Square Ranges
Post by: CobraKill on May 29, 2013, 10:43:28 PM
Is it possible to create a square range? I'm hoping to make an emitter that get stronger when a unit is present on a rectangular square plateau. Can I make the range rectangular?

EDIT: Hunter Killer helped me in chat.
Title: Re: Creating Square Ranges
Post by: Hunter Seeker on May 29, 2013, 11:18:39 PM
If i wanted to do this I would:
find the area as a square i wanted with length L
take the sqrt(2)* L/2 and round up    ->radius of circle for getunitsinrange
use a do loop to exclude units if they have a x/y over/under the desired square.
It is quite possible there is another easier way to do this however.