Jump to content

sndbad Ghost

Resident
  • Posts

    60
  • Joined

  • Last visited

Everything posted by sndbad Ghost

  1. oh thank you :smileysurprised::smileyhappy::smileyvery-happy::smileysad::smileymad:
  2. hello is there any way to play sound when i use it with HUD without slave script i make sample script HUD play sound float VOLUME = 1.0; default { state_entry() { // llSay(0, "Script running"); } touch_start(integer total_number) { // llSay(0, "Touched."); llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0),VOLUME); } }its work with me only ( locally ) not work in world again i use it HUD
  3. thank you for help eveything is ok now...
  4. :matte-motes-stress: OK next time i ask about my script only and i fix my problem . thank you
  5. ok i have this script now its work fine with next button i add back button but not work orginal script ////////////////////////////////////////////////////////////////////////////////////////////////////// Dance HUD script by Dave Bellman ////// Script loosly based on:// // Animation Stand (Stand Script)// by Teddy Wishbringer// // Thanks go to Argent Stonecutter for assistance in streamlining and bug squishing. //// This script is given away free of charge with full permissions. // This is the case with the redistribution of both free and pay for items. // If you re-use this script, please distribute it with full permissions and keep this notice// // // Updated to version 2 during August 2009 - Dave Bellman// Updated to version 2.1 September 2009. Very occasional bug found// Bug: The timing dialog occasionally fails to appear.// Cause: Using the same chat channel for the main and timing dialogs. // Fix: Added separate chat channels, listeners and listen handles for each dialog.//// // updated to version 2.2 by Quintessa Naire November 5, 2009. Bug: The timing function failed to work even occasionally. Cause: syntax error Fix: added in a space where needed//////updated to version 2.3 by Quintessa Naire November 7, 2009. Bug: The timing function failed to work after relogging. Cause: not resetting. Fix: Added reset on rez.// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Variables//integer time_between_changes = 30;// value in secondsinteger verbose = TRUE;// Send owner status messages toggleinteger ON = TRUE; // Main On Off togglevector on_colour = <1,1,1>;// colour of button tint when on (white)vector off_colour = <1,0.4,0.4>;// colour of button tint when off (red) integer animation_qty; // Number of animations availableinteger animation_current; // Inventory number of current animationstring animation_name = "just started"; // Name of current animationkey avatar = NULL_KEY; // Key of the avatar who's wearing the HUDlist buttons_main = ["Messages", "Landmark", "Instructions", "Stop", "Timing"]; // List of the buttons for the main dialoglist buttons_time = ["Never", "2 hours", "1 hour", "3 minutes", "2 minutes", "1 minute", "30 seconds", "20 seconds", "10 seconds"]; // List of the buttons for the timing dialoginteger main_dialog_chat_channel = -67854; // Chat channel used by the main dialoginteger timing_dialog_chat_channel = -67853; // Chat channel used by the timing dialogstring spacer = " ";//put dialog messages on the second lineinteger listen_handle_main; // We need to remove the listener when we have an owner changeinteger listen_handle_messages; // same for the messages chat channel////////////////////////////////////////////////////////////////////////////////////////////////////// Functions// update(){ // work out how many animations we have now animation_qty = llGetInventoryNumber(INVENTORY_ANIMATION); if (animation_qty > 0) { if(verbose) { llOwnerSay("I have " + (string)animation_qty+" dances"); if(time_between_changes>3599) { integer time = time_between_changes/3600; if(time==1) llOwnerSay("I'll change dance once an hour"); else llOwnerSay("I'll change dance every "+(string)time+" hours"); return; } if(time_between_changes>59) { integer time = time_between_changes/60; if(time==1) llOwnerSay("I'll change dance once a minute"); else llOwnerSay("I'll change dance every "+(string)time+" minutes"); return; } if(time_between_changes==0) { llOwnerSay("I'll let you decide when to change dance"); return; } integer time = time_between_changes; llOwnerSay("I'll change dance every "+(string)time+" seconds"); } if(ON) llSetTimerEvent((float)time_between_changes); animation_name = "just started"; animation_current = 0; if(ON) set_anim(animation_current); } else llOwnerSay("I have no dances. Please put some dances in me.");} // Set the next animation available as the active oneset_anim(integer inventory_number){ // Get the name of the animation is inventory position (inventory_number) string new_animation_name = llGetInventoryName(INVENTORY_ANIMATION,inventory_number); if (avatar != NULL_KEY) { if(animation_name!="just started") llStopAnimation(animation_name); // Stop current animation llStartAnimation(new_animation_name); // Start next animation } // Set the new animation name as the current animation_name = new_animation_name; } turn_on(){ ON = TRUE; if(animation_qty>0) { animation_name = "just started"; set_anim(animation_current); llSetTimerEvent(time_between_changes); } else { llOwnerSay("I have no dances. Please put some dances in me."); } llSetColor(on_colour, ALL_SIDES); }turn_off(){ ON = FALSE; llStopAnimation(animation_name); llSetTimerEvent(0);// save those mS! llSetColor(off_colour, ALL_SIDES); }////////////////////////////////////////////////////////////////////////////////////////////////////// Main body// default{ state_entry() { // ask for permission to animate (only if HUD has been attached) if(llGetAttached()>0) { avatar = llGetOwner(); llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); listen_handle_main = llListen(main_dialog_chat_channel, "", llGetOwner(), ""); listen_handle_messages = llListen(timing_dialog_chat_channel, "", llGetOwner(), ""); } if(ON) llSetColor(on_colour, ALL_SIDES); else llSetColor(off_colour, ALL_SIDES); } on_rez(integer rez) { llResetScript(); } attach(key id) { if(id==NULL_KEY)// i.e. is detaching { if(animation_name!="just started") llStopAnimation(animation_name); // Stop current animation } else { // store wearer UUID, ask for permission to animate avatar = id; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } } // If touched, detect touch location and do what's required touch_start(integer num) { // Get the name of the prim touched string prim_touched = llGetLinkName(llDetectedLinkNumber(0)); if ((prim_touched == "next")&&ON) // The next button was pressed { // If the HUD has no dances, we can't do much if(animation_qty==0) { llOwnerSay("I can't change to the next dance, as I have no dances. Please put some dances in me."); return; } else { animation_current++; // Increment the animation inventory pointer if ((animation_current + 1) > animation_qty) // Have we reached the last animation in the object? { animation_current = 0; // We have, so wrap around back to the first one } set_anim(animation_current); llSetTimerEvent((float)time_between_changes); if(verbose) llOwnerSay("The current dance is now "+animation_name); return; } } else if ((prim_touched == "menu")&&ON)// The main button was pressed { // Bring up the main menu llDialog(avatar, spacer+spacer+"Animazoo Dance HUD configuration", buttons_main, main_dialog_chat_channel); return; } else { if(ON) { turn_off(); return; } else { turn_on(); return; } } } timer() { if(avatar) { // increment the animation count and set the new animation animation_current++; if ((animation_current + 1) > animation_qty) animation_current = 0; set_anim(animation_current); } } changed(integer change) { // if animations are added or taken from inventory we need to update if (change & CHANGED_INVENTORY) update(); // if we have a new owner, release the listener and reset everything if(change & CHANGED_OWNER) { llOwnerSay("Ah! a new owner - hello! Please wait a moment whilst I reset..."); llListenRemove(listen_handle_main); llListenRemove(listen_handle_messages); llResetScript(); } } run_time_permissions(integer perm) { // Permissions are automatic when the object wearer is the owner if (perm & PERMISSION_TRIGGER_ANIMATION) update(); } listen(integer channel, string name, key id, string message) { // Dialog commands if(channel == main_dialog_chat_channel) { // Toggle owner messages if(message=="Messages") { if(verbose) { verbose = FALSE; llOwnerSay("I will stop sending you status messages"); } else { verbose = TRUE; llOwnerSay("I will send you status messages from now on"); } return; } // Stop dancing (works the same as turning off) if(message=="Stop") { turn_off(); return; } // Give the user a copy of the instructions notecard if(message=="Instructions") { llGiveInventory(avatar, "Animazoo dance HUD instructions v2.0"); return; } // Give the user a landmark to the main store if(message=="Landmark") { llGiveInventory(avatar, "Animazoo Brighton, Brightown (221, 69, 30)"); if(verbose) llOwnerSay("Visit Animazoo for more dances!"); return; } // Show dialog giving option to change how often the dance changes if(message=="Timing") { llDialog(avatar, spacer+spacer+"How often do you want the dance to change?", buttons_time, timing_dialog_chat_channel); return; } } if(channel == timing_dialog_chat_channel) { // Dialog messages from timing dialog. Sets the time between dance changes if(message=="Never") time_between_changes = 0; if(message=="2 hours") time_between_changes = 7200; if(message=="1 hour") time_between_changes = 3600; if(message=="3 minutes") time_between_changes = 180; if(message=="2 minutes") time_between_changes = 120; if(message=="1 minute") time_between_changes = 60; if(message=="30 seconds") time_between_changes = 30; if(message=="20 seconds") time_between_changes = 20; if(message=="10 seconds") time_between_changes = 10; llSetTimerEvent((float) time_between_changes); if(verbose) { if(time_between_changes>3599) { integer time = time_between_changes/3600; if(time==1) llOwnerSay("I'll now change dance once an hour"); else llOwnerSay("I'll now change dance every "+(string)time+" hours"); return; } if(time_between_changes>59) { integer time = time_between_changes/60; if(time==1) llOwnerSay("I'll now change dance once a minute"); else llOwnerSay("I'll now change dance every "+(string)time+" minutes"); return; } if(time_between_changes==0) { llOwnerSay("I'll let you decide when to change dance from now on"); return; } integer time = time_between_changes; llOwnerSay("I'll now change dance every "+(string)time+" seconds"); return; } } }} new edit line 214 ////////////////////////////////////////////////////////////////////////////////////////////////////// Dance HUD script by Dave Bellman ////// Script loosly based on:// // Animation Stand (Stand Script)// by Teddy Wishbringer// // Thanks go to Argent Stonecutter for assistance in streamlining and bug squishing. //// This script is given away free of charge with full permissions. // This is the case with the redistribution of both free and pay for items. // If you re-use this script, please distribute it with full permissions and keep this notice// // // Updated to version 2 during August 2009 - Dave Bellman// Updated to version 2.1 September 2009. Very occasional bug found// Bug: The timing dialog occasionally fails to appear.// Cause: Using the same chat channel for the main and timing dialogs. // Fix: Added separate chat channels, listeners and listen handles for each dialog.//// // updated to version 2.2 by Quintessa Naire November 5, 2009. Bug: The timing function failed to work even occasionally. Cause: syntax error Fix: added in a space where needed//////updated to version 2.3 by Quintessa Naire November 7, 2009. Bug: The timing function failed to work after relogging. Cause: not resetting. Fix: Added reset on rez.// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Variables//integer time_between_changes = 30000;// value in secondsinteger verbose = TRUE;// Send owner status messages toggleinteger ON = TRUE; // Main On Off togglevector on_colour = <1,1,1>;// colour of button tint when on (white)vector off_colour = <1,0.4,0.4>;// colour of button tint when off (red) integer animation_qty; // Number of animations availableinteger animation_current; // Inventory number of current animationstring animation_name = "just started"; // Name of current animationkey avatar = NULL_KEY; // Key of the avatar who's wearing the HUDlist buttons_main = ["Messages", "Landmark", "Instructions", "Stop", "Timing"]; // List of the buttons for the main dialoglist buttons_time = ["Never", "2 hours", "1 hour", "3 minutes", "2 minutes", "1 minute", "30 seconds", "20 seconds", "10 seconds"]; // List of the buttons for the timing dialoginteger main_dialog_chat_channel = -67854; // Chat channel used by the main dialoginteger timing_dialog_chat_channel = -67853; // Chat channel used by the timing dialogstring spacer = " ";//put dialog messages on the second lineinteger listen_handle_main; // We need to remove the listener when we have an owner changeinteger listen_handle_messages; // same for the messages chat channel////////////////////////////////////////////////////////////////////////////////////////////////////// Functions// update(){ // work out how many animations we have now animation_qty = llGetInventoryNumber(INVENTORY_ANIMATION); if (animation_qty > 0) { if(verbose) { llOwnerSay("I have " + (string)animation_qty+" dances"); if(time_between_changes>3599) { integer time = time_between_changes/3600; if(time==1) llOwnerSay("I'll change dance once an hour"); else llOwnerSay("I'll change dance every "+(string)time+" hours"); return; } if(time_between_changes>59) { integer time = time_between_changes/60; if(time==1) llOwnerSay("I'll change dance once a minute"); else llOwnerSay("I'll change dance every "+(string)time+" minutes"); return; } if(time_between_changes==0) { llOwnerSay("I'll let you decide when to change dance"); return; } integer time = time_between_changes; llOwnerSay("I'll change dance every "+(string)time+" seconds"); } if(ON) llSetTimerEvent((float)time_between_changes); animation_name = "just started"; animation_current = 0; if(ON) set_anim(animation_current); } else llOwnerSay("I have no dances. Please put some dances in me.");} // Set the next animation available as the active oneset_anim(integer inventory_number){ // Get the name of the animation is inventory position (inventory_number) string new_animation_name = llGetInventoryName(INVENTORY_ANIMATION,inventory_number); if (avatar != NULL_KEY) { if(animation_name!="just started") llStopAnimation(animation_name); // Stop current animation llStartAnimation(new_animation_name); // Start next animation } // Set the new animation name as the current animation_name = new_animation_name; } turn_on(){ ON = TRUE; if(animation_qty>0) { animation_name = "just started"; set_anim(animation_current); llSetTimerEvent(time_between_changes); } else { llOwnerSay("I have no dances. Please put some dances in me."); } llSetColor(on_colour, ALL_SIDES); }turn_off(){ ON = FALSE; llStopAnimation(animation_name); llSetTimerEvent(0);// save those mS! llSetColor(off_colour, ALL_SIDES); }////////////////////////////////////////////////////////////////////////////////////////////////////// Main body// default{ state_entry() { // ask for permission to animate (only if HUD has been attached) if(llGetAttached()>0) { avatar = llGetOwner(); llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); listen_handle_main = llListen(main_dialog_chat_channel, "", llGetOwner(), ""); listen_handle_messages = llListen(timing_dialog_chat_channel, "", llGetOwner(), ""); } if(ON) llSetColor(on_colour, ALL_SIDES); else llSetColor(off_colour, ALL_SIDES); } on_rez(integer rez) { llResetScript(); } attach(key id) { if(id==NULL_KEY)// i.e. is detaching { if(animation_name!="just started") llStopAnimation(animation_name); // Stop current animation } else { // store wearer UUID, ask for permission to animate avatar = id; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } } // If touched, detect touch location and do what's required touch_start(integer num) { // Get the name of the prim touched string prim_touched = llGetLinkName(llDetectedLinkNumber(0)); if ((prim_touched == "next")&&ON) // The next button was pressed { // If the HUD has no dances, we can't do much if(animation_qty==0) { llOwnerSay("I can't change to the next dance, as I have no dances. Please put some dances in me."); return; } else { animation_current++; // Increment the animation inventory pointer if ((animation_current + 1) > animation_qty) // Have we reached the last animation in the object? { animation_current = 0; // We have, so wrap around back to the first one } set_anim(animation_current); llSetTimerEvent((float)time_between_changes); if(verbose) llOwnerSay("The current dance is now "+animation_name); return; } } if ((prim_touched == "back")&&ON) // The next button was pressed { // If the HUD has no dances, we can't do much if(animation_qty == 0) { llOwnerSay("I can't change to the next dance, as I have no dances. Please put some dances in me."); return; } else { animation_current++; // Increment the animation inventory pointer if ((animation_current - 1) > animation_qty) // Have we reached the last animation in the object? { animation_current = 0; // We have, so wrap around back to the first one } set_anim(animation_current); llSetTimerEvent((float)time_between_changes); if(verbose) llOwnerSay("The current dance is now "+animation_name); return; } } else if ((prim_touched == "menu")&&ON)// The main button was pressed { // Bring up the main menu llDialog(avatar, spacer+spacer+"Animazoo Dance HUD configuration", buttons_main, main_dialog_chat_channel); return; } else { if(ON) { turn_off(); return; } else { turn_on(); return; } } } timer() { if(avatar) { // increment the animation count and set the new animation animation_current++; if ((animation_current + 1) > animation_qty) animation_current = 0; set_anim(animation_current); } } changed(integer change) { // if animations are added or taken from inventory we need to update if (change & CHANGED_INVENTORY) update(); // if we have a new owner, release the listener and reset everything if(change & CHANGED_OWNER) { llOwnerSay("Ah! a new owner - hello! Please wait a moment whilst I reset..."); llListenRemove(listen_handle_main); llListenRemove(listen_handle_messages); llResetScript(); } } run_time_permissions(integer perm) { // Permissions are automatic when the object wearer is the owner if (perm & PERMISSION_TRIGGER_ANIMATION) update(); } listen(integer channel, string name, key id, string message) { // Dialog commands if(channel == main_dialog_chat_channel) { // Toggle owner messages if(message=="Messages") { if(verbose) { verbose = FALSE; llOwnerSay("I will stop sending you status messages"); } else { verbose = TRUE; llOwnerSay("I will send you status messages from now on"); } return; } // Stop dancing (works the same as turning off) if(message=="Stop") { turn_off(); return; } // Give the user a copy of the instructions notecard if(message=="Instructions") { llGiveInventory(avatar, "Animazoo dance HUD instructions v2.0"); return; } // Give the user a landmark to the main store if(message=="Landmark") { llGiveInventory(avatar, "Animazoo Brighton, Brightown (221, 69, 30)"); if(verbose) llOwnerSay("Visit Animazoo for more dances!"); return; } // Show dialog giving option to change how often the dance changes if(message=="Timing") { llDialog(avatar, spacer+spacer+"How often do you want the dance to change?", buttons_time, timing_dialog_chat_channel); return; } } if(channel == timing_dialog_chat_channel) { // Dialog messages from timing dialog. Sets the time between dance changes if(message=="Never") time_between_changes = 0; if(message=="2 hours") time_between_changes = 7200; if(message=="1 hour") time_between_changes = 3600; if(message=="3 minutes") time_between_changes = 180; if(message=="2 minutes") time_between_changes = 120; if(message=="1 minute") time_between_changes = 60; if(message=="30 seconds") time_between_changes = 30; if(message=="20 seconds") time_between_changes = 20; if(message=="10 seconds") time_between_changes = 10; llSetTimerEvent((float) time_between_changes); if(verbose) { if(time_between_changes>3599) { integer time = time_between_changes/3600; if(time==1) llOwnerSay("I'll now change dance once an hour"); else llOwnerSay("I'll now change dance every "+(string)time+" hours"); return; } if(time_between_changes>59) { integer time = time_between_changes/60; if(time==1) llOwnerSay("I'll now change dance once a minute"); else llOwnerSay("I'll now change dance every "+(string)time+" minutes"); return; } if(time_between_changes==0) { llOwnerSay("I'll let you decide when to change dance from now on"); return; } integer time = time_between_changes; llOwnerSay("I'll now change dance every "+(string)time+" seconds"); return; } } }}
  6. :matte-motes-smitten: thank you for reply me ok i try now what i do lol i dont know how to start
  7. hello guys i want make HUD animation player simply two buttons next and back animation from inventory thanks
×
×
  • Create New...