Jump to content

Tattooshop

Resident
  • Content Count

    62
  • Joined

  • Last visited

Community Reputation

13 Good

About Tattooshop

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks a lot! Your script is perfect! 😎👍
  2. Hello there! how to make the unpacker not give animations from content? default { touch_start(integer total_number) { integer x; for(x = 0; x < total_number; x++) { if(llDetectedKey(x) == llGetOwner()) { string InvenName; integer InvenNumber = llGetInventoryNumber(INVENTORY_ALL); list InvenList = []; integer y; for(y = 0; y < InvenNumber; y++) { InvenName = llGetInventoryName(INVENTORY_ALL, y); if(InvenName != llGetScriptName()) InvenList += [InvenName]; } llGiveInventoryList(llGetOwner(), llGetObjectName(), InvenList); } } } }
  3. list lButtonNames = ["button1", "button2", "button3", "stop"]; list lAnims = ["anim1", "anim2", "anim3"]; StopAnims() { // list of your animations: llStopAnimation("anim1"); llStopAnimation("anim2"); llStopAnimation("anim3"); } default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { StopAnims(); } } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num) { integer idx = llListFindList(lButtonNames, [llGetLinkName(llDetectedLinkNumber(0))]); if (~idx) // that is, "if idx is a non-negative integer ..." { StopAnims(); // Stop anims regardless of which valid button you clicked if (idx < 3) // that is, "if idx is 0, 1, or 2 ..." { llStartAnimation(llList2String(lAnims, idx)); } } } }
  4. Thank you both a lot! I now have two wonderful working script versions! ❤️ StopAnims() { llStopAnimation("anim1"); llStopAnimation("anim2"); llStopAnimation("anim3"); } default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { StopAnims(); } } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num) { string button = llGetLinkName(llDetectedLinkNumber(0)); { if (button == "button1") { StopAnims(); llStartAnimation("anim1"); } if (button == "button2") { StopAnims(); llStartAnimation("anim2"); } if (button == "button3") { StopAnims(); llStartAnimation("anim3"); } if (button == "stop") { StopAnims(); } } } } string button1 = "button1"; string button2 = "button2"; string button3 = "button3"; string stop = "stop"; StopAnims() { // list of your animations: llStopAnimation("anim1"); llStopAnimation("anim2"); llStopAnimation("anim3"); } default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { StopAnims(); } } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num) { { if (llGetLinkName(llDetectedLinkNumber(0)) == button1) { StopAnims(); llStartAnimation("anim1"); } if (llGetLinkName(llDetectedLinkNumber(0)) == button2) { StopAnims(); llStartAnimation("anim2"); } if (llGetLinkName(llDetectedLinkNumber(0)) == button3) { StopAnims(); llStartAnimation("anim3"); } if (llGetLinkName(llDetectedLinkNumber(0)) == stop) { StopAnims(); } } } }
  5. I took this example from here http://wiki.secondlife.com/wiki/LlGetLinkName and don’t quite understand what this line does for (; i >= 0; --i) and what to do next...
  6. Yes, I just wanted to write about it. avatar reacts strangely to button presses. I added llSay(0, "Touched1") for the test and this is what comes out when any button is pressed [07:18] Object: Touched1 [07:18] Object: Touched2 [07:18] Object: Touched3 string button1 = "button1"; string button2 = "button2"; string button3 = "button3"; string stop = "stop"; StopAnims() { llStopAnimation("anim1"); llStopAnimation("anim2"); llStopAnimation("anim3"); } default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { StopAnims(); } } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num) { integer i = llGetNumberOfPrims(); for (; i >= 0; --i) { if (llGetLinkName(i) == button1) { StopAnims(); llStartAnimation("anim1"); llSay(0, "Touched1"); } if (llGetLinkName(i) == button2) { StopAnims(); llStartAnimation("anim2"); llSay(0, "Touched2"); } if (llGetLinkName(i) == button3) { StopAnims(); llStartAnimation("anim3"); llSay(0, "Touched3"); } if (llGetLinkName(i) == stop) { StopAnims(); } } } }
  7. And yes buttons named button1, etc
  8. Thank you! So i added integer button1 = 5; integer button2 = 4; integer button3 = 3; integer stop = 2; but it says Type mismatch error. Something I am doing wrong. But is it possible to do it without prim numbers at all?
  9. Hello! how to make this script work not from the prim numbers but from the names of the buttons in the hud? (it plays different animations) StopAnims() { llStopAnimation("anim1"); llStopAnimation("anim2"); llStopAnimation("anim3"); } default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { StopAnims(); } } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num) { integer button = llDetectedLinkNumber(0); { if (button == 5) { StopAnims(); llStartAnimation("anim1"); } if (button == 4) { StopAnims(); llStartAnimation("anim2"); } if (button == 3) { StopAnims(); llStartAnimation("anim3"); } if (button == 2) { StopAnims(); } } } } I tried this but it doesn’t work. string button1; string button2; string button3; string stop; StopAnims() { llStopAnimation("anim1"); llStopAnimation("anim2"); llStopAnimation("anim3"); } default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { StopAnims(); } } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num) { integer i = llGetNumberOfPrims(); for (; i >= 0; --i) { if (llGetLinkName(i) == button1) { StopAnims(); llStartAnimation("anim1"); } if (llGetLinkName(i) == button2) { StopAnims(); llStartAnimation("anim2"); } if (llGetLinkName(i) == button3) { StopAnims(); llStartAnimation("anim3"); } if (llGetLinkName(i) == stop) { StopAnims(); } } } }
  10. I got it! no separate buttons check but works! integer iTouched = FALSE; integer toggle; default { touch_start(integer num) { if (!iTouched) { integer button = llDetectedLinkNumber(0); { if (button == 2) { toggle = !toggle; if (toggle) { iTouched = TRUE; llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([ < 0, 0, 1 > , 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_FORWARD]); llSleep(3); iTouched = FALSE; } else { iTouched = TRUE; llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([ < 0, 0, -1 > , 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_FORWARD]); llSleep(3); iTouched = FALSE; } } } } } }
  11. Thank you! 😃 Well, here I made a mistake. After reaching the second floor, you can press up again ... and I do not need this at all!.. there will be only two floors. how to apply toggle here? is it possible? integer iTouched = FALSE; default { touch_start(integer num) { if (!iTouched) { integer button = llDetectedLinkNumber(0); { if (button == 2) { iTouched = TRUE; llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([ < 0, 0, 1 > , 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_FORWARD]); llSleep(3); iTouched = FALSE; } else if (button == 3) { iTouched = TRUE; llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([ < 0, 0, -1 >, 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_FORWARD]); llSleep(3); iTouched = FALSE; } } } } }
  12. Hey! making the elevator/lift with llSetKeyframedMotion. but if you press the button while moving, then the distance gets borkened. how to "disble buttons" while the elevator is moving? And yet, how to make it work for non-mesh objects linksets? default { touch_start(integer num) { integer button = llDetectedLinkNumber(0); { if (button == 2) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([ < 0, 0, 0 > , 3, < 0, 0, 0.5 > , 3, < 0, 0, 1 > , 3, < 0, 0, 1.5 > , 3, < 0, 0, 2 > , 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_FORWARD]); } else if (button == 3) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([ < 0, 0, 0 > , 3, < 0, 0, -0.5 > , 3, < 0, 0, -1 > , 3, < 0, 0, -1.5 > , 3, < 0, 0, -2 > , 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_FORWARD]); } } } }
  13. I click on an object and a menu appears. I click on the button, an action occurs, but the menu no longer appears and I have to click on the object again. How to make the menu not disappear after selecting the button?
×
×
  • Create New...