Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Auto Sensor for Sliding Doors

Imani Moseley
Registered User
Join date: 23 Mar 2005
Posts: 34
07-22-2005 23:11
I'm sure this is around somewhere but I've looked and can't find it. I need sliding doors to automatically open when someone approaches, please. Thank you.
nonnux white
NN Dez!gns
Join date: 8 Oct 2004
Posts: 90
07-23-2005 03:45
there are 2 methods for doing this.

1st method is using sensors. but, almost all the time the door will be idle, so a sensor for each door is not very good ideia because many sensors degrades the sim performance.

my favorite method is placing an extra prim (transparent, and phantom) so when one avatar colides with this prim the door will open.

this method is very silent, and can be very effective and faster then the sensor method (unless u use a high rate sensor, but this is even worst for sim performance)

so, for using the colisions do something like that on the phantom prim:
CODE
 default {
collision_start(integer num_detected) {
llSay(0, llDetectedName(0) + " collided with me!");
// place your code to OPEN the door here
}
default {
collision_end(integer num_detected) {
llSay(0, llDetectedName(0) + " has stopped colliding with me!");
// place your code to CLOSE the door here
}
}
}


this will need some extra code to filter the colisions, because collision_start works similar way like touch_start

if u link this phantom prim (for using LinkMessages) u will avoid a listenner on the sliding door (so again, better sim performance). use llPassCollisions for achiving this
_____________________
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
07-23-2005 04:07
Ok please correct me if I'm wrong I don't have SL available to test this but from my own experiences with collision handlers ...

- Linking a phantom prim to the main doors will make the entire link set phantom which may defeat the point of a door. Phantom objects do not receive collision events. I think you might need to turn on llVolumeDetect() in the detector prim. That will make the prim phantom and allow it to detect collissions.

- I'm not convinced of the need to use llPassCollisions() unless there are already scripts with collision handlers in the child prims.

- definately never use listeners or sensors for doors.
_____________________
Geometry is music frozen...
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
07-23-2005 05:06
From: Laukosargas Svarog
Ok please correct me if I'm wrong I don't have SL available to test this but from my own experiences with collision handlers ...

- Linking a phantom prim to the main doors will make the entire link set phantom which may defeat the point of a door. Phantom objects do not receive collision events. I think you might need to turn on llVolumeDetect() in the detector prim. That will make the prim phantom and allow it to detect collissions.

- I'm not convinced of the need to use llPassCollisions() unless there are already scripts with collision handlers in the child prims.

- definately never use listeners or sensors for doors.


I'm not sure about the rest but on the subject of linking phantom objects, you're right.. But it may not be a problem, if the doors open when you hit the transparent prim, you won't be able to touch the doors themselves in the first place. And you can just have a frame, which need not be linked..
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.
---------------
Zapoteth Designs, Temotu (100,50)
---------------
Rayve Mendicant
Scripts for L$5 billion
Join date: 12 Mar 2005
Posts: 90
07-23-2005 07:46
Yes, I gave away a neat little volume detect door opener/closer thingy a long time ago, but it does indeed make the door itself phantom, which makes the opening and closing just special effects.
If you are not worried about security this really isn't a problem.

However, another option is to put the collision filters in the floor on either side of the door. This way, you odn't have to worry about making anything phantom. Link the door to the floor tiles, and texture tteh floor part to match the rest of your floor.

Because of the nature of collisions in SL, each time somone takes a step it is taken as another collision (annoying). You'll have to manage this in a method similar to this: /54/03/54867/1.html
_____________________
_______________________

Rayve Mendicant
Second Evolution

"Darwin ain't got nothin' on this"
nonnux white
NN Dez!gns
Join date: 8 Oct 2004
Posts: 90
07-23-2005 15:59
u cannot have 1 phantom prim linked to 1 non phantom, all set will be phantom. doors and walls on SL are just for visual effect, visual closing. if the door is locked and u cannot enter in the house (if u forgot the key inside :]), just build a box, sit on it and move it trought the door, voila!

so, my main concept for this door, is only visual. use land tools to have some "privacy"...
_____________________