ID:175326
 
I have a problem. I am using a maze generator for my game, so there are walls all over the place. I made a verb that, once clicked, will make an unlimited supply of monsters every so seconds. The problem is they end up on walls and just stay there and I can't move them using the Entered() thing for turfs because they can't move from one wall to the next.
This is all my code for one of the verbs that creates a slime.
mob/master_GM_verbs/verb
Makemonster()
sleep(10)
var/mob/monster = new /mob/NPC/Slime()
monster.Locate_Proc()
spawn()
Makemonster()
mob
proc
Locate_Proc(mob/M)
a = rand(1,world.maxx)
b = rand(1,world.maxy)
c = rand(1,world.maxz)
src.loc = locate(a,b,c)
src.x -= 1
if(src.loc == locate(0,0,0))
src.Locate_Proc()

Again, They keep appearing on walls and I don't know what to call it to check what they're standing on, like "usr.turf" or whatever.
CoWdUdE7 wrote:
I have a problem. I am using a maze generator for my game, so there are walls all over the place. I made a verb that, once clicked, will make an unlimited supply of monsters every so seconds. The problem is they end up on walls and just stay there and I can't move them using the Entered() thing for turfs because they can't move from one wall to the next.
This is all my code for one of the verbs that creates a slime.
mob/master_GM_verbs/verb
Makemonster()
sleep(10)
var/mob/monster = new /mob/NPC/Slime()
monster.Locate_Proc()
spawn()
Makemonster()
mob
proc
Locate_Proc(mob/M)
a = rand(1,world.maxx)
b = rand(1,world.maxy)
c = rand(1,world.maxz)
src.loc = locate(a,b,c)
src.x -= 1
if(src.loc == locate(0,0,0))
src.Locate_Proc()

Again, They keep appearing on walls and I don't know what to call it to check what they're standing on, like "usr.turf" or whatever.

First of all, you don't need the mob/M arguement in your locate_proc().

After you locate the mob, you have to check to see if what they are standing on is dense;

src.Move(locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.maxz))
while(src.loc.density)
src.Move(locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.maxz))


This may not be the best way, but it should work.

~>Volte