How do you make so If I bump into this door only certain people to open it.(teams) P.S. If you help I am eventually going to allow you to hack open the door or trick the sensers with a fake fingerprint.
Here's the code tell me if you need more info.
doors
base_door
icon = 'basedoor.dmi'
blue
icon_state = "closedblue"
density = 1
proc
open()
density = 0
icon_state = "open"
sleep(40)
density = 1
icon_state = "closedblue"
Bump(mob)
if(usr/var/dooropen == "1")
open()
ID:150064
![]() Dec 22 2001, 6:00 pm
|
|
![]() Dec 22 2001, 6:06 pm
|
|
Your problem is that the door doesn't bump into the mob, the mob bumps into it here's how you can do this:
|
Exadv1 wrote:
How do you make so If I bump into this door only certain people to open it.(teams) P.S. If you help I am eventually going to allow you to hack open the door or trick the sensers with a fake fingerprint. I would suggest not doing this with subclasses, but instead with a var like "blue" or "red". The biggest (but not the only) problem with your code right now, though, is that you're using Bump() wrong. Bump() belongs to the mob, not the door. What you need is for mob.Bump(atom/A) to call a special A.Bumped(src) proc, and then use the obj's/turf's Bumped() proc to handle the action. obj/door/base_door You need code a little more complex than this, but it should help get you started. Lummox JR |
Thanks
Um is there anyway you can help me understand variables Because...... EVERTIME I TRY TO USE ONE I GET A MILLION ERRORS. |
Lummox JR wrote:
Exadv1 wrote: obj/door/base_door You need code a little more complex than this, but it should help get you started. Do me a favor and um comment a few lines.Like these. New(l,c) |
Well let me try:
var/blah // sets a global var mob/var/blah // sets a var that only mobs can use obj/var/blah // see above same with turf/var, area/var, and atom/var Setting a var within a verb/proc(including if()) can only be used within that verb or proc. Hope that cleared a few things up. |
Nadrew wrote:
Well let me try:Ummmmm instead if I have a var problem I'll ask you directly what the problem is. |