Difference between revisions of "User talk:Fred Gandt/Scripts/Continued 4"
Fred Gandt (talk | contribs) |
Fred Gandt (talk | contribs) |
||
Line 40: | Line 40: | ||
:What's a race condition? -- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 08:56, 16 May 2010 (UTC) | :What's a race condition? -- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 08:56, 16 May 2010 (UTC) | ||
::OK. Wikipedia has answered that one but...oh never mind. Damn buzzy flying thing. My head feels like mush. -- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 09:03, 16 May 2010 (UTC) |
Revision as of 01:03, 16 May 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Comments about the contents of Fred Gandt/Scripts/Continued_4
Please create a new section for comments made on a new subject by clicking the "+" tab rather than the "Edit" tab.
Please sign you comment by adding 4 tildes (these thingies ---> "~") at the end of your comment.
- E.g. "Blah blah blah ~~~~"
When you save your edit/creation the wiki will automatically convert the 4 tildes into your signature.
Abusive, offensive or otherwise inappropriate comments will be removed and reported to Linden Labs.
Zippadeedoodah
It seems like that having the text conversion in the function limits how reusable the function is.
I've spotted a couple of bugs and race conditions. Nothing serious but potentially bothersome non the less.
- It should be faster to gen the list outside the loop as it changes the operation into a simple copy.
- It's possible that the dest position is unachievable and your script will hang (hence the distance check).
- -1 is the value for LINK_SET, which will cause llSetLinkPrimitiveParamsFast to try to move the seated avatar to that local position as well as the root prim to the same global position.
- The script could end up in a non-root prim, which would cause it to still end up in an infinite loop as llGetPos returns local+root position. Hence llGetRootPosition.
<lsl>Zippadeedoodah(string dest_s) {
vector dest = ((vector)("<" + dest_s + ">")); list pos = [PRIM_POSITION, dest]; while(llVecDist(llGetRootPosition(), dest) > 0.001) llSetLinkPrimitiveParamsFast(LINK_ROOT, pos);
}</lsl> Random rambling addressing nobody: Using PRIM_POSITION with LINK_SET only makes sense as a bit of cleverness and with limited real world application. Wonder if I should write a note about about this? It might be useful in a (HUD) attachment? In any case you would probably want to use LINK_ALL_CHILDREN instead. Mixing global and local coord frames is unlikely to be wise. hmmm -- Strife (talk|contribs) 06:18, 16 May 2010 (UTC)
- A bee or wasp just stung the top of my head while I was walking my dog. *whimpers* -- Fred Gandt (talk|contribs) 07:32, 16 May 2010 (UTC)
- I'll be honest (I always am), I can't see how the tiny measure of
llVecDist(llGetRootPosition(), dest) > 0.001
could ever be an issue (but seriously my head feels bloated and poopy). I fully understand the LINK_THING verses LINK_THING thing (Thank you. Now under belt). I assume that storinglist pos = [PRIM_POSITION, dest];
before using it makes the use of it faster or more efficient? We don't have to create the list fresh each call of llSetTheThingies? Tried it in-world and it seemed about the same performance wise (too poopy to get into it...oooh I know....erm....llGetTime). -- Fred Gandt (talk|contribs) 08:02, 16 May 2010 (UTC)
- 2.623372 (V1) against 2.400593 (V2) seconds. Obviously the same rout traveled. That was ground to 4000m almost directly up. So yours is slightly quicker (in one test) *smiles* Thanks for the heads up Strife. It's nice to know someone is watching my back. I do mention on my main user page that I try but can fail. "It takes a village" and all that. TY -- Fred Gandt (talk|contribs) 08:18, 16 May 2010 (UTC)
- What's a race condition? -- Fred Gandt (talk|contribs) 08:56, 16 May 2010 (UTC)
- OK. Wikipedia has answered that one but...oh never mind. Damn buzzy flying thing. My head feels like mush. -- Fred Gandt (talk|contribs) 09:03, 16 May 2010 (UTC)