Jump to content

Best Practices for Object Communication


GManB
 Share

You are about to reply to a thread that has been inactive for 1571 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'd like pointers to docs or code examples describing the best practices for objects communicating with one another. In my specific case there will be three objects, two of which are linked into a muti-link object. The root prim of the multi-link will be the master that will orchestrate and drive the dialog menus for user interaction. The child prim of the multi-link will hold avsitter 2 and all the anims for this object.

 

Thanks in Advance!

 

G

Link to comment
Share on other sites

Since you're using AvSitter, be sure to consult their guide at http://avsitter.github.io to understand the various messages that your script can exchange with it through link messages. You can use codes from AvSitter to trigger events in your own script, and you can send AvSitter codes that will trigger animations, display menus, and do all the other tricks it performs.

In general, when you're controlling a linkset it makes sense to combine functions into as few scripts as you can, and then let a central script make changes in child prims with llSetLinkPrimitiveParamsFast or related functions. When you can't stuff things into a single script, use link messages.  It sounds like what you are already planning.  I tend to concatenate sets of variables into a single string, using unambiguous separators like "|" or "~" between them, and then use llParseString2List to extract them at the other end.  I use the second integer variable in llMessageLinked to send flags or to indicate the sense of a toggled variable. If you feel comfortable doing bitwise masking, you can stuff a mess of flags into a single integer. (I don't, but many scripters -- like Molly -- do.)

If you're communicating with nearby unlinked objects, you have the full set of chat message functions to work with. I find that I end up using llRegionSayTo more often than the other options, because it lets me send targeted messages easily anywhere in the same region.  The challenge there is that you have to know the UUIDs of the two communicating objects, but there are a number of handy functions for doing that (like using llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]) to help a newly rezzed object get the UUID of the object that rezzed it). 

Edited by Rolig Loon
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1571 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...