Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

New function please

AmiRyu Hosoi
Registered User
Join date: 1 Sep 2006
Posts: 103
09-24-2007 14:41
I am in a project an need to detect if an object still exists. I also couldn't find a function that checks if an object was deleted or derezzed.

Can we please have that function?

Amiryu
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
09-24-2007 23:59
since many objects share the same name you need to go by key

since you have that to search for an object, you can currently use a scanner to do the same thing, altho it has a range
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
09-25-2007 02:15
Can you describe your project a bit more? As Osgeld points out, you can use a sensor, for example if you have an object creating an item you could use a script like:

CODE
default {
state_entry() {
llRezAtRoot("myObject", llGetPos(), ZERO_VECTOR, llGetRot(), 12345);
}

object_rez(key id) {
llSensorRepeat("", id, SCRIPTED, 96.0, PI, 60.0);
}

sensor(integer x) {
// Object still exists/within range
}
no_sensor() {
// It's gone!
}
}


If the object may go out of range, but you know it won't leave the simulator, then you can modify this to:

CODE
key myObjectKey = NULL_KEY;

default {
state_entry() {
llRezAtRoot("myObject", llGetPos(), ZERO_VECTOR, llGetRot(), 12345);
}

object_rez(key id) {
myObjectKey = id;
llSetTimerEvent(60.0);
}

timer() {
if (llKey2Name(myObjectKey) == "") {
// My object is gone!
llSetTimerEvent(0.0);
}
}
}
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
AmiRyu Hosoi
Registered User
Join date: 1 Sep 2006
Posts: 103
09-25-2007 03:23
Thanx guys, but I need to check terminals all over the grid.

Ami
Nargus Asturias
Registered User
Join date: 16 Sep 2005
Posts: 499
09-26-2007 20:22
Have them talk back either via XML/email then?
_____________________
Nargus Asturias, aka, StreamWarrior
Blue Eastern Water Dragon
Brown-skinned Utahraptor from an Old Time