Hey guys, I was just wondering... in many situations I have to execute a proc() that was defined under the parent type /obj in different parent type (eg: /mob)
In some cases I want the procs to be ran at the same time as the player logs in or as long as the server is up, even if no players are online.
I tried many times to get /mob/NPC/proc to work within:
mob
Login()
..()
but this only applies to mobs that haven't been named NPC, my point is, I was wondering if someone could guide me through on how to execute a proc() even though its in a different area of the Parent_Type Code Tree.
My current situation is making it so all of the Survellance Cameras in my game are moving back and forth when the player logs in or if possible, as long as the server is up.
My current Coding is:
Code:
obj
var
Power = 1
PoweredOn = 0
obj
SurvellanceCamera
name = "Survellance Camera"
icon = 'Security Camera.dmi'
Power = 1
PoweredOn = 1
desc = "These Survellance Cameras will help keep this base secure."
obj
SurvellanceCamera
proc
PoweredCameras()
while(PoweredOn == 1)
flick("Movement", src)
sleep(20)
obj/SurvellanceCamera
verb
TurnOnCameras()
set category = "Testing Cameras"
set src in view()
PoweredCameras()
Problem Description
Now the when I use the verb TurnOnCameras(), The closest camera will turn on and do everything I want it to do.
My problems are:
I want to be able to turn them on the moment the client/server
starts up, and my second problem is:
I want to be able to turn all of them on at the same time.
I've tried using the call() proc at the mob/Login() but it didn't do anything **Not sure if I did it right**
I would like to know how to fix this problem and how to move around the Parent_Type in the Code Tree so I can solve these
kinds of problems by myself if possible.
I hope you guys can help and I look forward to hearing back from you.
Thanks in Advance
Also, you might want to read about "Proc Inheritance" in the DM guide's chapter on procs:
http://www.byond.com/docs/guide/chap06.html