-
Posts
1,072 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Everything posted by KT Kingsley
-
LSL regularly gets new functions, often corresponding to new features in SL, but the basis remains unchanged. What you might have to keep an eye open for when studying an older book on the subject is that a more recent LSL function may supersede a technique described in the book, which simplifies it and also makes it more efficient.
-
Check the object's name at the same time you check it's not a script: if (name != "except.object" && llGetInventoryType(name) != INVENTORY_SCRIPT) One thing, though: if you're giving several objects at once I'd be inclined to use llGiveInventoryList, which puts all the items together in a new folder in the target's inventory and only triggers a single accept/decline dialog.
-
Your opinion, THE MOST IMPORTANT LSL skills someone needs?
KT Kingsley replied to Salsoam's topic in LSL Scripting
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. -
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.
-
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.
-
Making an emissive masked texture using Gimp
KT Kingsley replied to KT Kingsley's topic in Building and Texturing Forum
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. -
Making an emissive masked texture using Gimp
KT Kingsley replied to KT Kingsley's topic in Building and Texturing Forum
Yup, that's how I do it too. But how would I do it in Gimp? -
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?
-
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.
-
Much better. Even when I posted my reply, I knew there was a better way of doing it. My brain is seizing up.
-
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.
-
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).
-
Deploy Plans for the week of 2020-05-18
KT Kingsley replied to Maestro Linden's topic in Second Life Server
Am I mistaken, or did my region just shut down, update and restart in just under two minutes? -
Deploy Plans for the week of 2020-05-18
KT Kingsley replied to Maestro Linden's topic in Second Life Server
That seems to be in https://releasenotes.secondlife.com/simulator/2020-05-15T18%3A31%3A37.542403.html, which is incorrectly linked in the OP. -
Deploy Plans for the week of 2020-05-18
KT Kingsley replied to Maestro Linden's topic in Second Life Server
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. -
What might prevent Away mode being triggered automatically?
KT Kingsley replied to KT Kingsley's topic in Second Life Viewer
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... -
What might prevent Away mode being triggered automatically?
KT Kingsley replied to KT Kingsley's topic in Second Life Viewer
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. -
What might prevent Away mode being triggered automatically?
KT Kingsley replied to KT Kingsley's topic in Second Life Viewer
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. -
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.
-
Don't leave a comma after the last element of a list.
-
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?
-
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.)
-
Send Avatar Home if not wearing specific attachment
KT Kingsley replied to MinaPhoenix's topic in LSL Scripting
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. -
Trying to make a simple card draw deck
KT Kingsley replied to HarrisonMcKenzie's topic in LSL Scripting
I think I need to rethink this. -
Script That Allows Purchase From the Demo?
KT Kingsley replied to FairreLilette's topic in LSL Scripting
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.