ID:160272
 
how can i make things spawn randomly in a circle, i know how to make things get spawned in the same spot each time , realative to the player, and i know the proc rand(), but i have no clue how i would get this to be in the shape or close to the shape of a circle
please help

There's many ways one could potentially do this, but my preferred implementation would be to create a list of turfs that make up a circle and then perform a random roll based off of the list.len. Then return that turf and you're set to go.

If you're still confused, here's a few links that might help:

Using Lists

rand() reference

If that's still too hard, practice coding for a bit and you should pick it up in time. In the meanwhile, stick with static spawn points.
Oh, one more thing, if you check out the resources page you'll find some good code on creating circles near the bottom of the first page. "BasicMath" by AbyssDragon.



Randomization: [link] You can use pick() to randomly pick a value from a list.
Getting a list of turfs in a circle: you could use a loop with turn() and get_step()
In response to Kaioken
I was looking at the DM guide just now, and I found an even easier way:

block(get_step(centerturf,NORTHWEST),get_step(centerturf,SOUTHEAST))


The only trouble (assuming you're not standing next to a map edge) is that this isn't a true circle, just a block. You'd need something like AbyssDragon's simple math library for a good circle generator.