=[*.*]= Noob Question Coming Your Way =[*.*]=
|
|
Gaybot Foxley
Input Collector
Join date: 15 Nov 2006
Posts: 584
|
01-26-2007 09:46
Hey peeps, I am trying to make a doorbell. I need a script that will play a sound when a prim is clicked on/touched. I did a search here for it but couldn't find it probably because I am ignorant of the correct terminology. I already know how to make the prim say something in chat when clicked on/touched. Any assistance would be greatly appreciated. Thanks. 
|
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
01-26-2007 10:49
// Name of sound to play string sound_name = "doorbell";
default {
touch_start(integer total_num) { llPlaySound(sound_name,0.5); }
}
place this script, and the doorbell sound named "doorbell" into a prim, and there you go. This is the most basic implementation. The 0.5 is the volume, feel free to adjust to your preference.
|
|
Gaybot Foxley
Input Collector
Join date: 15 Nov 2006
Posts: 584
|
01-26-2007 12:15
Thank you so much!!
|
|
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
|
03-08-2008 19:37
From: Darien Caldwell // Name of sound to play string sound_name = "doorbell";
default {
touch_start(integer total_num) { llPlaySound(sound_name,0.5); }
}
place this script, and the doorbell sound named "doorbell" into a prim, and there you go. This is the most basic implementation. The 0.5 is the volume, feel free to adjust to your preference. Okay, sorry for reviving an old, old thread, but if I use this script, where do I get the doorbell sound? Thanks! --Avion
|
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
03-09-2008 01:03
From: Avion Raymaker Okay, sorry for reviving an old, old thread, but if I use this script, where do I get the doorbell sound? Thanks! --Avion Just sent you the big box of free sounds. You want doorbell_002, probably. .
|
|
fetalharvest Triskaidekaphobia
Registered User
Join date: 31 Jan 2007
Posts: 12
|
03-09-2008 19:01
if u looking for anything diffrent sound wise..... im me inworld and ill help u out  ~fetal
|
|
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
|
03-10-2008 14:50
Thanks Nika and Fetal -- very helpful. The script and the sounds works great.
One more question. I looked for this everywhere: I just want a script that when you touch the prim, it says in chat: "Avion Raymaker is at the door." (or whoever it is).
With my limited abilities, I was able to get it to say "You have a visitor" or something generically lame, but I'd like for it to announce the actual visitor. Is there a simple script for that, or is it a closely guarded secret?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-10-2008 17:47
default{ touch_start( integer vIntTouched ){ llPlaySound(sound_name,0.5); do{ llOwnerSay( llDetectedName( --vIntTouched ) + ", is at the door" ); }while (vIntTouched); } }
which is the faster (and less memory) than, but does basiclly the same thing as default{ touch_start( integer vIntTouched ) { llPlaySound(sound_name,0.5); integer vIntCounter; for (vIntCounter = 0; vIntCounter < vIntTouched; vIntCounter = vIntCounter + 1 ) { llOwnerSay( llDetectedName( vIntCounter ) + ", is at the door" ); } } }
except the first example will give simultaneous touchers in reverse order (but being simultaneous it's really not noticeable)
_____________________
| | . "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... | - 
|
|
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
|
03-11-2008 11:21
From: Void Singer default{ touch_start( integer vIntTouched ){ llPlaySound(sound_name,0.5); do{ llOwnerSay( llDetectedName( --vIntTouched ) + ", is at the door" ); }while (vIntTouched); } }
which is the faster (and less memory) than, but does basiclly the same thing as default{ touch_start( integer vIntTouched ) { llPlaySound(sound_name,0.5); integer vIntCounter; for (vIntCounter = 0; vIntCounter < vIntTouched; vIntCounter = vIntCounter + 1 ) { llOwnerSay( llDetectedName( vIntCounter ) + ", is at the door" ); } } }
except the first example will give simultaneous touchers in reverse order (but being simultaneous it's really not noticeable) Void, that was extremely helpful. I used the first one, and modified it slightly so that it's in open chat. It works perfectly! Thanks for everyone's help. I used this to integrate my house numbers and doorbells into 1 prim for each penthouse in the new City of Liome.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-11-2008 20:19
default{ touch_start( integer vIntTouched ){ llPlaySound(sound_name,0.5); @Loop; llOwnerSay( llDetectedName( --vIntTouched ) + ", is at the door" ); if (vIntTouched) jump Loop; } }
is even faster, but I hesitated to add it because misuse of jumps in other ways can make code hard to understand, and instigate some bad habits that can actually reduce effeciency
_____________________
| | . "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... | - 
|