Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Dataserver with 2 scripts

Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
06-12-2005 21:16
ok I have been reading up a storm on the wiki pages, and It is late at night for me again

I have 1 prim with 2 scripts, they each read a seperate notecard and must then pass into on to the other, well at least 1 of the scripts passes info on.

I am trying to incorporate the query_id key to keep the 2 from changing values with each other but I must me missing a key step as I am not getting the data I should be.

How can I make sure the dataserver only proccess the llGetNotecardLine from the same script?
Yoshi Platini
Registered User
Join date: 23 Jul 2004
Posts: 111
06-12-2005 21:27
Hi Perwin,

If it's not proprietary to your project, can you post the code fragment that's giving you problems?

Individual dataserver events should only be coming back to the task (script) that requested them, even in an object with multiple scripts. So letting folks see your code fragment (again, if it doesn't blow the lid off a confidential project) would probably help you get the thing unkinked more quickly.
Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
apologies
06-13-2005 04:37
Late night scripting, and was real tired,

I still could use help but I did not post all the details, I will add more info and script sections if I get time at work otherwise it'll have to wait for when I get home.

Thanks in advance
Ushuaia Tokugawa
Nobody of Consequence
Join date: 22 Mar 2005
Posts: 268
06-13-2005 05:51
https://secondlife.com/badgeo/wakka.php?wakka=dataserver

Edit: When I looked at the LSL Wiki I realized none of the dataserver pages showed an example of this. I understand how this would be confusing.

llGetNotecardLine will return a "query id" key, so use that key to make sure the data coming in through the dataserver event is the data you requested.

CODE

key queryFromThisScript;

default {
state_entry() {
queryFromThisScript = llGetNotecardLine("notecard", 0);
}

dataserver(key query_id, string data) {
if (query_id == queryFromThisScript) {
llOwnerSay(data);
}
}
}
Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
thank you!
06-13-2005 07:12
Thank you Ushuaia,

That was exactly what I needed.

I am toying with the idea of making this script public domain, but I will need a Competent
scripter and or a Linden to look it over before posting it.

And of course before that I need to finish it.

Thanks to everyone