removed useless _ folders
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<Solution name="Sequential_or_Random_Dance">
|
||||
<Project name="Sequential_or_Random_Dance" path="Sequential_or_Random_Dance\Sequential_or_Random_Dance.prj" active="true"/>
|
||||
</Solution>
|
||||
@@ -0,0 +1,156 @@
|
||||
// :CATEGORY:Animation
|
||||
// :NAME:Sequential_or_Random_Dance
|
||||
// :AUTHOR:Anonymous
|
||||
// :CREATED:2010-01-10 05:20:56.000
|
||||
// :EDITED:2013-09-18 15:39:02
|
||||
// :ID:740
|
||||
// :NUM:1023
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// Dance.lsl was totally re-written by Ferd Frederis. This is Open Source, do with as you wish.
|
||||
// :CODE:
|
||||
|
||||
|
||||
// Dance.lsl was totally re-written by Ferd Frederis. This is Open Source, do with as you wish.
|
||||
|
||||
|
||||
|
||||
// plays a random bunch of animations that are located in the prim inventory when it is attached or rezzed.
|
||||
|
||||
|
||||
|
||||
integer INTERVAL = 30; // how many seconds to play each dance, randomly
|
||||
|
||||
|
||||
|
||||
// just some constants, nothing here. Move on.
|
||||
|
||||
|
||||
|
||||
list dances;
|
||||
|
||||
integer WHICH; // which dance
|
||||
|
||||
integer TOTAL; // how many dances
|
||||
|
||||
integer PERMS; // current permissions
|
||||
|
||||
integer STATE; // off if flase, 1 = next dance, 2 = random
|
||||
|
||||
integer listener; // the current listener, so we can remove it.
|
||||
|
||||
integer counter; // counter for timer to auto stop listeners;
|
||||
|
||||
|
||||
|
||||
// pop up a dialog boz
|
||||
|
||||
|
||||
|
||||
dialog()
|
||||
|
||||
{
|
||||
|
||||
llListenRemove(listener);
|
||||
|
||||
integer channel = llCeil(llFrand(1000)+100 * -1);
|
||||
|
||||
listener = llListen(channel,"","","");
|
||||
|
||||
llDialog(llGetOwner(),"Choose",["Next Dance","Stop Dance","Random"], channel);
|
||||
|
||||
}
|
||||
|
||||
default
|
||||
|
||||
{
|
||||
|
||||
state_entry()
|
||||
|
||||
{
|
||||
|
||||
// load up the current animation inventory into a list
|
||||
|
||||
integer i;
|
||||
|
||||
integer j = llGetInventoryNumber(INVENTORY_ANIMATION);
|
||||
|
||||
for (i = 0; i < j; i++)
|
||||
|
||||
{
|
||||
|
||||
dances += llGetInventoryName(INVENTORY_ANIMATION,i); // add to a list
|
||||
|
||||
TOTAL++;
|
||||
|
||||
}
|
||||
|
||||
STATE = 1; // dance sequentially
|
||||
|
||||
|
||||
|
||||
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); dialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// was rezzed or attached, start over
|
||||
|
||||
on_rez(integer param)
|
||||
|
||||
{
|
||||
|
||||
llResetScript();
|
||||
|
||||
}
|
||||
|
||||
// someone added or deleted an animation. Start over and make a new list
|
||||
|
||||
changed(integer what)
|
||||
|
||||
{
|
||||
|
||||
if (what & CHANGED_INVENTORY)
|
||||
|
||||
llResetScript();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
timer()
|
||||
|
||||
{
|
||||
|
||||
// since they may hit ignore on the dialog, we count two passes at the timer, then kidll off any listener.
|
||||
|
||||
if (listener)
|
||||
|
||||
counter++;
|
||||
|
||||
if (counter)
|
||||
|
||||
llListenRemove (listener); // remove the listener after two passes to help with lag
|
||||
|
||||
|
||||
|
||||
// now lets see what to do
|
||||
|
||||
PERMS = llGetPermissions();
|
||||
|
||||
if (PERMS & PERMISSION_TRIGGER_ANIMATION)
|
||||
|
||||
{
|
||||
|
||||
if (STATE == 1) // sequential play
|
||||
|
||||
{
|
||||
|
||||
llStopAnimation(llList2String(dances, WHICH)); // quit the current
|
||||
|
||||
WHICH++;
|
||||
|
||||
if (WHICH >= TOTAL)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<Project name="Sequential_or_Random_Dance" guid="D7054EEE-6C00-1014-B904-200204C60A89">
|
||||
<Object name="Object" guid="D7054FBC-6C00-1014-B904-200204C60A89">
|
||||
<Script name="Sequential_or_Random_Dance_1.lsl" guid="D7057821-6C00-1014-B904-200204C60A89">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user