These forums are CLOSED. Please visit the new forums HERE
Greeter with sound? |
|
Candy Lisle
No one special just...
![]() Join date: 26 Feb 2007
Posts: 110
|
01-17-2010 21:20
I have had a custom sound created that greets people. How can i have this be triggered when people come close to a prim and play this sound?
_____________________
![]() http://slurl.com/secondlife/Oasis%20Dreams/164/224/28 |
Void Singer
Int vSelf = Sing(void);
![]() Join date: 24 Sep 2005
Posts: 6,973
|
01-17-2010 21:50
you want that to be every time, or just if it hasn't greeted that person recently (les spam, although since it's a sound everyone in range will be spammed with the sound anyway)
every time is fairly easy, just use llSensorRepeat, and llTriggerSound, although this will keep going till they leave the scan area. to stop it from doing that, you'll need to store the name or key of the detected avatars, and only trigger when you find someone new. there's an example of how that might work @ https://wiki.secondlife.com/wiki/User:Void_Singer/Programs#v7-D_Advanced_Visitor_Greeter although you'd need to incorprate the sound by the llInstantMessage line _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
Candy Lisle
No one special just...
![]() Join date: 26 Feb 2007
Posts: 110
|
01-18-2010 05:05
you want that to be every time, or just if it hasn't greeted that person recently (les spam, although since it's a sound everyone in range will be spammed with the sound anyway) every time is fairly easy, just use llSensorRepeat, and llTriggerSound, although this will keep going till they leave the scan area. to stop it from doing that, you'll need to store the name or key of the detected avatars, and only trigger when you find someone new. there's an example of how that might work @ https://wiki.secondlife.com/wiki/User:Void_Singer/Programs#v7-D_Advanced_Visitor_Greeter although you'd need to incorprate the sound by the llInstantMessage line I would like to have something that just simply plays the sound every time. I'm pretty lost with that script figuring out what to do. _____________________
![]() http://slurl.com/secondlife/Oasis%20Dreams/164/224/28 |
Void Singer
Int vSelf = Sing(void);
![]() Join date: 24 Sep 2005
Posts: 6,973
|
01-18-2010 05:37
k, here's links to the pages for the functions you need.
https://wiki.secondlife.com/wiki/LlSensorRepeat https://wiki.secondlife.com/wiki/State_entry https://wiki.secondlife.com/wiki/LlTriggerSound https://wiki.secondlife.com/wiki/Sensor place llSensorRepeat in state_entry, and llTriggerSound in sensor, all of that goes in the default state, and done. the repeat seconds should be slightly longer than the sound takes to play (it won't trigger overlaps) _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-18-2010 06:41
You might find it just as easy, and less continuous wear and tear on the sim, to trigger your greeter by collision instead of running a sensor all the time. Put llVolumeDetect(TRUE) in your state_entry event and then put the llPlaySound and other greeting messages in a collision_start event. Put the script in an invisible prim that people are likely to bump into, and it will do the job for you. Here's a greeter/counter I've been using recently. See it in action at http://slurl.com/secondlife/Info%20Island/125/109/34 .
CODE
_____________________
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 |