Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question about Script Communications

Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
01-11-2006 14:09
I was looking up some information on link messages in the Scripting Wiki and found this question and answer someone posted in the Wiki:

Q: Can I use llMessageLinked to send a message within only one script?
A: Yes, though there are better ways to communicate within a single script. Note that your link_message event will trigger on all link messages the prim receives, so your script may end up talking to itself if you're not careful.


What are the better ways to communicate within a single script? Thats exactly what I need to do and am unsure what the best way to do that is.

Thanks!!!!
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
01-11-2006 14:40
Not sure what you mean by "communicate within a single script" here. Inside a single script, global variables (variables defined outside of states and functions) can be accessed just about anywhere in the script. If you need to share data across functions and handlers, that would be the best way to go.
_____________________
~ Tiger Crossing
~ (Nonsanity)
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
01-11-2006 14:42
with linked messages your sending a string of data from one point to another, wether it be a another prim or another script

soo if you need to pass data around inside a single script, theres no need to message just set a global (before default ie string bob; ) in one point of your script define it and recall it where ever you need to