• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-2558
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Normal Normal
Assignee: Unassigned
Reporter: Ralph Doctorow
Votes: 4
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

Inactive scripts loose their state when taken and re rezzed, active scripts remember their state.

Created: 21/Jun/08 10:35 AM   Updated: 06/Jul/09 09:42 PM
Return to search
Component/s: Scripts
Affects Version/s: None
Fix Version/s: None

Environment:
This also happens on the Mono grid

Second Life 1.20.10 (89467) Jun 10 2008 18:17:42 (Second Life Release Candidate)

You are at 232768.2, 230582.0, 39.9 in NCA v located at sim1033.agni.lindenlab.com (8.4.129.183:13001)
Second Life Server 1.22.3.89352

CPU: Intel Pentium 4 (Unknown model) (3192 MHz)
Memory: 3071 MB
OS Version: Microsoft Windows XP Service Pack 2 (Build 2600)
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce 6800/PCI/SSE2
OpenGL Version: 2.1.1
LLMozLib Version: [LLMediaImplLLMozLib] - 2.01.16051 (Mozilla GRE version 1.8.1.13_0000000000)
Packets Lost: 4/54003 (0.0%)
Issue Links:
Duplicate
Relates
 


 Description  « Hide
I'm using llSetScriptState to only have scripts running when I need them. This works fine as long as I keep the object rezzed.

However, if all the scripts but one are inactive and I take the object back into inventory, when I re-rez it, all the inactive scripts have lost the states they were in and go back to the default state the next time they're activated.

If the scripts are left active all the time, when they are taken and re-rezzed the script states are correctly remembered.

IMHO it's in the best interests of avoiding lag if the use of llSetScriptState is encouraged.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Ralph Doctorow added a comment - 13/Jul/08 07:06 PM
This code demonstrates the problem. Put the master code in one script and the slave code in another named SS. Every other touch activates the SS script which keeps a count of the number of activations and prints it. Now take the object into inventory and re-rez it. If the SS script was active, it's still in the correct state and remembers the count of activations, if it was inactive when taken, it's forgotten everything.
///////////  MASTER CODE ///////////
integer sState = FALSE;

default {
	state_entry() {
		llSetScriptState("SS", sState);
	}
	
	touch(integer num) {
		sState = !sState;
		llOwnerSay("Setting SS active to " + (string)sState);
		llSetScriptState("SS", sState);
		if (sState) {
			llMessageLinked(LINK_THIS, 0, "", NULL_KEY);
		}
	}
}
/////////////// SLAVE CODE ///////////////////
// Put in script named SS
integer count = 0;

default {
	state_entry() {
		llOwnerSay(llGetScriptName() + " Entry Default State count: " + (string)count);
		state secondState;
	}
	link_message(integer sender, integer num, string str, key id) {
		llOwnerSay(llGetScriptName() + " In Default State count: " + (string)count);
	}
}
	
state secondState {
	state_entry() {
		llOwnerSay(llGetScriptName() + " Entry secondState count: " + (string)count);
	}
	
	link_message(integer sender, integer num, string str, key id) {
		count += 1;
		llOwnerSay(llGetScriptName() + " In secondState count: " + (string)count);
	}
}

Ralph Doctorow made changes - 13/Jul/08 07:12 PM
Field Original Value New Value
Comment [ Test ]
Ralph Doctorow made changes - 13/Jul/08 07:13 PM
Comment [ Here's some code to demonstrate this. Create an object and put in the master code in one script and the slave in a second named "SS". Every other time you touch it, it will toggle the SS script which will tell you its state which should always be "secondState" after it starts. Get it to SS inactive then take it into inventory and rerez it. Now next time you touch it it will be back in the default state. Doing the same thing with it active correctly keeps it in secondState.

/////////// MASTER CODE ///////////
integer sState = FALSE;

default {
state_entry() {
llSetScriptState("SS", sState);
}

touch(integer num) {
sState = !sState;
llOwnerSay("Setting SS active to " + (string)sState);
llSetScriptState("SS", sState);
if (sState) {
llMessageLinked(LINK_THIS, 0, "", NULL_KEY);
}
}
}
/////////////// SLAVE CODE ///////////////////
// Put in script named SS
default {
state_entry() {
llOwnerSay(llGetScriptName() + " Entry Default State");
state secondState;
}
link_message(integer sender, integer num, string str, key id) {
llOwnerSay(llGetScriptName() + " In Default State");
}
}

state secondState {
state_entry() {
llOwnerSay(llGetScriptName() + " Entry secondState");
}

link_message(integer sender, integer num, string str, key id) {
llOwnerSay(llGetScriptName() + " In secondState");
}
} ]
Ralph Doctorow made changes - 20/Jul/08 12:23 PM
Link This issue Relates to SVC-1853 [ SVC-1853 ]
Ralph Doctorow added a comment - 20/Jul/08 12:23 PM
Same issue I suspect just a different way to expose the bug.

Sue Linden made changes - 13/Nov/08 12:05 PM
Workflow jira-2007-12-22a [ 56903 ] jira-2008-11-14 [ 81168 ]
Sue Linden made changes - 13/Nov/08 04:32 PM
Workflow jira-2008-11-14 [ 81168 ] jira-2008-11-14a [ 87713 ]
Sue Linden made changes - 13/Nov/08 04:53 PM
Workflow jira-2008-11-14 [ 87713 ] jira-2008-11-14a [ 94711 ]
Hidenori Glushenko added a comment - 30/Dec/08 02:46 AM
I've met this bug in my product on Second Life Server 1.24.9.98659

And I can repro this bug with both of LSL2 and Mono compiled scripts.


Harleen Gretzky made changes - 15/Apr/09 09:17 PM
Link This issue duplicates SVC-26 [ SVC-26 ]
Harleen Gretzky added a comment - 15/Apr/09 09:18 PM
Duplicate of SVC-26

Harleen Gretzky made changes - 02/Jun/09 10:03 AM
Link This issue is original of duplicate SVC-4329 [ SVC-4329 ]
Harleen Gretzky made changes - 06/Jul/09 09:42 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Duplicate [ 3 ]