Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Bug with llSetObjectDesc in attachments?

Kermitt Quirk
Registered User
Join date: 4 Sep 2004
Posts: 267
01-01-2006 22:43
I'm positive the way llSetObjectDesc() works in an attached object has changed sometime recently. It seems that when an object is no mod, a script can update the description fine if the object is just rezzed on the ground. But if the object is attached, the description appears to get updated, but when you detach the object the description resets back to what it was when the object was attached.

I know that's probably pretty confusing so here's a simple script that proves my point. To test this do the following...
  1. Create an object, and manually change it's description to 0 (number zero)
  2. Put the script below into the contents of the object
  3. Make sure the object is next owner, no mod, and give a copy to someone
  4. If they rez it on the ground, then touch it, you'll see the number in the hovertext update, and the number in the description update
  5. Now if the same person wears the object and touches it, the number in the hover text will update (which proves it's actually reading the number from the desc, and updating it). While it's attached you can't actually see the description to confirm though.
  6. But then if they drop the object, and check the description, it'll still be back where it was when they attached the object, so the number in the hovertext doesn't match
  7. Touch it again, and the number in the hovertext jumps back to 1 above when they attached it


Definate wierdness going on here. I'm positive this has worked in the past, and it's critical to some of the things I've built. Can anyone confirm this, or am I going completely mad?

CODE
displayNum() {
string num = llGetObjectDesc();
llSetText(num, <1,1,1>, 1.0);
}

default {
state_entry() {
displayNum();
}

touch_start(integer total_number) {
integer num = (integer)llGetObjectDesc();
num++;
llSetObjectDesc((string)num);
displayNum();
}
}
Folco Boffin
Mad Moo Cow Cultist
Join date: 27 Feb 2005
Posts: 66
02-03-2006 14:29
Well, I just tried this and have to agree with you. It doesn't work.

I don't know if it worked in the past or not as I've never used the get/set descriptions on an atatchment before. It seems as though it should work for atatchments and obviously is, but something is also not working as well...

I just had a thought, let me go try it. It's a bit of a hack but it might do the job.
_____________________
^-^

Signed,
Gorgarath,
Whom in this game called Second Life,
plays the avatar Folco Boffin,
and in this game called First Life,
plays the avatar John McDonnell.
Folco Boffin
Mad Moo Cow Cultist
Join date: 27 Feb 2005
Posts: 66
Nope :(
02-03-2006 14:45
Thought I'd try tossing in attach event to detect when detatched and have it set the description again, but that also failed.
_____________________
^-^

Signed,
Gorgarath,
Whom in this game called Second Life,
plays the avatar Folco Boffin,
and in this game called First Life,
plays the avatar John McDonnell.
Kermitt Quirk
Registered User
Join date: 4 Sep 2004
Posts: 267
02-03-2006 21:47
Thanks for confirming that one for me Folco. I was beginning to wonder if I was imagining it. Kinda surprised more people haven't complained about this prob since since the description is really the only permanent data store we have that'll survive a script reset.