|
Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
|
06-16-2006 00:16
Hi all, I'm building a script that uses an ACL that can get VERY large. The main script itself is quite large, and takes up a signifigant ammount of memory. My question is, what is the best way to access and store data in another script inside the same prim? I can use link messages to do lookups and such, but how can I get the results back to the original script? Thanks in advance, Jesse
|
|
Thraxis Epsilon
Registered User
Join date: 31 Aug 2005
Posts: 211
|
06-16-2006 00:41
Umm... LinkMessages
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
06-16-2006 04:44
From: Jesse Malthus I can use link messages to do lookups and such, but how can I get the results back to the original script? Like mentioned already, link messages to send results back would likely be good bet. Guess you could model it in similar manner dataserver event and related calls work, to get around synchronization issues...
|
|
Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
|
06-16-2006 09:00
A lack of blocking calls is one of my pet peeves about LSL. I thought about having a loop like: string gLinkData; getdata(string msg){ llMessageLinked... while(gData == ""){ llSllep(1); } //process gdata... }
but that seems too intensive.
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
06-16-2006 10:18
integer DATA_TRANSFER = 1001; // or whatever
...
llMessageLinked( ..., DATA_TRANSFER, "", RequestContext );
...
link_message( integer Sender, integer InputInt, string InputString, key InputKey ) {
if( InputInt == DATA_TRANSFER ) { if( InputKey == RequestContext ) { // whatever, InputString is what your gLinkData would be } else if( InputKey == <some other context> ) { // do something else } } // other messages }
this does pretty much what you want, just without having to manually sleep the script (and the handling of return value is in link_message event rather than in the function that requests the data. Using both command type and request context is quite likely overkill for most uses (only practical if you're requesting more than single data item at any given time) ... and can be simplified to using just one or the other.
|