# DoteDote Edison

Resident

63

14 Good

• Rank
1. ## Touched prim in a range says specific phrase

This is a grid-offset game, so math can help. First, re-link them all properly so that the bottom left is link 2, then to the right is link 3, 4, 5, 6, and the next row up starts at 7 and so on. Now you can calculate the grid position of the touched prim. Set X and Y variables (or a vector) to store coords of the touched prim. vector.x = (linknum - 2)%5+1. The minus two compensates for the root prim and the plus one makes the grid start at 1,1. That gives X a value 1-5 per five columns. vector.y = llFloor((linknum-2)/5)+1. This gives Y value 1-5 with the bottom row at 1 and the
2. ## Parcel media question

There's a way to do it, depending on the stream service/source and whether or not you can include a time parameter with the video url. Suppose you're watching a long youtube clip. With youtube, you can append &start=[seconds] to the url to indicate how many seconds into the clip to start. So, when a movie first plays, your script in SL would do a llResetTime(). That resets an internal script timer (not to be confused with the normal timer event). If a friend comes to the party 30-minutes late, you could program a "re-sync" button on your media player that calls llGetTime() - which
3. ## Tell Me It Isn't So, and I'm just seeing things...

I commented out the user function and uncommented each llTargetOmega() separately... I'm in Morris Sandbox if you wanna stop by. Region Morris.
4. ## Tell Me It Isn't So, and I'm just seeing things...

I just finished a project that successfully calls llTargetOmega() in a timer(), so I took your script to Morris for testing. After 100 clicks, 50 first omega, and 50 second omega (with ChangeRotation() floated), it worked every time. Since this is client-side, I'm on the standard SL Viewer 6.4.8.548890.
5. ## How could we store two different pieces of information about a single llDialog() button?

The simple solution is to A) append 1, 2, 3, etc. to the end of the button name as suggested above (fiddle with leading spaces to keep centered), or B) only use one button and apply the result to all receivers. As you stated, using UUIDs as button labels is meaningless to the user... well, two buttons that do two different actions but use the exact same label can also be meaningless. How would the user know which button goes to which item? Adding a number (or letter A, B, or anything) would help the user to differentiate the two buttons and it makes the scripting problem go away. I
6. ## Problems system reading sound files

If you’re getting Stack Heap Overflow, you need to pinpoint where that occurs within the script. Add an llOwnerSay() as the first line of every event that will say the name of the event. Also add them to any user function, and at the beginning of every loop, right after the “for”, “do” or “while” line. if you add those everywhere, you’ll see in chat where the script was when it crashed. Insert more detailed llOwnerSays which output variables or llDumpListToString() if there’s a list. After the next crash, you should know exactly the cause.
7. ## Is there a way to iterate over multiple lists to delete a duplicate element?

A user function probably exists somewhere, but the gist of the process is... Take each item from List A one by one and llListFIndList() for that item in List B. If found, remove and if it’s possible to have duplicates in the same list, scan List B again. Else, scan List C. Repeat with item two. After running through all items in List A, do the same with List B, but only llListFindList() in List C, since you already know there are no copies in List A. No need to process items in List C, or whatever is the last list, since its dupes would’ve been found in scans from previous lists.
8. ## 3 lists gif animator? :D

Lists are built on an index system, starting with index 0 (zero). The first item is located at index 0, the second at index one 1, third index 2, and so on. And since you are creating the script and list, you already know what type of data you’ve stored at each index (UUID, integeger, etc). To get a set of data, such as texture UUID, framesX integer, framesY integer... use llList2Key(). The index you request is based on the stride of the list (items that are a set).. Remember, computer counting starts at 0 instead of 1, so multiplying gifNumber (0) by the number of items in a set (4) will
9. ## 3 lists gif animator? :D

