Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripts Not Holding Settings

RaH Wollongong
Registered User
Join date: 11 Jul 2006
Posts: 19
12-31-2006 11:02
I wrote a menu script that the user interacts with and sets certain variable such as sex. The script has one flaw, upon logout the users settings are reset, is there a way around this?
I think it has something to do with my use of
CODE
    on_rez(integer start_param)
{
llResetScript();
}


I have called this just after the default{ entry point and before start_entry(). I have searched the wiki and only found the on_rez for resetting the script to a new owner on rez the problem is now that everytime the object is rezzed it resets the script. I only need it reset that one time the new owner rezzes it.
Limpen Lumpen
Registered User
Join date: 5 Jun 2006
Posts: 6
12-31-2006 11:16
CODE

changed( integer c )
{
if ( c & CHANGED_OWNER ) {llResetScript();}
}



If the object is worn with your script it will reset every time they log on.

Use the above to reset on changed owner.

Also look into using states.

Ie 1 state to set up all of the variables etc , then switch to a running state and ommit the on_rez reset from the running state.


Hope it helps
RaH Wollongong
Registered User
Join date: 11 Jul 2006
Posts: 19
12-31-2006 11:33
Helps immensly thank you.