|
Powerspot Destiny
Registered User
Join date: 2 Nov 2007
Posts: 71
|
08-09-2008 08:56
I bought a variety of full perm sounds for my build.....when I checked them out at the store I typed in chat to get them to work......i was expecting at least instructions on how to do that but only got the sounds with nothing else.......Can anyone give me tips on different ways that my buyers can activate the sounds?.......ultimately i would like a full perm script to allow my customers to pick the sounds they want.....Anyone know where I can get something like this? Thank You
|
|
Bree Giffen
♥♣♦♠ Furrtune Hunter ♠♦♣♥
Join date: 22 Jun 2006
Posts: 2,715
|
08-09-2008 11:55
You can have people play sounds through a gesture. You can create a gesture, insert a sound file, and then sell that gesture to people.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
08-09-2008 16:32
In contrast to Gestures, Scripts don't actually need full-perm sound files. In fact, they don't need files at all, just the UUIDs of the sounds they are to play. There are some subtleties about playing sounds: should they be constrained to a specific area? (llTriggerSoundLimited)... should they move with the scripted object (llPlaySound), or should they continue to be emitted from the location where they were started (llTriggerSound)... should they continue playing (llLoopSound) until told to stop (llStopSound). And then another set of functions for synchronizing multiple sounds. One thing you may have noticed is that sounds (especially long ones) can take a while to download the first time they're played, so you may hear an interval of silence at first. (If you know which sound it will play next, llPreloadSound helps with that problem.) Ignoring all those subtleties, I hacked up this quick script. There are no doubt common scripts around that do this same thing--some of which may have even been tested more than once! float SOUND_VOLUME = 1.0; // From 0.0 to 1.0
list sounds; list soundLabels; integer dialogChannel; integer dialogHandle;
default { state_entry() { integer numSounds = llGetInventoryNumber(INVENTORY_SOUND); if (0 == numSounds) { llSay(DEBUG_CHANNEL, "Please add some sounds to Contents."); return; } if (12 < numSounds) { llSay(DEBUG_CHANNEL, "Only the first 12 sounds will be used because Qie is lazy."); numSounds = 12; } integer soundIdx; for (soundIdx = 0; soundIdx < numSounds; soundIdx += 1) { string soundName = llGetInventoryName(INVENTORY_SOUND, soundIdx); sounds += soundName; soundLabels += llGetSubString(soundName, 0, 23); } dialogChannel = -1000000000 - (integer)llFrand(1000000000.0); } changed(integer change) { if (change & CHANGED_INVENTORY) llResetScript(); } touch_start(integer total_number) { key toucher = llDetectedKey(0); if (! dialogHandle) dialogHandle = llListen(dialogChannel, "", toucher, ""); llDialog(toucher, "Select a sound", soundLabels, dialogChannel); } listen(integer channel, string name, key id, string message) { integer soundIdx = llListFindList(soundLabels, (list)message); llPlaySound(llList2String(sounds, soundIdx), SOUND_VOLUME); } }
(Despite bbcode having been lesioned from these Forums, one can press the Quote button as if to reply, and the quoted code will be properly formated.)
|