ID:176362
 
I used the code seen here:
http://www.deadron.com/byond/ByondBwicki.dmb?TeleportingMobs

I got it to work, but it gives me this error in the game:

runtime error: Maximum recursion level reached (perhaps there is an infinite loop)
To avoid this safety check, set world.loop_checks=0.
proc name: Entered (/area/teleport/Entered)
usr: Jnco904 (/mob)
src: the teleport (/area/teleport)
call stack:

Then it starts spitting out about 30 lines of this stuff:

the teleport (/area/teleport): Entered(Jnco904 (/mob), the door (17,7,1) (/turf/door))
the teleport (/area/teleport): Entered(Jnco904 (/mob), the road (5,1,2) (/turf/road))
the teleport (/area/teleport): Entered(Jnco904 (/mob), the door (17,7,1) (/turf/door))


Does anyone know what is wrong? In the top of the error it says to set world.loop_checks to 0. I tried, but it then I get a duplicate definition error in DM. Please help.
The code you used has a fatal flaw: It's calling m.Move() instead of setting m.loc to the new destination directly.

The reason this is a problem is that Move() will call all the same procs that got you there, including Entered(). So if Entered() is called for the first teleporter when you move onto it, and if you use Move() to go to the next one which will also call Entered(), and if that teleports you back to the first one the same way, you end up with an infinite recursive loop.

I've made a note of this on the Bwicki page.

Lummox JR
In response to Lummox JR
Thanks, but m.loc(dest) gives me a bad proc error. Should I just use a different code all together?
In response to Jnco904
Jnco904 wrote:
Thanks, but m.loc(dest) gives me a bad proc error. Should I just use a different code all together?

loc is not a proc; I said you should set it, not call it.
m.loc = dest

Lummox JR
In response to Lummox JR
oops, sorry. Newbie here. :)

BTW that worked perfectly. You are my new hero. :)