• 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.

[Spell] To fill up a circle

Status
Not open for further replies.
You want a spiral?

1. Set x,y position = tempLoc
2. Loop for i from 1 to 'number of effects'
3. Change angle let's call it "a" so now, a = i x 10
4. Now the offset "o" let's have o = i x 10
5. Set tempLoc2 = tempLoc offset by o towards a degrees

Do you want rings?

1. Set x,y position = tempLoc
2. Loop for i from 1 to 36 and loop for i2 from 1 to however many rings you want
3. Change angle let's call it "a" so now, a = i x 10
4. Now the offset "o" let's have o = i x (i2 x 10)
5. Set tempLoc2 = tempLoc offset by o towards a degrees

Now both of these will decrease the frequency of occurrences as you move away from the center.

You want even spaces I believe. To do this use the distance of tempLoc2 from temploc. The larger that number gets ... remember it's called 'o' then smaller the angle multiplier should be. So now we have something like a = i x (10 - (o / 100)).

You will have to play around with it. I suggest making a configuration and setting the multipliers and dividers as variables too.

This is the basic structure, I'm sorry I'm not smart enough to spell it out exactly how you wanted it.
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
Not possible as units have point origins and circular collision. There is no way to place them that it is "solid". If you want proof then grab a piece of paper and cut it into circles. There is no way to position the circles to be completely solid.

You might want to redefine what you are after.

For dense unit packing you can place them in different orbitals every collision diameter (2 * radius) apart. There might be small gaps between the units however this will be by far the simplest approach to get good enough results.
 
Level 7
Joined
Oct 19, 2015
Messages
286
The simplest way to more or less evenly cover a circle with units is to place one unit in the middle, 6 more units in a circle with radius d around the first, 12 units at distance 2*d, 18 units at 3*d and so on until you reach the edge of the circle you want to fill. Adjust the value of d to the size of your mist model.
 
Status
Not open for further replies.
Top