
| Key: |
SVC-4329
|
| Type: |
Bug
|
| Status: |
Resolved
|
| Resolution: |
Duplicate
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Haravikk Mistral
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Issue Links:
|
Duplicate
|
|
This issue duplicates:
|
|
|
SVC-26 Scripts being reset when not running.
|
|
|
|
 |
|
SVC-1853 State of not-running scripts is not preserved over a region restart
|
|
|
|
|
SVC-2558
Inactive scripts loose their state when taken and re rezzed, active scripts remember their state.
|
|
|
|
|
|
|
|
This is an annoying, and quite serious bug.
If a script is set to not-running by another script (or by itself), then upon teleporting to another region or logging out it is silently reset (or its VM is discarded). This means that when the script is re-activated, it will begin from default state_entry() with default-values.
This is quite serious, because as we know scripts actually impact simulator performance even when idle, so it makes sense to set them to not-running automatically if they aren't needed, and simply start them running again when they are. However, if they reset as a result then this limits what scripts we can actually do this for to only very simple ones (i.e - that don't retain data, or contain any start-up code that could affect other scripts).
You can verify this with the following simple scripts:
integer on = TRUE;
default {
touch_start(integer x) {
if (on = !on) {
llOwnerSay("Deactivating Slave");
llSetScriptState("Slave", FALSE);
} else {
llOwnerSay("Activating Slave");
llSetScriptState("Slave", TRUE);
}
}
}
default {
state_entry() {
llOwnerSay("I was reset!");
}
}
Place them both in an object, and attach it to your HUD. Name the first whatever you want, and the second "Slave". Now, touch the object to deactivate Slave, teleport somewhere else (another region), and click it again re-enable Slave. If you are observing the same problem as I am, then Slave will say "I was reset" upon being re-activated, even though it should be sitting idle.
This of course isn't a peculiarity of the above "Slave" script having only a state-entry, it affects more complex/functional scripts too.
|
|
Description
|
This is an annoying, and quite serious bug.
If a script is set to not-running by another script (or by itself), then upon teleporting to another region or logging out it is silently reset (or its VM is discarded). This means that when the script is re-activated, it will begin from default state_entry() with default-values.
This is quite serious, because as we know scripts actually impact simulator performance even when idle, so it makes sense to set them to not-running automatically if they aren't needed, and simply start them running again when they are. However, if they reset as a result then this limits what scripts we can actually do this for to only very simple ones (i.e - that don't retain data, or contain any start-up code that could affect other scripts).
You can verify this with the following simple scripts:
integer on = TRUE;
default {
touch_start(integer x) {
if (on = !on) {
llOwnerSay("Deactivating Slave");
llSetScriptState("Slave", FALSE);
} else {
llOwnerSay("Activating Slave");
llSetScriptState("Slave", TRUE);
}
}
}
default {
state_entry() {
llOwnerSay("I was reset!");
}
}
Place them both in an object, and attach it to your HUD. Name the first whatever you want, and the second "Slave". Now, touch the object to deactivate Slave, teleport somewhere else (another region), and click it again re-enable Slave. If you are observing the same problem as I am, then Slave will say "I was reset" upon being re-activated, even though it should be sitting idle.
This of course isn't a peculiarity of the above "Slave" script having only a state-entry, it affects more complex/functional scripts too. |
Show » |
|
SVC-2558.