can you create a loop so that if an area isn't occupied by a specific mob then it creates the mob on that area. this is my current code:
world
New()
while(locate(/area/gym1))
new /mob/chuck(locate(/area/gym1))
del locate(/area/gym1)
im creating a pokemon game and I wanted there to be 3 of the same person but it only makes 1
ID:154968
Oct 23 2011, 1:21 pm
|
|
<dm>
area // Areas
var // Area vars
MWithin = 0 // Mobs within
Gym // Gym Area
proc
Populate() // Populate proc
while(MWithin < 3) // While the mobs within counter is less than 3
var/list/L = list() // Define L to be an empty list
for(var/turf/T in src.contents) // This will loop through the area's contents (which should be turfs). In theory this should work but then again, Imma clueless dope.
L += T // Add the turfs to the list (references)
var/turf/NewTurf = pick(L) // Define NewTurf to be a turf reference chosen from L
new /mob/Monster (NewTurf) // Create a new mob at that turf
MWithin ++ // Add 1 to MWithin so there's no infinite loop
proc
for(var/area/Gym/G in world) // Loops through the Gym area
spawn(0) G.Populate // Spawn the populate for that gym