Maybe I don’t understand what you’re trying to do, but I’m not sure why you need three lists. If the gifs are built into the textures properly, with all the frames on a single sheet as one texture, then you would only need one list. The frames data can be included in a single, strided, list. For example, [“UUID”, 4, 2, 8, “UUID”, 2, 2, 4, etc] For texture animations like that (combined into one texture), the frames X & Y should be the total frames across and down on the texture .. that’s how the size of each frame is determined by the system. if you’re using texture that are
10. ## Collect rezzed objects inside a prim

As Phate would have it... you can't move arbitrary objects into an item's inventory. However, if it fits your concept, there may be ways to pick up objects and put them into inventory. For example, if you're simulating something like an Easter Egg hunt and want people to be able to collect eggs in their attached basket. You could script a basket to request llAllowInventoryDrop() when the egg-hunter attaches it. Each egg you hide would have a replica egg inside its own inventory. The eggs could be scripted to llGiveInventory() to the hunter's basket when touched, then llDie() (or hide) the
11. ## External Editors?

I use Atom and it can also be linked to the in-world editor. To set an external editor, go to Advanced Menu->Show Debug Settings and type "externalEditor" in the upper space. In the lower space type the path to your installation plus "%s" like: C:\Users\<computer user name>\AppData\Local\atom\atom.exe "%s" Then, open a script and click the "Edit" button on the in-world script editor. The script will open in Atom (or whichever editor you choose) and still be linked to SL. So, when you save the script in the external editor, it's copied back to the in-world editor.
12. ## lsl question about a percentage decrease and increase system.

You can also use a prim to indicate percentage... a bar-scale with a cube, or a pie-chart with a cylinder: // Bar Scale - Slice a BOX from 1.0 to 0.02 float hunger = 1.0; // 1.0 is 100% of 1 timer() { hunger -= 0.01; llSetPrimitiveParamsFast([PRIM_SLICE, <0.0, hunger, 0.0>]); } // Pie Chart - Cut a CYLINDER from 1.0 to 0.02 float hunger = 1.0; // 1.0 is 100% of 1 timer() { hunger -= 0.01; llSetPrimitiveParamsFast([PRIM_TYPE, PRIM_TYPE_CYLINDER, PRIM_HOLE_DEFAULT, <0.0, hunger, 0.0>, 0.0, ZERO_VECTOR, ZERO_VECTOR, ZERO_VECTOR]); }
13. ## Drawer Script by Racer Plisskin

If a drawer and everything "inside" is linked as one object, then you only have to move the root. The entire link-set moves as one unit, so need need to use llMessageLinked() to control every individual prim separately. Even though Rolig uses llSetLinkPrimitiveParamsFast(), "LINK_THIS" means it's only "talking" to the root prim. Your old llMessageLinked() ascript is designed to work with multiple drawers all linked together as a single object. In that case, the script would need to control every linked prim individually, only only move the prims defined as part of a specific drawer. F
14. ## Favorite External Script Editors

I’m using Atom. It has all the qualities I need in a script editor. Dark themes, syntax highlighting, find/replace, and autocomplete for LSL and - more importantly - my variable & custom function names. Pleasant surprises are things like auto-quotes/brackets/parentheses; auto "", (), or [] a block-selection; block-selection indent in/out; {}, [], () pair highlight; and diff-pane; and the always-awesome mini-map overview to quickly scroll through code, show highlighted in-view/current line and highlight find/replace results. For LSL: Settings->Install->Search "LSL"->Ins
15. ## Why am I getting 'Type Mismatch'?

For multiple sentences in a string, like converting a notecard, you could try llParseString2List() with most common end of sentences as the spacers. Then, say the list as a string. string song = “mary had a little lamb. a little lamb... yes, a little lamb! you’ve heard this one before?”; list keepemseparated = llParseString2List( song, [], [“. “, “. “, “... “, “! “, “!! “, “? “, “:) “, “;) “]); integer i; integer j = llGetListLength(keepemseparated) - 1; while (i < j) { string s = llList2String(keepemseparated, i); s = llToUpper(llGetSubString(s, 0, 0)) + l
×
×
• Create New...