ID:155134
 
turf/portal1
icon = 'Turfs.dmi'
icon_state = "portal1"
Entered(mob/M) //built in proc
M.loc = locate(2,1,1)

Hi, the above code works for turfs and areas and I need an example that would work using obj/portal1 instead of a turf..I have tried using Bump instead of entered but still cant get objects to teleport mobs..(really needs to be obj that teleport as i want the portals to be moveable or may add a wander proc..)

can anyone provide a code that teleports mobs using objects instead of using turfs?
There's no reason that Bump() should not work. Could you post what you tried for bump? Also, use the DM tags please.
In response to Lugia319
Well Entered() is only called when you enter the contents list of the object. Turfs and Areas are the only atoms that automatically add others into their content list when stepped on, meaning that walking over a(n) obj/mob will not call Entered() only if you were teleported inside of the obj.contents list.
In response to Danbriggs
I know that, but he said he used bump and it didn't work. So I'm curious as to what he tried.
You may have placed Bump() under the /obj/portal's code, where it actually doesn't belong. As it says in the DM Reference, Bump() is called for the mover, and atom/movable/Obstacle is what src bumped into.

What you might prefer is a Bumped() proc.
// Define the proc. It does nothing by default.
atom/proc/Bumped(atom/movable/Bumper)

// Call the proc above in the right situation.
atom/movable/Bump(atom/movable/Obstacle)
..()
// When src bumps into Obstacle, Obstacle receives the bump in Obstacle.Bumped(src) while src receives the src.Bump(Obstacle)
Obstacle.Bumped(src)

obj/portal1
Bumped(mob/m)
m.loc = locate(2,1,1)

// alternative to Bumped():
mob/Bump(obj/portal1/portal1)
if(istype(portal1))
loc = locate(2,1,1)
..()
// this can be placed anywhere
// it may just make your code less readable or less organized.
In response to Kaiochao

Thats the type of code I should be using i think thank you..
..Tried your code and they work perfectly many thanks and do you want credit if i use your code?=]