ID:262756
 
Code:
obj/spawn_point
var/mon_type
New()
spawn()
Spawn() //heh...
..()
proc/Spawn()
sleep(3000) //wait 5 minutes
new mon_type(src)

mob/monster
var/obj/spawn_point/spawnp
New(obj/spawn_point/S)
spawnp=S
..()
Del()
spawnp.Spawn()
..()


Problem description:
What I want it to do is have a spawn point that spawns a monster. Once that monster is killed the monster calls the spawn points Spawn() proc. However, I need to know how to make a var be a datum type (specifically a /mob/monster type for this)
you mean like
var/mob/monster/M = new/stuffhere
if(!M)//if M dies
TAB> spawnsp.spawn()
?
//Monster Spawner


obj/monspawner
name = "Monster Spawner"
var/spawntype = /mob/monsters/Evil_Dude
var/max_spawn = 5
var/spawned = 0
New()
..()
spawn while (1)
src.check_spawn()
sleep(50)


proc/check_spawn()
if(spawned < max_spawn)
var/mob/M = new spawntype(src.loc)
M.owner = src
spawned ++


mob
var/atom/owner
Del()
if (owner && istype(owner, /obj/monspawner))
var/obj/monspawner/O = owner
O.spawned --
..()
In response to Ajmoore
Please use <dm></dm> tags.