Jump to content

KT Kingsley

  • Content Count

  • Joined

  • Last visited

Everything posted by KT Kingsley

  1. Where to find the LSL portal in the SL wiki: http://wiki.secondlife.com/wiki/LSL_Portal. From there browse around the LSL features by category lists on the right. You're never going to learn all the features and functions by heart, but if you do browse around a bit then when to come to something you want to script somewhere at the back of your head a little light will come on and remind you that you might have seen something about that somewhere in the wiki.
  2. Essentially, string length is limited by the memory available. 200 names should be ok in a small script, but for a large one you might need to consider a second script that just handles the names (add, remove, find, list, or whatever) and communicates with the main script using link messages.
  3. Maybe you could try building the swinging part, the bench and the ropes, with an extra invisible vertex (or an edge or a face) to make its horizontal central axis align with the pivotal axis you want to achieve. Made like this, you wouldn't need to change its position in each step, just its rotation, which might help make the motion smoother. And then you might also have another look at keyframe motion. Maybe five frames, describing an arc that's smaller at the extremes, but still taking the same time, played ping-pong style. Although that'd mean starting from one of the extremes of the swing... To start from the bottom of the swing, I guess you'd need to keyframe the whole cycle and repeat it.
  4. Thank you, @Fritigern Gothly, I've just taken a quick scan of that tutorial, and it looks very promising: clear, direct and hardly any ums and errs either. @Quarrel Kukulcan, I've just tried that and it all starts to make sense now. Many thanks.
  5. Yup, that's how I do it too. But how would I do it in Gimp?
  6. I can breeze through the process of making an alpha layer to use as an emissive mask on a texture in Corel Paint, but I'm not familiar with Gimp and I can't figure out how to do it there. Can someone either explain, in simple steps, as if for a complete beginner, how, starting with a base texture, to do this in Gimp, or point me to a decent tutorial?
  7. Continuing with the variations on a theme: integer toggle; default { touch_start (integer count) { llSetLinkPrimitiveParamsFast (LINK_THIS, [ PRIM_POS_LOCAL, llList2Vector (llGetLinkPrimitiveParams (LINK_THIS, [PRIM_POS_LOCAL]), 0) + <llList2Float ([1.0, -1.0], toggle = !toggle), 0.0, 0.0> ]); } } This uses the variable toggle as a selector in the llList2Float function. Overkill in this example, but it's a technique that can be useful with varables and situations that don't lend temselves to neat mathematical manipulation.
  8. Much better. Even when I posted my reply, I knew there was a better way of doing it. My brain is seizing up.
  9. Also, some vehicles have two parts: a rezzable vehicle that does the actual moving around, and a wearable part that provides all the visuals. With these you rez the vehicle part and sit on it and wear the visual part. The vehicle part triggers an animation that locks your avatar and its worn attachment into place.
  10. Well, you could do something like this: llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, llList2Vector(llGetLinkPrimitiveParams(LINK_THIS, [PRIM_POS_LOCAL]), 0) + <-1.0 + (2 * toggle), 0.0, 0.0 >]); where the x component in the vector is replaced by -1 + (2 * toggle).
  11. Am I mistaken, or did my region just shut down, update and restart in just under two minutes?
  12. That seems to be in https://releasenotes.secondlife.com/simulator/2020-05-15T18%3A31%3A37.542403.html, which is incorrectly linked in the OP.
  13. The links to the RC release notes are showing as a single link to the wrong release: https://releasenotes.secondlife.com/simulator/2020-05-08T19%3A08%3A23.541969.html in Google Chrome.
  14. Also, I've physically unplugged my SpaceNavigator, my graphics tablet and stylus, and a USB keypad as well as turning my wireless mouse off (these were all devices that I thought might have some effect resembling keyboard activity or mouse movement) to no avail. When I can dig up an old wired mouse I'll physically unplug the wireless mouse receiver. And also my keyboard...
  15. I've searched debug settings for "away". The only one I found that seemed relevant is AFKTimeout, which is reflected in the timeout setting in preferences.
  16. I've tried with a system only avatar with absolutely no attachments or scripts (which includes my AO). I've tested the RLV @allowidle command. I've disabled RLV. I've tried both Frirestom and the SL viewer. And I've tried with alts. No success.
  17. I'm not too bad with bracketing typos since I adopted the practice of typing the closing bracket immediately after typing the opening one and then backspacing and filling in what goes between them. Especially helpful when you've got functions as parameters to functions. But yeah, those ordinary punctuation marks are a pain.
  18. Don't leave a comma after the last element of a list.
  19. My Away mode doesn't trigger automatically after the specified timeout. It does trigger manually, and it does trigger automatically when my viewer loses focus. It doesn't trigger when I don't touch my keyboard, mouse or joystick for the timeout duration. I've tried with the joystick disabled and the mouse turned off, in case there were some imperceptible movements happening, and also without a microphone connected. Any suggestions as to what might cause this to happen?
  20. I think you need to make the variable LastPlayed global. Declare it before the state default part of your script. As it stands, the variable is declared and created in the "02a" section of the script and is only available there. So: string LastPlayed; state default { //... touch_start (integer total_number) { //... else if (nameLinked == "02a") { llStartAnimation ("anim"); LastPlayed = "anim"; } } } (Or, seeing as you seem to be referring to a run-time error rather that a compiler error, I suspect you've already declared LastPlayed as a global variable, but you're creating a new variable, also called LastPlayed, in that section of code which supersedes the global variable. Just drop the "string" from the line string LastPlayed ="anim"; so the script will use the original global variable and not create a new, temporary, one.)
  21. llGetAttachedList returns a list of the keys of an avatar's attached objects. llGetObjectDetails returns a list of an object's selected details, which can include its name and, perhaps, its creator, because names are easy to spoof.
  22. I have lots of attachments that I've scripted myself that trigger an animation when they're worn. And the animation stops when the object is detached, without any further intervention from the script. default { attach (key id) { if (id) llRequestPermissions (id, PERMISSION_TRIGGER_ANIMATION); } run_time_permissions (integer permissions) { if (permissions & PERMISSION_TRIGGER_ANIMATION) llStartAnimation ("sit_ground"); } } Only a tiny amount of code gets executed/time is allocated when the attach event is triggered by a detach, and not particularly reliably, either. I can't see any other place to put code that explicitly stops an animation on a detach.
  23. That's pretty much how I do it too. I've posted my version of a multiple timer in this LSL Library forum thread:
  24. There's been a question in a scripting thread about using multiple times in a single script, so I'll offer up my take on the subject here. I've been using this without problem for quite a while now but, as with all scripts, I expect people will find their own problems when they try to use it. list timer_events; SetTimerEvent (string label, float interval) { integer index = llListFindList (timer_events, [label]); if (interval <= 0.0) { if (~index) { timer_events = llDeleteSubList (timer_events, ~-index, -~index); if (timer_events == []) llSetTimerEvent (0.0); } } else { list this_event = [llGetTime () + interval, label, interval]; if (~index) timer_events = llListReplaceList (timer_events, this_event, ~-index, -~index); else timer_events = this_event + timer_events; timer_events = llListSort (timer_events, 3, TRUE); } if (timer_events) { interval = llList2Float (timer_events, 0) - llGetTime (); if (interval <= 0.0) interval = 0.01; llSetTimerEvent (interval); } } StopAllTimerEvents () { llSetTimerEvent (0.0); timer_events = []; } string GetTimerEventLabel () { string label = llList2String (timer_events, 1); float interval = llList2Float (timer_events, 2); timer_events = llListSort (llListReplaceList (timer_events, [llGetTime () + interval, label, interval], 0, 2), 3, TRUE); interval = llList2Float (timer_events, 0) - llGetTime (); if (interval <= 0.0) interval = 0.01; llSetTimerEvent (interval); return label; } To start and stop a timer event use the function SetTimerEvent with either a non-zero or zero interval. You must also supply a string label to identify the specific timer event. In the timer event itself use the function GetTimerEventLabel to get the indentifying label for the specific timer event, and use this to select the appropriate course of action. This function also sets the timer up for the next event. There's also the StopAllTimerEvents function, because sometimes you want to do that.
  • Create New...