• 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-4497
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: darling brody
Votes: 21
Watchers: 3
Operations

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

llSetScriptState() resets the script !

Created: 06/Jul/09 11:46 AM   Updated: 26/Aug/09 03:19 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Issue Links:
Duplicate
 

Last Triaged: 24/Aug/09 08:34 AM


 Description  « Hide
llSetScriptState() can be used to toggle on and off scripts that are not needed to help lower lag, however if you teleport, relog, or detach the object while it's state is set to not-running the non-running script will do a hard reset when it is turned on again.

This makes the function usless for pausing scripts attached to avatars when those scripts need to remember infomation.

eg: Teleport history HUD with a minimize button that pauses the hud. If you teleport while it is paused it will reset and lose all data!

REPRO

1) Place the below two scripts into an object.
2) let it count up for a minute.
3) touch it. note it pauses.
4) touch again and note it will continue where it stopped. (this is expected behaviour)

5) Touch the object to pause the counter again.
6) Take the object into inventory while it is still paused.
7) Rez the object in world again. note it is still paused.
8) Touch object to restart the counter. Note the count is reset. (unexpected results = BUG)

9) Test with teleport and relog while paused for same unexpected results.

//
// This script toggles on and off the counter script
//
// Name this script "control"
//
default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        if (llGetScriptState("counter") == FALSE)
        {
            llSetScriptState("counter", TRUE);
        }
        else
        {
            llSetScriptState("counter", FALSE);
            llSetText("paused",<1,0,0>,1);
        }
    }
}
//
// This script counts up continuesly, unless paused or reset
//
// Name this script "counter"
//
// If this script is turned off when you teleport/detach/relog it will incorrectly reset
//
integer count;
default
{
    state_entry()
    {
        llSay(0, "script reset");
        llSetTimerEvent(1);
    }
    timer()
    {
        count = count + 1;
        llSetText((string)count,<1,1,1>,1);
    }
}


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Harleen Gretzky made changes - 06/Jul/09 01:16 PM
Field Original Value New Value
Link This issue duplicates SVC-26 [ SVC-26 ]
Harleen Gretzky made changes - 06/Jul/09 01:16 PM
Link This issue duplicates SVC-1853 [ SVC-1853 ]
Harleen Gretzky made changes - 06/Jul/09 01:16 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Duplicate [ 3 ]
darling brody made changes - 06/Jul/09 08:55 PM
Resolution Duplicate [ 3 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Cummere Mayo made changes - 13/Jul/09 11:07 AM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Duplicate [ 3 ]
darling brody made changes - 23/Aug/09 02:22 PM
Resolution Duplicate [ 3 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Alexa Linden made changes - 26/Aug/09 08:34 AM
Status Reopened [ 4 ] Resolved [ 5 ]
Last Triaged 24/Aug/09 08:34 AM
Resolution Duplicate [ 3 ]