Jump to content

Need script


calvinmayers
 Share

You are about to reply to a thread that has been inactive for 4027 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

im looking for a script that can play as many gestures as i need it to and wait till the 1 gesture is over and then start the next. im making a full dancer so it cant be skippy. also want it to do a dance at the same time if its possiable. or mayby help to try and fix a script that a friend gave me that just wont play the animation

Link to comment
Share on other sites

There is no way to play gestures from within scripts. Further, there is no way to tell when a gesture has ended. Further further, 'skippy' will occur in every implementation of stringing multiple sounds together; it occurs by design of the SL platform (and is caused by lag on the client, not from the script).

The forum you are looking for is here. LSL Scripting is for script help and support.

Link to comment
Share on other sites

well the way this script my friend gaeve me is set up it reads what is in the prim say the gestures/animations and it will start the frist gesture wait a certain time and then start the next gesture. but at the same time its supposed to start a animation and i cant figure out how to get rid off a primission error in it

Link to comment
Share on other sites

IIf you're looking for a script, this is the wrong forum. Please use the Wanted forum.

If you don't have permission to view/modify the script you have, there is nothing to be done about it, sorry. Perhaps you could find one you could modify in the Wanted forum.

If you have a question about a script that you can view/modify, please post the code for it so we son't have to guess what you're asking about.

Link to comment
Share on other sites

integer ON = 0; //STATE OF SCRIPT //YOU EDIT THESE PARTS FOR NEW ANIMATIONS, SOUND CLIPS ETC. DO NOT TOUCH THE SCRIPT string animation = "blueberry"; //ANIMATION NAME integer MaxSoundClips = 19; //AMOUNT OF SONG CLIPS, NAME THEM 1,2,3,4,ETC integer SoundLength = 10; //FIRST SERIES OF SOUND LENGTHS integer LastSoundLength = 2; //INCASE LAST SOUND CLIP IS SHORTER integer SoundClipNumber = 0; //FOR SOUND LOOP ResetToDefault() { llStopSound(); llSetTimerEvent(0.00); llStopAnimation(animation); ON = 0; SoundClipNumber = 0; } default { state_entry() { llListen(0, "", "", ""); } attach(key id) { if(id) { llOwnerSay(" Commands 'on' or 'off'"); llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } else ResetToDefault(); } timer() { llPlaySound((string)(++SoundClipNumber),1.0); if(ON == 1){llSetTimerEvent(SoundLength); ON = 2;} if(SoundClipNumber == MaxSoundClips){llSetTimerEvent(LastSoundLength); ON = 1; SoundClipNumber = 0;} llPreloadSound((string)(SoundClipNumber+1)); } listen(integer channel, string name, key id, string message) { message = llToLower(message); if (ON == 0 && message == "on") { ON = 1; llStartAnimation(animation); llSetTimerEvent(0.01); } else if(message == "off"){ResetToDefault();} } } Is the code for it but cant figure out why the animation wont start

Link to comment
Share on other sites

integer ON = 0;                    //STATE OF SCRIPT//YOU EDIT THESE PARTS FOR NEW ANIMATIONS, SOUND CLIPS ETC. DO NOT TOUCH THE SCRIPTstring animation = "blueberry";     //ANIMATION NAMEinteger MaxSoundClips = 19;         //AMOUNT OF SONG CLIPS, NAME THEM 1,2,3,4,ETC integer SoundLength = 10;           //FIRST SERIES OF SOUND LENGTHSinteger LastSoundLength = 2;       //INCASE LAST SOUND CLIP IS SHORTERinteger SoundClipNumber = 0;       //FOR SOUND LOOPResetToDefault(){    llStopSound();    llSetTimerEvent(0.00);    llStopAnimation(animation);    ON = 0;    SoundClipNumber = 0;}    default{    state_entry()    {        llListen(0, "", "", "");    }        attach(key id)    {        if(id)        {            llOwnerSay(" Commands 'on' or 'off'");            llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);        }        else ResetToDefault();    }    timer()    {        llPlaySound((string)(++SoundClipNumber),1.0);        if(ON == 1){llSetTimerEvent(SoundLength); ON = 2;}        if(SoundClipNumber == MaxSoundClips){llSetTimerEvent(LastSoundLength); ON = 1; SoundClipNumber = 0;}        llPreloadSound((string)(SoundClipNumber+1));    }        listen(integer channel, string name, key id, string message)    {        message = llToLower(message);        if (ON == 0 && message == "on")        {            ON = 1;            llStartAnimation(animation);            llSetTimerEvent(0.01);        }        else if(message == "off"){ResetToDefault();}    }}

 

Link to comment
Share on other sites

Okay.

This script plays sounds in order.

At the beginning of the sequence, it will start playing a single animation (named 'blueberry' in your code). Once the number of pre-set sounds (19 sounds, in your code) have finished playing (all being the same length as the first, except the final sound which may be shorter), the animation will stop.

It seems like it will do everything you're asking.

Link to comment
Share on other sites


calvinmayers wrote:

Script trying to trigger animations but PERMISSION_TRIGGER_ANIMATION permission is not set

Save the script, then detach and reattach the object containing the script.

Then 'start' the script using the command 'on' in local chat.

--

llRequestAnimations is only called during the attach event; you will need to trigger this (by attaching the object with the script inside) after resetting the script.

Link to comment
Share on other sites

It will need to obtain PERMISSION_TRIGGER_ANIMATION somehow. This script is designed to be attached.

I will try to walk you through the steps required to change the functionality, but really I cannot test this. An understanding of the LSL commands is highly recommended. Keep a copy of the original to prevent any loss of data.

You can remove the attach and listen events, as well as the llListen(0,"","",""); line in your original script.

You can do this on touch using:

key kGOTPERMS; //Permission holder key. This is a global and should be moved to the top of your scripttouch_start() //This is an event, treated similar to attach(key id){
if(llDetectedKey(0) != kGOTPERMS)
{ llRequestPermissions(llDetectedKey(0),PERMISSION_TRIGGER_ANIMATION);
}
else
{
ResetToDefault(); //Stop animation and sound if clicked a second time.
}}

 You will also need to add a run_time_permissions event, because it's possible that someone could deny a request to animate their avatar (after touching the object).

run_time_permissions(key id, integer perm){    if(perm & PERMISSION_TRIGGER_ANIMATION)
{
kGOTPERMS = id;
ON = 1; //Copied from your listen event (which is now redundant) llStartAnimation(animation); llSetTimerEvent(0.01);
}}

 Apologies for the delay, I am multi-stacking my duties :P

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4027 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...