Help would be appreciated.
if(direction==1)
M.onstairs = 1
var/turf/T = locate(src.x,src.y,src.z+1)
M.Move(T)
M.onstairs = 0
else
M.onstairs = 1
var/turf/T = locate(src.x,src.y,src.z-1)
M.Move(T)
M.onstairs = 0
Thanks in advance,
~~> Dragon Lord
ID:261961
Mar 12 2004, 2:52 am
|
|
In my problem, when I go on stairs, it sends me up one z level. Well, when I try Move()ing there, it doesn't work!
Help would be appreciated. if(direction==1) Thanks in advance, ~~> Dragon Lord |
In response to Lummox JR
|
|
I don't think you understand what I mean. This piece of coding is in the Entered() procedure in a stair. The direction variable tells it if it is up, or down.
What I'm thinking that you were saying was to change my dir to move liturally up a z level and step that way? Thanks anyway, ~~> Dragon Lord |
Unknown Person wrote:
In my problem, when I go on stairs, it sends me up one z level. Well, when I try Move()ing there, it doesn't work! Come again? I can't figure out what you are trying to say. It works, but it doesn't work? The Move() function doesn't work, but you are still moving up one z level? Moving up works but you can't move back down? Please be more clear. |
In response to Sarkhan
|
|
I use Move() and it doesn't go to the location.
|
In response to Unknown Person
|
|
I don't see any major problems, but i am only looking at a portion of the code, and i am forced to assume what the rest of it looks like. For example, i assume that the onstairs variable is there to prevent an infinite loop?
Could you post the entire Entered() proc? |
In response to Sarkhan
|
|
Entered(mob/M) Here it is.. onstairs is to make sure it when you Move to there, you won't teleport to a loop. ~~> Dragon Lord |
In response to Unknown Person
|
|
Unknown Person wrote:
Any chance the turf above is dense, or that you overwrote Move()? |
In response to Jon88
|
|
The turf isn't dense, it is just another copy of the same turf, except it has the opposite number.
|
In response to Unknown Person
|
|
Does the proc work at least once? As in it will let you go up, but not down?
Resonating Light |
In response to Unknown Person
|
|
There is a variable called dir, which is used for direction. You should probably use that.
|
In response to Unknown Person
|
|
Unknown Person wrote:
I don't think you understand what I mean. This piece of coding is in the Entered() procedure in a stair. The direction variable tells it if it is up, or down. Actually there is. The built-in UP direction (16) moves you to x,y,z+1, and DOWN to x,y,z-1. Lummox JR |
In response to Lummox JR
|
|
OK now I am so frustrated, not that I didn't fix it, because I did. I followed your instructions, but it didn't work. THEN I figured out that Move() automatically is declined because I have my lock on. -_-
Thanks a whole lot, ~~> Dragon Lord |
In response to Unknown Person
|
|
I'm here to save the day!
client/var/locked = 0 Move() only works for leading the mob around a bit, not for entirely relocating it. Stick whatever else you need in there, I'm too lazy to copy it all. |
In response to Enigmaster2002
|
|
Uh, first of all, do you bother to read my last thread? I already fixed it.
Second of all, I want to use Move() because moving into new areas are important. That's the key point of it... [Edit] Also, that piece of coding would give you runtime errors. What if a free-flying object went into it? You aren't checking if it is a mob, it assumes it is. |
Better would simply be to use step(), which will do it all in one shot.
Lummox JR