Jump to content

Tattooshop

Resident
  • Posts

    365
  • Joined

  • Last visited

Everything posted by Tattooshop

  1. There is a ridiculous problem. I can’t get the grenade script to work from the time of the throw. -- I rez a grenade. -- I put the script there. and the script starts working, the timer starts and I have to very quickly grab the grenade and pick it up in my inventory until it explodes and put it in the Thrower object. But the timer counts down from the moment when I scripted it. And the grenade explodes "ahead of time". How to make the script or timer reset and the countdown start from the moment of the throw?
  2. This way is much better! Thank you! 👍
  3. Thanks a lot! in combination with this grenade thrower script and explosion particles system and sounds, a good grenade was obtained! default { state_entry() { llSetTimerEvent(3); } sensor(integer detected) { while (detected--) { llPushObject(llDetectedKey(detected), 6000.0 * llGetObjectMass(llDetectedKey(detected)) * (llDetectedPos(detected) - llGetPos()), ZERO_VECTOR, FALSE); llSleep(1); llDie(); } } timer() { llSensor("", NULL_KEY, (AGENT | PASSIVE), 5.0, PI); } }
  4. Thanks a lot! I learned a new trick! Now it repels even physical objects of small mass! But as before, it is not possible to make this work for several objects and avatars. What is my mistake? default { touch_start(integer total_number) { llSensor("", NULL_KEY, (AGENT | PASSIVE), 5.0, PI); } sensor(integer detected) { while (detected--) { llPushObject(llDetectedKey(0), 6000.0 * llGetObjectMass(llDetectedKey(0)) * (llDetectedPos(0) - llGetPos()), ZERO_VECTOR, FALSE); } } }
  5. Awesomeness!! works great! but for some reason it repels only one avatar (the one who is closer). But how to make it to repel everyone in the range? default { state_entry() { llSensor("", NULL_KEY, AGENT, 5.0, PI); } sensor(integer detected) { llPushObject(llDetectedKey(0), 6000.0*llGetObjectMass(llDetectedKey(0))*(llDetectedPos(0) - llGetPos()), ZERO_VECTOR, FALSE); } }
  6. Hello! Thank you both very much! :) So now I am trying llPushObject and thats what I got but it says "Type mismatch"... And what is vAvPos here? :D integer vAvPos; default { state_entry() { llSensor("", NULL_KEY, AGENT, 3.0, PI); } sensor(integer detected) { llPushObject(llDetectedKey(0), 6000.0*llGetObjectMass(llDetectedKey(0))*(vAvPos - llGetPos()), ZERO_VECTOR, FALSE); } } Thank you again very much! 💖
  7. Hey. how in theory to simulate a grenade explosion, pushing avatars away in a certain range? I mean pushing itself.
  8. Thats very interesting! Do I understand correctly, it will be something like: float time = llSetTimerEvent(10)/10; if time == 0 do stuff if time == 1 do stuff if time == 5 do stuff if time == 10 do stuff...?
  9. // Rolig's version integer toggle; vector lColor = < 1.0, 1.0, 1.0 > ; default { touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { if (toggle) { toggle = FALSE; llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR , 0.0, 0.0, 1]); } else { toggle = TRUE; llSetTimerEvent(0.1); } } } timer() { llSetTimerEvent(10.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, 0, .1, PRIM_FULLBRIGHT, 0, 1, PRIM_POINT_LIGHT, TRUE, lColor, 1.0, 3.0, 0.2]); llSleep(1); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, 1, .1, PRIM_FULLBRIGHT, 1, 1]); llSleep(5); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0 , 1]); } } // Fenix's Version integer toggle; vector lColor = < 1.0, 1.0, 1.0 > ; lightFunction() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, 0, .1, PRIM_FULLBRIGHT, 0, 1, PRIM_POINT_LIGHT, TRUE, lColor, 1.0, 3.0, 0.2]); llSleep(1); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, 1, .1, PRIM_FULLBRIGHT, 1, 1]); llSleep(5); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 1]); } default { touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { if (toggle) { toggle = FALSE; llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 1]); } else { toggle = TRUE; llSetTimerEvent(10); lightFunction(); } } } timer() { lightFunction(); } } May come in handy to someone
  10. Excellent! Thanks very much both of you! I now have two working versions of the script! 🤎😎👍 Could you please give a hint how to make it also turn off right away?
  11. Hi! Often there is a problem when a script with a timer does not work immediately. you have to wait a few seconds (10 seconds as in this script). how to make it work right away? (I tried to add llSetTimerEvent(0); at the top of timer event but did not work.. integer toggle; vector lColor = < 1.0, 1.0, 1.0 > ; default { touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { if (toggle) { toggle = FALSE; llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 1]); } else { toggle = TRUE; llSetTimerEvent(10); } } } timer() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, 0, .1, PRIM_FULLBRIGHT, 0, 1, PRIM_POINT_LIGHT, TRUE, lColor, 1.0, 3.0, 0.2]); llSleep(1); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, 1, .1, PRIM_FULLBRIGHT, 1, 1]); llSleep(5); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 0.0, 0.0, 1]); } }
  12. Thank you both a lot! It worked! string ConvertWallclockToTime() { integer now = (integer)llGetWallclock(); integer seconds = now % 60; integer minutes = (now / 60) % 60; integer hours = now / 3600; return llGetSubString("0" + (string)hours, -2, -1) + ":" + llGetSubString("0" + (string)minutes, -2, -1) + ":" + llGetSubString("0" + (string)seconds, -2, -1); } default { collision_start(integer num_detected) { llShout(0, llDetectedName(0) + " " + ConvertWallclockToTime()); } }
  13. Thank you! I am making a script for a friend and he wants it to be SLT (actually yeah a bit strange ). Besides, he wants two messages - the swim will be there and back, I think it will be very difficult to arrange and I myself can’t imagine how to do this. I do not want to burden you. Also the problem is that the pool is huge 50 meters in length. Will the second script hear such a message? So I use so far: default { collision(integer num_detected) { llShout(0, llDetectedName(0) + llGetTimestamp()); } } BUT! The script produces too many messages on inaccurate collision. Is it possible to somehow limit one message per avatar? Like there is some kind of filter (llCollisionFilter). But it will probably be difficult, lists again...
  14. It will be something like... Collision llShout(0, llDetectedName(0) + SLT current - this part not very clear); llGetTimestamp()? :)
  15. Hello! I’m trying to make a script for sports swimming in the pool. I think to use an invisible prim at the end of the pool and when avatar comes into contact with the object, it will llShout the name of the avatar and SL time. The pool uses SL water so avatars simply move under water. How to do it better?
  16. Thank you both very much! Now everything works as it should! integer i = 0; integer chat_channel() { return (integer)("0x" + llGetSubString(llMD5String((string) llGetOwner(), 1), 0, 6)) - 479; } integer total_dances = 0; integer dance_number = -1; integer page = 1; integer page_dances = 0; integer dance_starter = 0; list dances_list = []; list dance_buttons = []; string dances_text_list = ""; string exclude_first_page = ""; string exclude_last_page = ""; stopAllDances() { i = 0; while (i < total_dances) { if (llList2String(dances_list, i) != "") { llStopAnimation(llList2String(dances_list, i)); } ++i; } } showMenu(key userTouched, integer page) { if (page > 0) { dance_starter = (page * 9) - 9; } else { dance_starter = 0; } page_dances = 0; dance_buttons = []; dances_text_list = ""; while (page_dances < 9) { if (llList2String(dances_list, dance_starter) != "") { dance_buttons = (dance_buttons = []) + dance_buttons + (string) dance_starter; dances_text_list = (dances_text_list = "") + dances_text_list + (string)(dance_starter) + ") " + llList2String(dances_list, dance_starter) + "\n"; } ++page_dances; ++dance_starter; } if (page == 1) { exclude_first_page = "---"; } else { exclude_first_page = "PAGE " + (string)(page - 1); } if (llGetListLength(dance_buttons) < 9 || (page * 9) >= total_dances) { exclude_last_page = "---"; } else { exclude_last_page = "PAGE " + (string)(page + 1); } dance_buttons = (dance_buttons = []) + "STOP DANCE" + exclude_first_page + exclude_last_page + dance_buttons; llDialog(userTouched, dances_text_list, dance_buttons, chat_channel()); } string stristr(string haystack, string needle, integer after_needle) { if (haystack) { integer pos = llSubStringIndex(haystack, needle); if (~pos) { if (after_needle) return llGetSubString(haystack, pos + llStringLength(needle), -1); return llDeleteSubString(haystack, pos, -1); } } return ""; } integer like(string value, string mask) { integer tmpy = (llGetSubString(mask, 0, 0) == "%") | ((llGetSubString(mask, -1, -1) == "%") << 1); if (tmpy) mask = llDeleteSubString(mask, (tmpy / -2), -(tmpy == 2)); integer tmpx = llSubStringIndex(value, mask); if (~tmpx) { integer diff = llStringLength(value) - llStringLength(mask); return ((!tmpy && !diff) || ((tmpy == 1) && (tmpx == diff)) || ((tmpy == 2) && !tmpx) || (tmpy == 3)); } return FALSE; } default { on_rez(integer start_param) { llResetScript(); } state_entry() { total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); i = 0; while (i < total_dances) { dances_list += [(string) llGetInventoryName(INVENTORY_ANIMATION, i)]; ++i; } llListen(chat_channel(), "", NULL_KEY, ""); } touch_start(integer total_number) { showMenu(llDetectedKey(0), 0); } changed(integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } listen(integer channel, string name, key id, string message) { if (message == "STOP DANCE") { dance_number = -1; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } else if (like(message, "PAGE%")) { showMenu(id, (integer) stristr(message, "PAGE ", TRUE)); } else if (message == "---") { } else { dance_number = (integer) message; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer perms) { if (perms & PERMISSION_TRIGGER_ANIMATION) { stopAllDances(); if (dance_number > -1) { llStartAnimation(llList2String(dances_list, dance_number)); } } } }
  17. Is the problem so serious? I thought there maybe just need to change the one to zero ... unfortunately I am not that good at scripting yet.
  18. I replaced everything that is possible, tried to change ones to zeros, but the script does not respond and after some time gives an error. what am i doing wrong? 🤔 I removed comments lines to make script look shorter integer i = 0; integer chat_channel() { return (integer)("0x" + llGetSubString(llMD5String((string) llGetOwner(), 1), 0, 6)) - 479; } integer total_dances = 0; integer dance_number = -1; integer page = 1; integer page_dances = 0; integer dance_starter = 0; list dances_list = []; list dance_buttons = []; string dances_text_list = ""; string exclude_first_page = ""; string exclude_last_page = ""; stopAllDances() { i = 0; while (i < total_dances) { if (llList2String(dances_list, i) != "") { llStopAnimation(llList2String(dances_list, i)); } ++i; } } showMenu(key userTouched, integer page) { if (page > 0) { dance_starter = (page * 9) - 9; } else { dance_starter = 0; } page_dances = 0; dance_buttons = []; dances_text_list = ""; while (page_dances < 9) { if (llList2String(dances_list, dance_starter) != "") { dance_buttons = (dance_buttons = []) + dance_buttons + (string) dance_starter; dances_text_list = (dances_text_list = "") + dances_text_list + (string)(dance_starter) + ") " + llList2String(dances_list, dance_starter) + "\n"; } ++page_dances; ++dance_starter; } if (page == 1) { exclude_first_page = "---"; } else { exclude_first_page = "PAGE " + (string)(page - 1); } if (llGetListLength(dance_buttons) < 9 || (page * 9) >= total_dances) { exclude_last_page = "---"; } else { exclude_last_page = "PAGE " + (string)(page + 1); } dance_buttons = (dance_buttons = []) + "STOP DANCE" + exclude_first_page + exclude_last_page + dance_buttons; llDialog(userTouched, dances_text_list, dance_buttons, chat_channel()); } string stristr(string haystack, string needle, integer after_needle) { if (haystack) { integer pos = llSubStringIndex(haystack, needle); if (~pos) { if (after_needle) return llGetSubString(haystack, pos + llStringLength(needle), -1); return llDeleteSubString(haystack, pos, -1); } } return ""; } integer like(string value, string mask) { integer tmpy = (llGetSubString(mask, 0, 0) == "%") | ((llGetSubString(mask, -1, -1) == "%") << 1); if (tmpy) mask = llDeleteSubString(mask, (tmpy / -2), -(tmpy == 2)); integer tmpx = llSubStringIndex(value, mask); if (~tmpx) { integer diff = llStringLength(value) - llStringLength(mask); return ((!tmpy && !diff) || ((tmpy == 1) && (tmpx == diff)) || ((tmpy == 2) && !tmpx) || (tmpy == 3)); } return FALSE; } default { on_rez(integer start_param) { llResetScript(); } state_entry() { total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); i = 0; while (i < total_dances) { dances_list += [(string) llGetInventoryName(INVENTORY_ANIMATION, i)]; } llListen(chat_channel(), "", NULL_KEY, ""); } touch_start(integer total_number) { showMenu(llDetectedKey(0), 0); } changed(integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } listen(integer channel, string name, key id, string message) { if (message == "STOP DANCE") { dance_number = -1; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } else if (like(message, "PAGE%")) { showMenu(id, (integer) stristr(message, "PAGE ", TRUE)); } else if (message == "---") { // Do nothing here } else { dance_number = (integer) message; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer perms) { if (perms & PERMISSION_TRIGGER_ANIMATION) { stopAllDances(); if (dance_number > -1) { llStartAnimation(llList2String(dances_list, dance_number)); } } } }
  19. Thank you very much for your answer! So I simply replaced the line, but I did something wrong and it do not respond on click at all state_entry() { total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); i = 0; while(i < total_dances) { dances_list += [(string) llGetInventoryName(INVENTORY_ANIMATION, i)]; } llListen(chat_channel(), "", NULL_KEY, ""); }
  20. Hello! I have a single dance machine animator script, but it works a little incorrectly. when I add the first animation it gives an error "llDialog: must supply a message" if I click it, when I add the second - menu shows only one animation. and so on, one animation is always missing. what's wrong with it? (sorry for the long script) integer i = 0; integer chat_channel() { return (integer)("0x" + llGetSubString(llMD5String((string) llGetOwner(), 1), 0, 6)) - 479; } integer total_dances = 0; integer dance_number = -1; integer page = 1; integer page_dances = 0; integer dance_starter = 0; list dances_list = []; list dance_buttons = []; string dances_text_list = ""; string exclude_first_page = ""; string exclude_last_page = ""; // Stop all dancing animations function, one by one stopAllDances() { i = 0; while (i < total_dances) { if (llList2String(dances_list, i) != "") { llStopAnimation(llList2String(dances_list, i)); } ++i; } } // Build dances list (text for dialog, buttons for options) for user depending on selected page and send it via dialog box // If the page is last or first use "---" instead of button with page number - detect this via counting overall dances list or check if the current dances list is < than 9 showMenu(key userTouched, integer page) { if (page > 1) { dance_starter = (page * 9) - 9; } else { dance_starter = 0; } page_dances = 0; dance_buttons = []; dances_text_list = ""; while (page_dances < 9) { if (llList2String(dances_list, dance_starter) != "") { dance_buttons = (dance_buttons = []) + dance_buttons + (string) dance_starter; dances_text_list = (dances_text_list = "") + dances_text_list + (string)(dance_starter) + ") " + llList2String(dances_list, dance_starter) + "\n"; } ++page_dances; ++dance_starter; } if (page == 1) { exclude_first_page = "---"; } else { exclude_first_page = "PAGE " + (string)(page - 1); } if (llGetListLength(dance_buttons) < 9 || (page * 9) >= total_dances) { exclude_last_page = "---"; } else { exclude_last_page = "PAGE " + (string)(page + 1); } dance_buttons = (dance_buttons = []) + "STOP DANCE" + exclude_first_page + exclude_last_page + dance_buttons; llDialog(userTouched, dances_text_list, dance_buttons, chat_channel()); } // String cutter function string stristr(string haystack, string needle, integer after_needle) { if (haystack) { //we have a haystack, it's not "" //Now find us a needle! integer pos = llSubStringIndex(haystack, needle); if (~pos) { //We have found a needle! if (after_needle) //return what comes after needle return llGetSubString(haystack, pos + llStringLength(needle), -1); return llDeleteSubString(haystack, pos, -1); } } return ""; } // Search for a word in string function integer like(string value, string mask) { integer tmpy = (llGetSubString(mask, 0, 0) == "%") | ((llGetSubString(mask, -1, -1) == "%") << 1); if (tmpy) mask = llDeleteSubString(mask, (tmpy / -2), -(tmpy == 2)); integer tmpx = llSubStringIndex(value, mask); if (~tmpx) { integer diff = llStringLength(value) - llStringLength(mask); return ((!tmpy && !diff) || ((tmpy == 1) && (tmpx == diff)) || ((tmpy == 2) && !tmpx) || (tmpy == 3)); } return FALSE; } // Execute script, main part default { // Reset script at object rezz on_rez(integer start_param) { llResetScript(); } // Crawl through dances and load them all to the list at script start / reset only to save region CPU power // Builded list will be later just called at touch/page reload, not rebuilded like in original work // Start listening to the unique channel for commands state_entry() { total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); i = 0; while (i < total_dances) { dances_list = (dances_list = []) + dances_list + (string) llGetInventoryName(INVENTORY_ANIMATION, ++i); } llListen(chat_channel(), "", NULL_KEY, ""); } // Show menu at touch to the person who touched object, page 1 touch_start(integer total_number) { showMenu(llDetectedKey(0), 1); } // Automatiacally reset whole script if dance was added or removed from object's inventory // So you don't must to use "reset script" in your viewer, when you add something new changed(integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } // Get dance from user interaction and start dance, stop dance or send next page listen(integer channel, string name, key id, string message) { if (message == "STOP DANCE") { dance_number = -1; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } else if (like(message, "PAGE%")) { showMenu(id, (integer) stristr(message, "PAGE ", TRUE)); } else if (message == "---") { // Do nothing here } else { dance_number = (integer) message; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } } // Ask for permissions and change dances // If dance number is under 0, then just stop dancing without calling any new animation run_time_permissions(integer perms) { if (perms & PERMISSION_TRIGGER_ANIMATION) { stopAllDances(); if (dance_number > -1) { llStartAnimation(llList2String(dances_list, dance_number)); } } } }
  21. Yeah, thats the main problem so far... Thanks for answer!
  22. When I see a post like this, I remember a proverb - a monkey that searches for fleas from others is usually the most flea!
  23. Hi! Thank you for answer! Yeah, I think Signature is the best for males for today. But I cant tell it overshadowed or slammed, it shines in all glory! I can only say about the Alice that I tried the demo, it has all the same options as in the male version, the price is acceptable, but really I have not yet seen clothes for it. the omega system certainly works. but walking without clothes is not an option. probably because it’s new. I am waiting for updates, clothes and it would be cool if they finally made arms and legs connected to the body, like Maiteya. Cheers!
  24. Please share your impressions! Is it as good as the male version?
×
×
  • Create New...