Bug in 1.12 llGetScriptName()
|
|
Norman Desmoulins
Grand Poohba
Join date: 10 Nov 2005
Posts: 194
|
08-23-2006 05:30
Can others try this in 1.12 (Siva Preview) this and see what happens? llGetScriptName() doesn't work for newly saved scripts, will work for ones that were compiled previously. default { state_entry() { llOwnerSay("script name = <"+llGetScriptName()+">"); llRemoveInventory(llGetScriptName()); } }
I get: [5:23] Object: script name = <> [5:23] Object: Missing inventory item ''
I filed it as a bug report the other day... Milo Linden looked into it... I didn't hear anything back.
|
|
Norman Desmoulins
Grand Poohba
Join date: 10 Nov 2005
Posts: 194
|
08-23-2006 09:35
Anybody try this yet?
|
|
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
|
08-23-2006 10:37
Just tested in 1.12 preview. The New Script button in the object contents now instantly saved the script instead of opening the script window *rolls eyes*. Created a new script in my inventory with just a simple llOwnerSay(llGetScriptName()); and dropped it in; got an empty response back. Open the script and hit the Reset button, responds with the correct name. Had the script reset itself if the name was empty; it reset four times before it came up with the correct name. Then put two OwnerSay's in, with a llSleep(0.1) between them; first one had the empty name, but the second got it right. Seems there's a short delay before the script can get it's name. Had a thought after seeing that and tested llGetInventoryType() with the script name preset (not using llGetScriptName() ). First test came up -1 (i.e. item not found), then after the llSleep(), reported correctly. Then put a script in the contents with a changed() event handler, simply reporting the number of items in the contents. Dropped a random item in the prim, script reported 1 item instead of two. Renamed the object to trigger the changed() event, script reported 2 items. So it's not just the name it can't get, looks like there is a short delay before scripts can see new inventory items, even if the item is itself. 
|
|
Norman Desmoulins
Grand Poohba
Join date: 10 Nov 2005
Posts: 194
|
08-23-2006 11:17
Yes, I have had similar experiences in 1.12... By gollly I hope it only has to do with preview, otherwise we are going to have a ton of problems with the release today. I only found this out on Monday 
|
|
Norman Desmoulins
Grand Poohba
Join date: 10 Nov 2005
Posts: 194
|
08-23-2006 11:40
Ugggg... It's there in "Second Life 1.12.0 (13) Aug 22 2006 15:10:06"
|
|
Norman Desmoulins
Grand Poohba
Join date: 10 Nov 2005
Posts: 194
|
08-24-2006 22:17
More people need to be working in Preview when they announce new beta releases so that more people can find these bugs in time for them to get fixed---although I did report this and it didn't get fixed 
|
|
Shyotl Kuhr
Registered User
Join date: 15 Jun 2005
Posts: 105
|
08-24-2006 22:24
Woah, this thread really got pushed down. I didn't even see it. I'm suprised there aren't more people complaining about this bug. Any object that relies on temp scripts and removal of items in inventory will most likley be broken by this. This isn't as simple as a lsl function behaving oddly. This is a serious bug that has the potential to completley destroy complex scripted objects, with the only remedy being the origonal scripter replacing the messed up scripts. Between a broken Remove, and a really picky GiveInventory, this is a disaster, expecially for things that have update systems.
|
|
CJ Carnot
Registered User
Join date: 23 Oct 2005
Posts: 433
|
08-25-2006 03:00
Ok, I'm having erratic behaviour with llGetObjectName / llSetObjectName which should change a vendor object's name on a changed - CHANGED_INVENTORY event when I drop a product into it. Guessing all these inventory issues are related ?
|
|
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
|
08-25-2006 04:44
From: CJ Carnot Ok, I'm having erratic behaviour with llGetObjectName / llSetObjectName which should change a vendor object's name on a changed - CHANGED_INVENTORY event when I drop a product into it. Guessing all these inventory issues are related ? Right. As I mentioned it my post above, scripts can't see new inventory items (and probably new names of renamed items) for the first fraction of a second after the change. A workaround in scripts would be to add a short delay, such as llSleep(0.5), before using any inventory based function the first time, as in the state_entry() and changed() event handlers. I tested in a good sim, and even a 0.1 delay was enough for the functions to see the change, but a 0.5 delay would be better so it works fine in laggy sims. After that first fraction of a second the functions work fine, it's just that they can't see changes immediately.
|
|
Shyotl Kuhr
Registered User
Join date: 15 Jun 2005
Posts: 105
|
08-25-2006 07:11
Actually, a delay just makes the bug a little less likley to happen. I still have llGetScriptName returning NULL after a full 5 second delay, on a healthy sim with good time dialation and 45fps. Its expecially prominent after remoteloadscriptpin. The delay also in no way helps the problems with removed objects/scripts reappearing after a few minutes.
|