Jump to content
sophy7777

halp, trying to get scripts to talk to a "main script"

Recommended Posts

so me and a friend have started making a HUD for puppy sounds, eg woof, growl ect. 

and as the project came along we've realized that i (myself) need a little help making the script as we would want the buttons to talk back to the root prim so that the hud sounds could be turned on and off, a choice to change name of person wearing the hud, and read setting notcard. i know how to do the parts but making them comunicate together has me confused. any help would be greatly helpful, even if its just the name to what im thinking of as so far the only lllisten ive found is to local chat for the owner to say a phrase. 

Share this post


Link to post
Share on other sites

Use linked messages.  Send with llMessageLinked and receive in a link_message event.  Even better, though .... Unless you have a good reason to make each of your HUD buttons as a separate linked prim, it's much smoother to simply texture your HUD with an image that looks like a user interface with a bunch of button on it.  Then use llDetectedTouchST to determine which area of the texture the user clicked on.  That saves you having to put a mess of separate scripts in all of the buttons.  You do the whole job with a single script in the root (the only prim, actually).

  • Like 1

Share this post


Link to post
Share on other sites
8 minutes ago, Rolig Loon said:

Use linked messages.  Send with llMessageLinked and receive in a link_message event.  Even better, though .... Unless you have a good reason to make each of your HUD buttons as a separate linked prim, it's much smoother to simply texture your HUD with an image that looks like a user interface with a bunch of button on it.  Then use llDetectedTouchST to determine which area of the texture the user clicked on.  That saves you having to put a mess of separate scripts in all of the buttons.  You do the whole job with a single script in the root (the only prim, actually).

ll message linked looks a good way, ill have to read up on it as i haven't yet came across this before! id have to search out a few examples to help me ^.^ thank you so much!

Share this post


Link to post
Share on other sites

As an alternative to Rolig's method of using a texture and llDetectedTouchST(which is probably how I'd do it, in fact), if you want to use separate prims as buttons, you can still do it with only one script.    Simply give each button prim a unique name ("Button A", "Button B" and so on) and then have a single script in the root prim which, in the touch_start event, identifies the touched button by using llGetLinkName(llDetectedLinkNumber(0)) and then decides from that which sound to play.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...