I dont get any errors in this but i doesnt work, can ya help?
area
Borders
Northborder//can walk on turf,but may not exit north
Exited()
if(usr.dir == "east"||usr.dir == "west"||usr.dir == "south")
return 0
else
return 1
Eastborder//can walk on turf,but may not exit east
Exited()
if(usr.dir == "west"||usr.dir == "north"||usr.dir == "south")
return 0
else
return 1
Southborder//can walk on turf,but may not exit south
Exited()
if(usr.dir == "east"||usr.dir == "north"||usr.dir == "west")
return 0
else
return 1
Westborder//can walk on turf,but may not exit west
Exited()
if(usr.dir == "east"||usr.dir == "north"||usr.dir == "south")
return 0
else
return 1
My comment on the name should explain what i want it to do.. but if youd ont get it let me explain. I'm using this for places like cliffs so you can walk to the edge of the clif, but not walk off, then i use the opposite border on the other side so they can magically walk over the side and onto the cliff. So i want them to be able to walk on the turf, just not exit a certain direction which is the direction I left out. and they can't move diagonal....
ID:147740
Dec 31 2003, 8:46 pm (Edited on Dec 31 2003, 9:43 pm)
|
|
In response to Garthor
|
|
byond doesnt give me errors... >.> but it no work.. > . <
|
In response to Newen
|
|
Newen wrote:
byond doesnt give me errors... >.> but it no work.. > . < You're making a mistake in thinking that "errors" means only compiler errors or runtime errors. It doesn't. An error is simply anything that fails to function properly in your code. Ergo, if your code doesn't work, it does have errors. Lummox JR |
Very easy to fix, the problem is that you are using Exited(), which does its effect when the object has successfully left it. You want Exit(), So whenever something tries to leave it, it will do what you want.
The other problem, I believe, Is that you are using usr. Dont put usr in procs v-v. If you add: world << "usr = [usr]" turf/WestBorder |
In response to Evil Incarnate Inc
|
|
Actually, user is the client that initiated a chain of events. In a proc, it may be who you think it is, it may be another player, it may be null, which is why it shouldn't be used unless you are in a verb.
|
And there are errors: you have usr ALL OVER THE PLACE.