i need to make a turf that allows a player to go one direction but not the other, so i no it'd be like...
turf
oneway
Entered()
but i dont the the commands, would it be like usr.dir? or how do i do it?
ID:169496
![]() Jun 9 2005, 4:36 pm
|
|
ok thnx, but im kinda making a sidscrolling game, and i changed the line to make it so i cannot go west, but my guy kinda falls thru the ground now O.o, what do i do?
|
turf try that it should work for what want |
Deathstar175 wrote:
turf try that it should work for what want Well, no. You're checking for "if(M.dir == South)", which is completely invalid. See, the ten directions (eight cardinals plus UP and DOWN) are defined like so (taken from [link]): //directions All of them are in caps, as you can see. Since DM, like most languages, is case-sensitive, your snippet actually wouldn't compile. This one would work: //don't allow mob entry from the north |
Out of interest, would this work too?
turf/no_fall/Enter(mob/M) |
DeathAwaitsU wrote:
Ah well that simplifies my life a lot. Remember though -- just because numbers can be used instead of the constants doesn't mean that you should. Doing so would make your code a lot harder to read. There's no reason, however, that the bitwise operators shouldn't make everything a whole lot simpler, if that's what you meant! =) |
Or, a way Garthor displayed it before:
var/list/nodirs=list(/turf/nonorth=NORTH,/turf/nosouthwest=list(SOU\ I think that's how he did it, I can't remember. [edit]Bleh, I had to fix something, I forgot to put /turf/ in the beginning! |
Since I'm making sure only mobs can't enter from the north, /objs will be able to move through the turf normally.