|
|
|
[
Permlink
| « Hide
]
Strife Onizuka added a comment - 18/Aug/08 04:15 PM - edited
That's interesting. I can imagine why it might have been done intentionally but I'm unsure if it is a good idea or not. It has the feel of 2004 about it. Ask Andrew Linden about it.
Sim Details:
You are at 270060.0, 257468.8, 400.8 in White Wolf located at sim4974.agni.lindenlab.com (216.82.27.185:13001) Second Life Server 1.24.3.95195 I have noticed that since the MONO release, events are not being cleared after an llResetScript (This bug doesn't just affect attach scripts), some of my scripts using dataserver and notecard reading have been getting null keys after a reset. This has been occuring ever since the Mono release and worked perfectly before. I have gutted the script and changed it so that it can be triggered by touching. Too protect my games work, and all ^^; Notecard is also in this message and is labelled "settings". Script: key player = ""; // for notecard reading next_line() reset_script() default { if(llGetInventoryName(INVENTORY_NOTECARD,0) == gNotecard) { gLine = 0; dataserver_key = llGetNotecardLine(gNotecard, 0); }else { llSay(0, "Settings not detected! Auto-setting!"); objname = "Default Name"; sittext = "Sit on me for no reason!"; animation = "haruhi_loop"; loseanimation = "yatta"; winanimation = "carameldansen"; timercount = 0; minutestoend = 5; offset = < 0.0, 0.0, -0.1 >; } llSitTarget(offset,ZERO_ROTATION); touch_start(integer num_detected) { llUnSit(player); llResetScript(); } run_time_permissions(integer perm) } changed(integer change) { } if (change & CHANGED_INVENTORY) {
llSay(0, "Inventory change detected. Resetting script now. Please wait.");
llResetScript();
} dataserver(key queryid, string data) if(data != EOF) if(llGetSubString(data,0,7) == "sittext:") { sittext = llGetSubString(data,9,-1); llSetText(sittext, <1,1,1>, 1.0); next_line(); return; }if(llGetSubString(data,0,9) == "animation:") { animation = llGetSubString(data,11,-1); next_line(); return; }if(llGetSubString(data,0,12) == "winanimation:") { winanimation = llGetSubString(data,14,-1); next_line(); return; }if(llGetSubString(data,0,13) == "loseanimation:") { loseanimation = llGetSubString(data,15,-1); next_line(); return; } if(llGetSubString(data,0,6) == "offset:") else if(offset == <0,0,0>) next_line(); if(llGetSubString(data,0,7) == "minutes:") { minutestoend = (integer)llGetSubString(data,9,-1); next_line(); return; }if(llGetSubString(data,0,13) == "winpercentage:") { winpercentage = (integer)llGetSubString(data,15,-1); next_line(); return; }if(llGetSubString(data,0,13) == "winanimlength:") { winanimlength = (integer)llGetSubString(data,15,-1); next_line(); return; }if(llGetSubString(data,0,13) == "loseanimlength:") { loseanimlength = (integer)llGetSubString(data,15,-1); next_line(); return; } next_line(); Notecard (Must be named "settings"):
When the script is used in Mono, it gives the "ERROR! Dataserver cannot read notecard!" message while in Pre-Mono, it works perfectly. To reproduce, put the settings notecard in an object and my script into an object and sit, then click on the prim to unsit and reset the script. It may produce an error about the animation not being found (because I didn't include them, of course), but that can be ignored. Hi Lashek,
I added your script and the settings note to a box, then I sat on the box. I didn't get that message in LSL, nor in Mono. Then I tried this script: // dataserver-event survives reset in LSL dataserver(key queryid, string data) { // say data, and do a new query before resetting llSay(0, data); notecard_query = llGetNotecardLine("New Note", 1); llResetScript(); }} The notecard is called "New Note" and has 2 lines. Output in Mono: [18:40] Object: line 1 Output in LSL: [18:40] Object: line 1 So, indeed the event survives a reset in LSL. // LSL linked message survives reset
default { state_entry() { llMessageLinked(LINK_THIS, 1, "", ""); } link_message( integer sender_num, integer num, string str, key id ) { llSay(0, (string)num); llMessageLinked(LINK_THIS, 2, "", ""); llResetScript(); }} Mono: [22:25] Object: 1 LSL: [22:25] Object: 1 I think the dataserver result can be explained by Mono just being faster, takes less time to read the notecard and queue the event, 0.1 seconds is plenty of time for a notecard line lookup and to queue a dataserver event.
I suspect in LSO event queuing is just slower then it is in Mono. The script reset may be slower in Mono. To test if it is a timing issue, put a llSleep(0.2) before the llResetScript() in both scripts and rerun the test. Hopefully during that time it will give the events in the LSL test time enough to queue.
Script reset could also work slightly differently on Mono. In LSO the event queue might be cleared early on during the reset, in Mono it might happen last. I originally thought that as well, so I put a 3 second sleep in front of my resets beforehand as well, and still, it doesn't have any effect.
While I know the goal of Mono is to make scripts faster and work better, it's actually broken alot of mine to the point that I have to recompile the scripts to reset them... and I can't use llResetScript anymore to do it effectively. Recompiling actually resets the events for me while llResetScript doesn't even TOUCH the events. Basically, in my script, the dataserver key is different then what it should be and this is ONLY when it gets reset. I went so far as to put llSleep's after just about everything (for about 1-3 seconds) and it still results with the same effect which NEVER occured in pre-mono days. This confirms to me that it's not something that can be fixed in the script by us ourselves but in the LSL engine itself and it is, indeed, a bug. Adding a llSleep(3) before the reset doesn't make any difference. Of course the script is inactive during the sleep, so I tried:
integer i; The results are the same. ======= Why Lashek's script gives the message is unclear to me, because there is no llResetScript() inside the dataserver-event. I had a flash of inspiration. I guessed you ran your tests in a dual LSO-Mono sim and not two different simulators.
You forgot to consider that LL might have broken llResetScript for LSO when they implemented Mono. It turns out if you run your LM and Dataserver test scripts in a Legacy Havok1 sim it returns the same results as your Mono tests. I performed the tests in Fame on the beta grid (Aditi). llResetScript for LSO on Mono sims does not properly clear the event queue. I'm believe that LL changed the implementation of llResetScript to support Mono and in the process partially dropped LSO support. I'm raising the priority since this is a Major change in LSO VM behavior. It has been reported in
Good news everyone..
There is a fix running on Aditi for the reset. I tried: attach() All of these events are canceled by a reset in LSL scripts now. ======= Note: Other problems with state-changes and timer are still there: VWR-9023 llResetScript in touch_start() results in double touch_start() event (Mono & LSL) ======= Second Life 1.21.0 (94829) Aug 20 2008 23:45:42 (Second Life Public Nightly) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||