Jump to content

keep variable after llResetScript


deanimo
You are about to reply to a thread that has been inactive for 3450 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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 post
Share on other sites

 


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 post
Share on other sites

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 post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...