It recently came to my attention that, for a project I'm developing with a friend, we require a code that moves players who step onto a certain tile to be moved a tile or two over/up. Now, I've created a diagram of what I'm trying to explain.
http://oi53.tinypic.com/9s8mk1.jpg
Player One needs to move from Point A, the red circle, up the stairs to point B, the blue circle. My knowledge of coding is very, very basic, so I was wondering if there was a way to make it so that the player can move to point B simply by moving into the stairs. I don't really want to resort something that looks like a teleport but I will if needed, however I'd still love for anybody kind enough to make a code to make it so that it looks as if the player is progressing up the stairs. Thank you.
ID:155868
Feb 26 2011, 3:25 pm
|
|
Feb 26 2011, 3:43 pm
|
|
Why can't the player just walk up the steps?
|
In response to Moussiffer
|
|
The second tier that the steps lead to are facing east/west, and are at least a tile "above" the player when he walks into the actual stair icons.
|
This isn't perfect, but it should give you an idea of where to start. Descending stairs are high on the left side and low on the right, and ascending stairs are the opposite of that.
The most useful proc for what you want to do is the turf/Entered() proc. It gets called once an object successfully moves into a turf. So a player successfully moves onto a stairs turf, Entered() checks to see where they should go next, and then it moves them there. This example has stairs turfs placed along a 45 degree diagonal line, going from top-left to bottom-right. turf |