ID:178873
 
Im having trouble. I cant seem to figure out how to make my stairs go up and down. My stairs are called dw1stairsdown dw1stairsup stairsdown stairsup
could someone help me with this
whats yeh problem?
In response to Strange Kidd
i cant figure out how to make them go up and down! i cant figure out how to code it
In response to BigDaddy
Well really you need to locate them. Also do you have an area mapped for where they go if so get the coordinates.

Heres an ex.

turf/upstairs
Enter()
usr.loc=locate(1,1,2)

Those were just some random x y z values.
In response to Super16
thanks
In response to Super16
Super16 wrote:
Well really you need to locate them. Also do you have an area mapped for where they go if so get the coordinates.

Heres an ex.

turf/upstairs
Enter()
usr.loc=locate(1,1,2)

No no no no. Giving bad advice on Newbie Central is worse than giving none at all. Please don't post broken code examples like this.

  • Never use usr in Enter() or Entered(). In fact, don't use it outside of a verb unless you really know what you're doing with it.
  • Never use Enter() for teleporting; use Entered() instead. Enter() is for checking if a player can walk on a turf or not; Entered() handles the case after they've stepped there.
  • Entered() takes two arguments. The first one is the thing that's moving, and that's the thing whose loc must change, not usr.

    Better code would look more like this:
turf/stairs
var/destx=1
var/desty=1
var/destz=2

Entered(atom/movable/A)
A.loc=locate(destx,desty,destz)

Lummox JR
In response to Lummox JR
Theres nothing wrong with it if it works.
In response to Super16
Problem is when you try that code with alot of people in the game the code will start messing up on you, usr is evil very evil period. If you want to help people, Super16. Help them right.
In response to Nadrew
Nadrew wrote:
Problem is when you try that code with alot of people in the game the code will start messing up on you, usr is evil very evil period. If you want to help people, Super16. Help them right.

:) I am all about the cheap code..... Yes I should help right.. But life is too short to waste, especially on code:P src can be evil too.
In response to Super16
Super16 wrote:
Theres nothing wrong with it if it works.

Yes there is, if it only works for you. Liking "cheap code" is one thing, but liking bad code is another. You picked about the worst way possible to do that, and it's only going to encourage bad programming practice and likely send BigDaddy back here for help when it breaks down on him. If you're going to help someone, don't put them on a bad track.

Lummox JR