Difference between revisions of "User talk:Fred Gandt/Scripts/Continued 4"

From Second Life Wiki
Jump to navigation Jump to search
Line 34: Line 34:


::A bee or wasp just stung the top of my head while I was walking my dog. *whimpers* -- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 07:32, 16 May 2010 (UTC)
::A bee or wasp just stung the top of my head while I was walking my dog. *whimpers* -- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 07:32, 16 May 2010 (UTC)
:I'll be honest (I always am), I can't see how the tiny measure of <code>llVecDist(llGetRootPosition(), dest) > 0.001</code> 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 storing <code>list pos = [PRIM_POSITION, dest];</code> 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). -- '''[[User:Fred_Gandt|Fred Gandt]]''' <sup><small>([[User talk:Fred_Gandt|talk]]|[[Special:Contributions/Fred_Gandt|contribs]])</small></sup> 08:02, 16 May 2010 (UTC)

Revision as of 00:02, 16 May 2010

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 storing list 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)