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

From Second Life Wiki
Jump to navigation Jump to search
(→‎Zippadeedoodah: new section)
Line 32: Line 32:
}</lsl>
}</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 -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 06:18, 16 May 2010 (UTC)
'''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 -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 06:18, 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)

Revision as of 23:32, 15 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)