ID:161798
![]() Mar 30 2008, 11:16 pm
|
|
As the topic states im trying to make a gate open for people who a specific race and make other people have to sneak in through a hidden route
|
![]() Mar 31 2008, 12:40 am
|
|
Make a turf at the gate and use something like this:
|
Eh, didn't you just snatch that code? You should learn how it works and look up the Enter() proc so you can do such things yourself; also, that code has flaws; it doesn't validate that M is actually a mob and could lead to runtime errors, if not seen now then in the future, and, since it causes Enter() to explicitly return 1 every time a mob of certain race attempts to enter, they will always be enter no matter what, regardless of density and whether there are already dense atoms blocking the gate.
|
That needs an if(ismob(M)) in there to ensure that M is a mob. Additionally, it needs to return ..() to allow entry rather than 1, or it bypasses normal movement rules (can't stand on top of other dense objects).
|
Hey Garthor when I put ..() in Enter() it doesnt do anything so Im forced to use return 1 instead, are you sure of that? I want to know just in case theres a few things I need to check.
|
This depends entirely on how you want the gate to work...
Personally I'd make it check when you bump into the gate if your race is in the list of allowed races, e.g. obj/gate Of course you'd need to define the proc Bumped() for all atoms but lots of people normally make it anyway. |
It'll do nothing if the mob can't enter the turf because it's dense, or its area is dense, or there's an atom/movable on it that is dense.
In other words: all the things you'd want to prevent movement. |