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|
-
ID:166875
![]() Jun 4 2006, 7:39 am
|
|
That procedure will eventually crash the game unless you make it 'spawn() RoboMove()' or use a while loop.
|
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? |
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. |
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() |
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.
|
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. |
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.
|
althoug hu guys are right that still doesnt help my situation........
I need my PC to move with the npc(on top of) |
There may be an even more efficient way to do this but it's midnight... and I am tired.
-Exophus