deanimo Posted April 13, 2011 Share Posted April 13, 2011 hello, sorry for bother you again... but is there any way to keep a variable value after the llResetScript?!and other question.. is there any way to read the value of a variable inside other script located inside another prim linked in the same object? thanks. Link to comment Share on other sites More sharing options...
Randall Ahren Posted April 14, 2011 Share Posted April 14, 2011 deanimo wrote: hello, sorry for bother you again... but is there any way to keep a variable value after the llResetScript?! and other question.. is there any way to read the value of a variable inside other script located inside another prim linked in the same object? thanks. No bother. I live to answer questions. It gives meaning to my boring and mundane existence. Question No. 1, is there any way to keep a variable value after llResetScript? I think so. Store the variable in the object's description and read it back from there after a script reset. Question No. 2, is there any way to read the value of a variable inside other script located inside another prim linked in the same object? I can think of a couple of approaches, both of which involve code in the other script inside said another prim. The most straightforward approach would be to have this other script send a message using llMessageLinked, which transmits the value of the variable. Alternatively, have the other script write something to the object description and read it from there. Link to comment Share on other sites More sharing options...
Jenni Darkwatch Posted April 14, 2011 Share Posted April 14, 2011 To add to Randalls excellent answer: Beware of length limits in the description field, and also keep in mind that this info is accessible to anyone examining the object. Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 14, 2011 Share Posted April 14, 2011 You can store information in any variable that can be read with a LSL command. A prim's name and description fields are obvious choices, as are the names and description fields of child prims. Also, you can store numbers in integer, float, or vector quantities. For example, if you want to store a floating point number, record it as the alpha value of a prim face in the linkset, scaled as appropriate. Or store it as a value in a color or size vector. Store a string variable in a floating text, set to alpha =0.0 so that it's invisible. Once you start thinking, there are dozens of places to store information and keep it safe from reset. Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted April 14, 2011 Share Posted April 14, 2011 And of course you can always store any value in a off world database - and retrieve it from there. Link to comment Share on other sites More sharing options...
Ishtara Rothschild Posted April 14, 2011 Share Posted April 14, 2011 Another approach is to send the value to a second script with a link message, and use another link message to have it send the value back. Link to comment Share on other sites More sharing options...
deanimo Posted April 19, 2011 Author Share Posted April 19, 2011 thanks to all, good ideas.. and problem resolved. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.