world
New()
spawn(2)
SpawnMons()
proc
SpawnMons()
while(src)
new /monsters(/area/random)
sleep(25)
area
var/list/tcontents = new()
New()
..()
for(var/turf/X in src.contents)
tcontents.Add(X)
random
monsters
parent_type = /mob
var
var_health
max_health
New(Spawn_pt)
spawn(1)
DIE()
Spawn_Mob(Spawn_pt)
sleep(20)
src.var_health = 0
proc
DIE()
while(src)
if(src.var_health <= 0)
world << "[src.name] died."
del src
else
sleep(1)
Spawn_Mob(area/A)
var/turf/T = pick(A.tcontents)
src.loc = T.loc
world << "[src.name] has been spawned at [src.x],[src.y],[src.z]"
Problem description:
runtime error: Cannot read /area/random (/area/random).tcontents
proc name: Spawn Mob (/monsters/proc/Spawn_Mob)
usr: the monsters (/monsters)
src: the monsters (/monsters)
call stack:
the monsters (/monsters): Spawn Mob(/area/random (/area/random))
the monsters (/monsters): New(/area/random (/area/random))
: SpawnMons()
: New()
I am using XML to store the mobs in a database and wanted to setup a spawn to randomly locate the mobs in a turf in the area.
I am attempting to recreate the area list, putting only the turfs in, then using this list to place the mob randomly in the area, but keep getting a runtime.
Any insight on what I did wrong ?
Thanks