ID:166875
 
Alright, I have this mob with a proc
-----------------------------------------------

mob/var/mob = 0

mob
NPC/mob
name = "mob"
icon = 'mob.dmi'
icon_state = "mob"
density = 0
New()
..()
RoboMove()


proc
RoboMove()
sleep(100)
step(src,NORTH)
sleep(50)
step(src,NORTH)
sleep(50)
step(src,NORTH)
sleep(50)
step(src,SOUTH)
sleep(50)
step(src,SOUTH)
sleep(50)
step(src,SOUTH)
sleep(50)
step(src,EAST)
sleep(50)
step(src,EAST)
sleep(50)
step(src,EAST)
sleep(50)
step(src,WEST)
sleep(50)
step(src,WEST)
sleep(50)
step(src,WEST)
sleep(50)
RoboMove()
-----------------------------------------------------

Notice that mobs density=0 and it is on a "track"

My question is----How can I get my PC to stay on top of and follow with the mob?

Like this:

PC = I
_
mob= | |
-

_
PC on Mob = |I|
-
I don't really understand what you want, but that proc is burning my eyes just looking at it...

    proc
RoboMove()
sleep(100)
for(var/a=3,a>0,a--)
step(src,NORTH)
sleep(50)
for(var/a=3,a>0,a--)
step(src,SOUTH)
sleep(50)
for(var/a=3,a>0,a--)
step(src,EAST)
sleep(50)
for(var/a=3,a>0,a--)
step(src,WEST)
sleep(50)
src.RoboMove()


There may be an even more efficient way to do this but it's midnight... and I am tired.

-Exophus
In response to Exophus
That procedure will eventually crash the game unless you make it 'spawn() RoboMove()' or use a while loop.
In response to Jp
ok ok..........I know its a bad move proc

but my original question remains unanswered......

if i step on this mob(with density=0) it will continue to move weither or not i am on top of it.

when i step on this i want my character to move with it.

got it?
In response to Mohanico
I know what you want, and getting uppity isn't going to help much. I was just correcting Exophus' version of your little movement procedure, because I'm fairly sure you don't want that little procedure dying on you ten minutes into the game.

To answer your question, look up turf/Entered(), and have players go into the contents list of the moving mob when they step on a tile containing it.
In response to Jp
could you show me in code plz?

TY in advance!
In response to Mohanico
could you show me in code plz?

Yes, I could.
In response to Jp
CAN you show me in code pleeeeeaze?
In response to Mohanico
this my current work----still doesnt work
--------------------------------------------------

mob
NPC/mob
name = "mob"
icon = 'mob.dmi'
icon_state = "mob"
density = 0
New()
..()
RoboMove()
Entered(mob)
usr.Move(locate(/mob/NPC/mob))

proc
RoboMove()
sleep(100)
for(var/a=3,a>0,a--)
step(src,NORTH)
sleep(50)
for(var/a=3,a>0,a--)
step(src,SOUTH)
sleep(50)
for(var/a=3,a>0,a--)
step(src,EAST)
sleep(50)
for(var/a=3,a>0,a--)
step(src,WEST)
sleep(50)
src.RoboMove()
In response to Mohanico
Ahh, yes. Forgot the spawn, as did you. Anyways, if you don't look up Entered() and the other things Jp said, this little lesson will have been for nothing. Open up your dream seeker and press F1.
In response to Exophus
where did i forget the spawn? in the moving or the entered()?

Looking in the help file doesn't work because i am entering a mob---I did try it---thats why i am still asking for help.
In response to Mohanico
The New().
In response to Exophus
Exophus wrote:
The New().

???
In response to Mohanico
        New()
..()
spawn()RoboMove()


.>
In response to Exophus
Wrong. You'll still run into the mentioned problem. You need to spawn off new instances of the proc from within the proc. So in RoboMove, he spawns off and THEN calls RoboMove.
In response to Audeuro
Ahh, my mistake.
In response to Exophus
althoug hu guys are right that still doesnt help my situation........

I need my PC to move with the npc(on top of)
In response to Mohanico
umm...........help?