Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Preload Gesture Sounds

Jim Bunderfeld
The Coder
Join date: 1 Mar 2004
Posts: 161
06-01-2006 12:34
This script Preloads all the sounds inside the prim, it is meant to be an attachment.
To preload the sounds just type /13 preload
CODE

// This script is meant to be worn as an attachment
// Either, insert all of the gesture sounds you use on a regular basis,
// then the script, and then Reset after inserting the script.
//*OR* Put the script in first and then the sounds, slowly so that it
// has time to execute build_list
// Scripted by: Jim Bunderfeld
// Released for the Second Life Community
// Use this script as you want OPEN SOURCE
// Thank you :-)
//
build_list(list sounds)
{
sounds = [];
integer num = llGetInventoryNumber(INVENTORY_SOUND);
integer i;
for(i = 0;i < num;i++)
{
sounds = sounds + [ llGetInventoryName(INVENTORY_SOUND,i)];
//llSay(0,llGetInventoryName(INVENTORY_SOUND,i));
}

}
list soundlist;
list keys;

default
{
state_entry()
{
build_list(soundlist);
llListen(13,"",llGetOwner(),"preload");
}
changed(integer change)
{
if(change == CHANGED_INVENTORY)
{
build_list(soundlist);
}
}

listen(integer c,string n,key i,string m)
{
integer listlength = llGetListLength(soundlist);
integer i;
for(i = 0;i <= listlength;i++)
{
string sound = llList2String(soundlist,i);
llPreloadSound(sound);

}
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
06-02-2006 06:51
/54/15/111177/1.html
_____________________
i've got nothing. ;)