ID:264472
 
Code:
if("Edit Object's Direction")
o.dir = input("What would you like the [o]'s direction to be?",o.dir) in list("North","South","East","West","Northeast","Northwest","Southwest","Southeast")
if("North")
o.dir = NORTH
if("South")
o.dir = SOUTH
if("East")
o.dir = EAST
if("West")
o.dir = WEST
if("Northeast")
o.dir = NORTHEAST
if("Northwest")
o.dir = NORTHWEST
if("Southwest")
o.dir = SOUTHWEST
if("Southeast")
o.dir = SOUTHEAST
src << "<font color = green><b>[o]'s direction has been changed!"


Problem description:
It's suppose to change an obj's direction but all it does is change East.Some help please?
Its cause you put o.dir = input, then the if()'s afterwords have no real meaning. you can instead use switch(input... and indent the if()'s then it will work. Or instead just put the values of the dir in the input and you won't need any if()s.
You could also use list associations to avoid the need for any branching structure.

As an example:
mob/verb/change_direction()
var
list/directions = list("North" = NORTH, "South" = SOUTH, "East" = EAST, "West" = WEST)
src.dir = directions[input(src, "Choose a direction", "Choose Direction", NORTH) in directions]
You're treating this as a switch while it isn't a switch. It's never gonna work like this.