ID:140999
 
turf
start
icon = 'person.dmi'
icon_state = "start"
turf
end
icon = 'person.dmi'
icon_state = "end"
turf
dead_end
icon = 'person.dmi'
icon_state = "dead_end"
______________________________________________
turf
skeleton
icon = 'person.dmi'
icon_state = "skeleton"
if(mob) is in oview()
mob.Move(locate(1,180,1))
________________________________________________
turf
skeleton1
icon = 'person.dmi'
icon_state = "skeleton1"
turf
devil
icon = 'person.dmi'
icon_state = "devil"
turf
blood
icon = 'person.dmi'
icon_state = "blood"
turf
blood2
icon = 'person.dmi'
icon_state = "blood2"

Help all i want to do is make it so the skeleton kills and teleports the mob (boy,girl) to the start of my maze... how hard is it to do it and plz help fast. O and how do i make blood squirt out of the guy? It would be named blood_squirt and what would i type for the code?
(problem in between the lines)

turf
skeleton
icon = 'person.dmi'
icon_state = "skeleton"
if(mob) is in oview()
mob.Move(locate(1,180,1)

turf
skeleton
icon = 'person.dmi'
icon_state = "skeleton"
for(var/mob/M in oview(2))
M.loc=locate(1,180,1)

I'm a novice but i think thats how to do it.
For what you're trying to do, I would manually create a check for whenever the player moves ( client.Move() ), detection of /turf/skeleton within 2 squares of the player. However, you could create a loop for the skeleton detecting any players 2 squares away.

In response to Mickmcgreevy
That is not how you do it. If you're a novice, please focus on learning before trying to help.

The issue here is that you can't just put code somewhere and have it do things, and you can't just make up your own syntax and think it will work. Code to be executed needs to go in a proc (or a verb, which is basically a proc).

As for what you have here, there are a number of ways to do this, but I think what you want is, "if a player steps within view of this turf, they should move somewhere else". So, the relevant code should probably go in mob/Move(), like so:

mob
Move()
//this performs the default action of Move() and stores the return value in . which is the default return value
.=..()
//Move() returns 1 on success and 0 on failure, so this is "did we move successfully?"
if(.)
//for every turf in view
for(var/turf/T in view(src))
//call its poke() proc
spawn() T.poke(src)

turf
//this proc is called by mobs whenever they move nearby
proc/poke(var/mob/M)
//by default, we do nothing, but any other type of turf can override this to do something

skeleton
//overriding poke() to do something for skeleton turfs
poke(var/mob/M)
//technically, this is redundant, but point is we would put what you were trying to do here
if(M in oview(src))
M.loc = locate(1,180,1)
In response to Garthor
ok no code problems but now it doesnt teleport my guy/girl back to the start, and all my skeletons that where already on the map randomly dissapeared i still need lots of help please!!!!!!!!!!!
In response to Bugboy79
Ermm... Just s suggestion, but from an organazational perspective, your code is wacky. Since when would a enemy be part of the florr(turf?)? Also, turf's can't move, last time I checked.
In response to Neos300
The /atom/movable object type is the ancestor of all mappable objects that are capable of motion. The types /obj and /mob are derived from /atom/movable. You should not create instances of /atom/movable but should use /obj and /mob for actual objects. This object definition exists solely to define variables and procedures related to motion.
~ BYOND Reference on Moveable atoms.

Nope, turfs can't move naturally.
In response to Neos300
my turf moves with exitment
In response to Bugboy79
That was a mistake on my part. I decided after I had written that to throw the redundant if(M in oview()) line into poke(), but forgot to change it to if(M in oview(src)), which it should be.

I guess it's a lesson in remembering to specify the center of view().
In response to Garthor
i dont meen to annoy you but i want it so it only happens when i stand on the skeleton because i already made map and i cant walk anywhere because of it.

I am so sorry for all this trouble i just am very new and need lots of help. please garthor will you be my friend for help?

and plz give me a code-line i need to fix so i can play it.
In response to Bugboy79
If you want to only teleport when you step on the skeleton, then you can simply use the Entered() proc:

turf/skeleton
Entered(var/mob/M)
if(ismob(M))
M.loc = locate(1,2,3)
In response to Garthor
turf/skeleton
Entered(var/mob/M)
if(ismob(M))
M.loc = locate(1,2,3)

so i type???

proc
turf/skeleton
Entered(var/mob/M)
if(ismob(M))
M.loc = locate(1,180,1)

so can you show me exactly how to do that?

In response to Garthor
nvm i figured it out so ONE more thing, then i let you go for a while. I made a thing called star. It makes a star go around the guys head. how do i make that happen before i teleport?