LLSensorRepeat Question
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-17-2009 10:56
Hi,
I have looked on the Wiki I can cannot see the definitive answer to this question, which I hope is a dead simple one.
When you use the llSensorRepeat command to scan for an avatar closeby, does the range at which the command checks start from the centre of the object or it's pivot point?
I ask as I am using the command to operate two doors which rotate open as you walk to them, they are made of a hollow cylinders which have been PathCut to creat slices which make the door panels. These cyliners are 9.5m across so if the scan is working of the piviot and not the slice this obviously has a majot impact on the scan range.
The command I am using is this: llSensorRepeat("", "",AGENT, 7, PI_BY_TWO, 1)
If the start of the scan is from the pivot is there a simple way to have it scan from the door (with say a 2m range) and still open as an avatar comes close to the inside or outside of the door?
Sorry for al the mini-questions. But I lack the understanding of the command to figure this out fully.
Many Thanks. Klaire
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-17-2009 11:02
To the best of my knowledge it starts from the coordinate origin of the prim with the script in it. Same with listen and chat distances. It can never hurt to experiment though.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
05-17-2009 11:04
Geometric center of the prim that the sensor script is located in.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
05-17-2009 11:07
It is easier to setup and has less impact on the sim if you use collision_start in two phantom, invisible prims instead of a sensor. Place one on each side of the door.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-17-2009 11:11
Not trying to be difficult, but why not put the sensor script in the door jamb instead of the door and then pass the trigger signal to the door with llSay/llListen on a private channel? You know that the door jamb is centered on the opening, after all. Even better, why not get rid of the llSensorRepeat altogether? You can put a prim across the door's threshold (either an invisible prim or a decorative one) and trigger the door with a collision_start event. That will save you the lag from having a sensor scanning the area every second. ETA: LOL.... What Jesse said..... 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
05-17-2009 11:18
From: Rolig Loon Not trying to be difficult, but why not put the sensor script in the door jamb instead of the door and then pass the trigger signal to the door with llSay/llListen on a private channel? You know that the door jamb is centered on the opening, after all. Even better, why not get rid of the llSensorRepeat altogether? You can put a prim across the door's threshold (either an invisible prim or a decorative one) and trigger the door with a collision_start event. That will save you the lag from having a sensor scanning the area every second. ETA: LOL.... What Jesse said.....  Actually I am glad you said that. You are right, instead of using two phantom prims with collision events you can just use one large phantom prim centered on the doors positions. An avatar colliding with either surface will trigger it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-17-2009 11:23
From: Rolig Loon Even better, why not get rid of the llSensorRepeat altogether? You can put a prim across the door's threshold (either an invisible prim or a decorative one) and trigger the door with a collision_start event. That will save you the lag from having a sensor scanning the area every second. Okay...... I *Vaugely* understand that. Looks like this girl as some research to do tonight on this... Thanks for the tips. Klaire
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-17-2009 11:43
From: Klaire Larnia Okay...... I *Vaugely* understand that. Looks like this girl as some research to do tonight on this... Thanks for the tips. Klaire Basically, the idea is that the prim across the threshold contains a script that has a collision_start event like this..... collision_start(integer num_visitors) { llSay(-3456, (string)llDetectedKey(0)); }
and then, in your door script, you write something like ... llListen(-3456,"",NULL_KEY,""); . . listen(integer channel, string name, key id, string message) { string AvName = llKey2Name((key)message); llInstantMessage((key)message, "Thank you for visiting, " + AvName + ". Let me get the door for you."); // And then do the rest of the stuff that opens the door ..... }
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-17-2009 12:15
From: Rolig Loon llListen(-3456,"",NULL_KEY,""  ; this command is giving me a Syntax Error but I am not sure why, as I do not fully understand the command and the LSL Wiki does not make complete sese to me.# Can anyone tell me why I get a syntax error on this? I am on the latest RC version of SL if that makes any difference. Thanks. Klaire
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-17-2009 12:22
From: Klaire Larnia this command is giving me a Syntax Error but I am not sure why, as I do not fully understand the command and the LSL Wiki does not make complete sese to me.# Can anyone tell me why I get a syntax error on this? I am on the latest RC version of SL if that makes any difference. Thanks. Klaire The command itself is fine. I was shorthanding when I wrote it, assuming that you would be putting that listen handle in a state_entry event. If you didn't, then you will get an error. To be complete, the script should look like this ... default { state_entry() { llListen(-3456,"",NULL_KEY,""); //And then any other startup things you want to put in this event } listen(integer channel, string name, key id, string message) { string AvName = llKey2Name((key)message); llInstantMessage((key)message, "Thank you for visiting, " + AvName + ". Let me get the door for you."); // And then do the rest of the stuff that opens the door ..... } }
That should do it. If not, poke me again. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-17-2009 12:32
Thank you.. Sorry. I am have only basic scripting skills and I this is like a crash course to me. I am learning by playing and making a LOT of mistakes along the way.
But that is a good thing as it teaches me a lot at the same time and I will learn more this way. I am sorry be a total pain in the rear but really do appriecate the help.
Hugs, Klaire.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-17-2009 12:47
From: Klaire Larnia Thank you.. Sorry. I am have only basic scripting skills and I this is like a crash course to me. I am learning by playing and making a LOT of mistakes along the way. But that is a good thing as it teaches me a lot at the same time and I will learn more this way. I am sorry be a total pain in the rear but really do appriecate the help. Hugs, Klaire. Hey, trial and error is the absolute best way to learn. If you never fail, you probably aren't pushing the envelope hard enough. Besides, every time I try to answer a question in this forum, I learn a little more myself. We both win. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
05-17-2009 13:06
From: Jesse Barnett It is easier to setup and has less impact on the sim if you use collision_start in two phantom, invisible prims instead of a sensor. Place one on each side of the door. For a door that only opens one way, I just make the door llVolumeDetect(). The worst thing that can happen is the person walks through the phantom door before it opens... and that's rare. I *also* make it open on touch because people expect that.
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-17-2009 13:12
From: Rolig Loon Hey, trial and error is the absolute best way to learn. If you never fail, you probably aren't pushing the envelope hard enough. Besides, every time I try to answer a question in this forum, I learn a little more myself. We both win.  Yes I agree totaly. I think I now grasp the concept of this which is the main thing. I can now try to adapt and work it as I want. I find the way scripts are written a little strange but good examples (like yours) help me out a lot. It makes my understanding a lot clearr so I am very greatfull for it. Klaire.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-17-2009 13:52
From: Argent Stonecutter For a door that only opens one way, I just make the door llVolumeDetect(). The worst thing that can happen is the person walks through the phantom door before it opens... and that's rare. I *also* make it open on touch because people expect that. That's a pretty good one. Even if it doesn't open one way you could use llDetectedPos() (and possibly llDetectedVel() on collision) to try to decide which way to open.
|