Jump to content

Tattooshop

Resident
  • Posts

    365
  • Joined

  • Last visited

Everything posted by Tattooshop

  1. Hello! I am making an information kiosk script and it seems to work like this, but for some reason the entire link is displayed in the chat even though I am trying to shorten it. llOwnerSay("Visit our [ "+link+" "+link_name+"]!"); Why it happens? ( I work with notecard reader must be for a second time only, and if there are any comments, I will take it into account with interest! Can I do something differently? ) Thanks for any help! key notecardQueryId; integer line; string link_name; default { touch_start(integer total_number) { string button = llGetLinkName(llDetectedLinkNumber(0)); if (button == "marketplace") // Button's name { line = 0; string link_name = "Marketplace"; } else if (button == "facebook") { line = 1; string link_name = "Facebook"; } else if (button == "youtube") { line = 2; string link_name = "Youtube"; } notecardQueryId = llGetNotecardLine("config", line); } dataserver(key what, string data) { if (notecardQueryId == what) { if (data != EOF) { string link = data; llOwnerSay("Visit our [ "+link+" "+link_name+"]!"); } } } }
  2. Thank you very much! It works! 👍 Thank you!
  3. Hey! I am trying to convert a script for one door to a script for double doors so that when you click on any of them, they open at the same time. The frame is the root and the script itself is placed in it. You need to click on the doors themselves. That's what is used for opening and closing: llSetLinkPrimitiveParamsFast(DOOR_PRIM_1, [PRIM_ROT_LOCAL, gRotationClosed, PRIM_POS_LOCAL, gPositionClosed]); llSetLinkPrimitiveParamsFast(DOOR_PRIM_2, [PRIM_ROT_LOCAL, gRotationClosed, PRIM_POS_LOCAL, gPositionClosed]); ... some stuff ... llSetLinkPrimitiveParamsFast(DOOR_PRIM_1, [PRIM_ROT_LOCAL, rotationOpened, PRIM_POS_LOCAL, positionOpened]); llSetLinkPrimitiveParamsFast(DOOR_PRIM_2, [PRIM_ROT_LOCAL, rotationOpened, PRIM_POS_LOCAL, positionOpened]); How do I get a negative value applied to the second door? I don't want to duplicate the entire script! The logic is not entirely clear. Maybe there is another way? 🤔 Thank's for any help!
  4. Thank you so much!!! You are genius! This is perhaps the most satisfying thing I've seen in SL! As for me, you did a real feat, the script is wonderful! It is already a pleasure to just watch them turn over one by one. Thank you! 👍
  5. and how to make a delay between the elements, because this way they will rotate at the same time ... There will be about 20 such elements, so the list is really needed here (?) otherwise the script will be just gigantic!
  6. I think the list needs to be squeezed in here llSetLinkPrimitiveParams(LIST?, [PRIM_ROT_LOCAL, llEuler2Rot( <0.0, 0.0, 120.0> * DEG_TO_RAD ) * llGetLocalRot()]);
  7. Thank you! Here is what I have at the moment. Looks, of course, a little strange. I have an idea, but I don't know how to do it - add a list of primitives to rotate here and apply parameters to each item of the list? If it makes sense touch_start(integer total_number) { llSetTimerEvent(15.0); // Full cycle } timer() { llSetLinkPrimitiveParams(2, [PRIM_ROT_LOCAL, llEuler2Rot( <0.0, 0.0, 120.0> * DEG_TO_RAD ) * llGetLocalRot()]); llSleep(5); // Per image llSetLinkPrimitiveParams(2, [PRIM_ROT_LOCAL, llEuler2Rot( <0.0, 0.0, 240.0> * DEG_TO_RAD ) * llGetLocalRot()]); llSleep(5); llSetLinkPrimitiveParams(2, [PRIM_ROT_LOCAL, llEuler2Rot( <0.0, 0.0, 360.0> * DEG_TO_RAD ) * llGetLocalRot()]); llSleep(5); }
  8. Thank you! So I've started with single linked* prim to test... but it doesn't move default { touch_start(integer total_number) { llSetTimerEvent(1.0); } timer() { llSetLinkPrimitiveParamsFast(2, [PRIM_ROT_LOCAL, llEuler2Rot( <0.0, 0.0, 120.0> * DEG_TO_RAD ) * llGetLocalRot()]); } }
  9. Hello! 🖐️ I'm trying to make such a billboard, you've probably all seen one where several prismatic objects with parts of the texture rotate at an angle of 120 degrees (except the root) with a slight delay, one after the other at a certain interval. Wondering how this can be done? (Creating the model itself everything is clear.) Thank's for any help!
  10. Thank you very much! Works great, I just set a timer to auto transition. I can also tinker with the gradient itself and get some cool transition effects (multi color and so on)!
  11. Just saw your edit, thanks a lot! I will definitely try ( tho I'm not sure if I can handle it ).
  12. Thank you very much! integer fade_step; 👍
  13. I understand that there is a mistake in this line while (++fade_step <= steps)// visible
  14. Hey! I am doing a slideshow for two prims, the front prim is painted in a certain color and smoothly becomes transparent and visible again, at which point the texture in the back prim is changed. but something doesn't work. where did i go wrong? prim smoothly and well becomes transparent, but stubbornly refuses to become opaque again! Here's my timer: timer() { integer fade_step = steps; while (++fade_step <= steps)// visible { float fade = (float) fade_step / (float) steps; llSetLinkAlpha(COLOR_PRIM, fade, COLOR_FACE); llSleep(delay); } llSetLinkTexture(TEXTURE_PRIM, llList2Key(texture, count), TEXTURE_FACE); ++count; count %= llGetListLength(texture); while (fade_step--)// transp { float fade = (float) fade_step / (float) steps; llSetLinkAlpha(COLOR_PRIM, fade, COLOR_FACE); llSleep(delay); } } COLOR_PRIM/FACE is for the color screen and TEXTURE_PRIM/FACE is for the background slideshow itself.
  15. Thank you very much for your support and for sharing your script, now everything works as it should! 👍
  16. Ugh, after so many years of torturing others and myself, I seem to finally realize that scripting is just not my thing!
  17. That's the whole code, if anyone needs it: integer run; integer intSwing = 10; // 1 degrees myFunction() { integer x = 0; for (x = 0; x <= 10; x++) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, llEuler2Rot( < (float)intSwing, 0.0, 0.0 > * DEG_TO_RAD ) + llGetLocalRot()]); llSleep(0.1); } for (x = 0; x <= 10; x++) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, llEuler2Rot( < -(float)intSwing, 0.0, 0.0 > * DEG_TO_RAD ) + llGetLocalRot()]); llSleep(0.1); } } default { touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { if (run) { run = FALSE; llSetTimerEvent(0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, ZERO_ROTATION]); } else { run = TRUE; llSetTimerEvent(1); } } } timer() { myFunction(); } }
  18. Thanks a lot! But now it seems broken (of course not lol) The object has changed its behavior... Before it the pendulum swung evenly left and right (I dunno why): and now in one direction. that is, I understand that I made a mistake, but why did it happen and what should I do? 🤔
  19. @Rolig Loon @Profaitchikenz Haiku 🤚 So managed to add 10 steps option, but the root prim is rotated 90 degrees and there is no way to change it because of the clock script. As a result, when the movement begins, the pendulum rotates 90 degrees with the root. I changed the rotation of the pendulum mesh, but now it is swinging upside down. Help please, how to avoid it? My function now looks like this: * It is clear that all this can be achieved by applying the correct rotation of the mesh, but this is not very convenient. integer run; integer intSwing = 10; // 10 degrees myFunction() { integer x = 0; for (x = 0; x <= 10; x++) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, llEuler2Rot( < (float)intSwing, 0.0, 0.0 >*DEG_TO_RAD ) + llGetLocalRot()]); llSleep(0.1); } for (x = 0; x <= 10; x++) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, llEuler2Rot( < -(float)intSwing, 0.0, 0.0 >*DEG_TO_RAD ) + llGetLocalRot()]); llSleep(0.1); } }
  20. @Rolig Loon Thank you very much for your quick help! I will try to make a smooth version! 👍
  21. So much better! * I would not recommend first version of the script, there is some incomprehensible bug. Please use the version below. integer gIntSwing = 30; rotation gRotSwing; integer run; default { state_entry() { gRotSwing = llEuler2Rot( < 0.0, 0.0, (float) gIntSwing * DEG_TO_RAD > ); } touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { if (run) { run = FALSE; llSetTimerEvent(0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, ZERO_ROTATION]); } else { run = TRUE; vector vAxis = llRot2Axis(gRotSwing); float fHalfAngle = llRot2Angle(gRotSwing) * 0.5; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL, llAxisAngle2Rot( vAxis, fHalfAngle) * llGetLocalRot()]); llSetTimerEvent(3); } } } timer() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, (gRotSwing = (ZERO_ROTATION / gRotSwing)) * llGetLocalRot()]); } }
  22. * A bug has been detected! Please use the updated version! That's what I did. May come in handy to someone... I would be grateful if anyone can find a way to simplify the script or improve it. It would also be cool to make the movements smoother, for example in a few steps. 👍 integer gIntSwing = 30; rotation gRotSwing; rotation hRotSwing; float hIntSwing; integer run; default { state_entry() { hIntSwing = gIntSwing*-0.5; gRotSwing = llEuler2Rot( < 0.0, 0.0, (float) gIntSwing * DEG_TO_RAD > ); hRotSwing = llEuler2Rot( < 0.0, 0.0, (float) hIntSwing * DEG_TO_RAD > ); } touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { if (run) { run = FALSE; llSetTimerEvent(0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, ZERO_ROTATION]); } else { run = TRUE; llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, (hRotSwing = (ZERO_ROTATION / hRotSwing)) * llGetLocalRot()]) ; llSetTimerEvent(3); } } } timer() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, (gRotSwing = (ZERO_ROTATION / gRotSwing)) * llGetLocalRot()]); } }
  23. Almost succeeded, thanks! But how to set half the angle?
  24. Thank you! Is it possible to somehow move the pendulum position in the ON state by half the "opening" angle (so that the OFF state position is equal to zero)? * * Automatically ** To divide the angle by two and automatically shift the swing of the pendulum to the side. I hope this makes sense.
  25. Thank you! And here's another question. I would like to add the ability to turn the pendulum on and off by touch. When off, it should point down. When on - the movement left/right must be performed. How can this be done better?
×
×
  • Create New...