mob
Bump(var/door/locked/L)
if(src.unlocked_doors.Find(L))
L.Open()
else
if(src.contents.len)
if(src.contents.Find(L.key))
src.unlocked_doors.Add(L)
..()
I don't get why it doesn't work. =/
Also, thanks for reading.
ID:268881
Dec 17 2004, 11:11 am
|
|
mob I don't get why it doesn't work. =/ Also, thanks for reading. |
Dec 17 2004, 11:15 am
|
|
obj/door/Bump() better? Why would bumping into a mob work >.>
|
In response to DeathAwaitsU
|
|
DeathAwaitsU wrote:
Are you trying to call this when you bump into the door? Yes. And to Night: It's the mob bumping it. :P |
In response to Hell Ramen
|
|
Use Bumped instead:
atom/proc/Bumped(atom/movable/bumped_by) //Declare a new proc for all atoms called Bumped. The M(players) and srcs may be wrong btw. |
In response to DeathAwaitsU
|
|
Whoops, I totally misunderstood that.
|
In response to Hell Ramen
|
|
As in you don't understand my code or misunderstood the Bump concept?
|
In response to DeathAwaitsU
|
|
Don't understand it, could you explain it a bit? =/
|
In response to DeathAwaitsU
|
|
When the door is bumped, call the Bumped() proc.
If the thing that Bumped it(A) is a mob of the type /mob/Player, call that mob M. The rest is your code, take in mind that the thing Bumping the door(the player) is M and src is the door itself. |
In response to DeathAwaitsU
|
|
_> Hmmmm...it still doesn't seem to work. I even debugged it with messages (src << "Q1",etc)...well, thanks for the help so far. |
In response to Hell Ramen
|
|
src << "Q1" would give the object a message not the player...
Try this: atom/proc/Bumped(atom/movable/bumped_by) //Declare a new proc for all atoms called Bumped. Tell me what comes up. |
In response to DeathAwaitsU
|
|
Ahhh, so my coding was wrong in the lowerhalf. Your's is correct.
[edit]So, now my question is, how to correct the bottom half of my code? |
In response to Hell Ramen
|
|
Could you tell me what you want to do if the door hasn't already been unlocked? Whats that bit after the else?
|
In response to DeathAwaitsU
|
|
If the mobs contents has something.
If it finds the door's key var (src.key) Add the door to the person's unlocked list. |
In response to Hell Ramen
|
|
atom/proc/Bumped(atom/movable/bumped_by) //Declare a new proc for all atoms called Bumped. Right then, with this if it finds the door in M's list, open it. If it didn't find the key, it checks if M has unlocked the door. If he has, add the door to M's unlocked doors list. |
In response to DeathAwaitsU
|
|
"if(M.unlockeddoor)"
I'm kind of trying to make the doors easy to edit, so for each locked door I just have to set a "key = /items/keys/key/blahblah" to it. =/ |
In response to Hell Ramen
|
|
Ok...right...
If I understand you correctly, this example(which I actually tested) should work: obj |
In response to DeathAwaitsU
|
|
Yay, thanks Death.
|