Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problems with llGetStartParameter

Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
11-10-2005 11:44
I'm trying to make an "Update Disk" for my newest products, and I'm using a check in the target's state_entry to see if the start params are what I passed into it. The intention of this is to give the user feedback that the script was updated, then reset and not inform them again.

According to the wiki:
From: someone

integer llGetStartParameter()

Returns the start parameter passed to llRezObject or llRemoteLoadScriptPin. If the object was created from agent inventory, this function returns 0.

This is the same value that is passed to the on_rez event. If the script is reset (using llResetScript or other means), this value is set to 0.


It says that the start_params are set to 0 when the script is reset.

The code in the updater looks like this:
CODE

llRemoteLoadScriptPin(id, "_scriptname", pin, TRUE, 123);

The code I'm using in the target's state_entry looks like this:
CODE

state_entry()
{
llSetObjectDesc("Version "+version);
llSetRemoteScriptAccessPin(pin);
if(llGetStartParameter() == 123)
{
//Updated script
llWhisper(0, "Script updated. Resetting script... ");
llResetScript();
}
}


Now the problem I'm having is that it seems that the start_params are never set back to 0 after the script resets, so it goes into a loop resetting itself over and over.

This is the first time I've tried this so I may have just made a newbie mistake. :D

Thanks for any help!
_____________________
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
11-10-2005 12:56
A few versions back, early 1.5 I think, the ScriptAcessPin became an object property. So it can only be reset by re-rezzing the object (maybe) or by calling setremotescriptaccesspin again. Hope that helps, good luck.
_____________________
Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
11-10-2005 13:01
From: someone
ScriptAcessPin became an object property

Yes, that's right. What I'm saying isn't resetting back to 0 is the start params passed in from the llRemoteLoadScriptPin, not the pin # itself. :)
_____________________
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
11-10-2005 13:04
From: Stylez Gomez
Yes, that's right. What I'm saying isn't resetting back to 0 is the start params passed in from the llRemoteLoadScriptPin, not the pin # itself. :)

I'm confused, are you trying to load a script into an object that already contains the script?
_____________________
Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
11-10-2005 13:45
Yeah, the server has a script called "_server" and the update disk is sending it a new version of "_server".
_____________________
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-11-2005 18:11
stupid question, why do you want to reset the script after the script has been loaded into it? Since the script was just added it already has a clear memory space.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
11-12-2005 07:17
From: Strife Onizuka
stupid question, why do you want to reset the script after the script has been loaded into it? Since the script was just added it already has a clear memory space.


I want to reset it to clear the start parameters. If the start parameters are 123, it informs the user that the script was just updated. So then it resets, supposedly setting the start params to 0, therefore the if(start params == 123) statement won't fire anymore. It's just a way to verify that the script was actually updated.
_____________________