Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

newbie trying to use setobjectname but its not working as expected.

Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 11:18
I read this in the wiki:
You can also stick llSetObjectName in the "dead" state's state_entry().
This would rename it to something like "Expired Attachment - Delete Me", indicating to the
inventory's owner that they're free to get rid of it.

I interpreted that to mean that if I did that it would change the name in the persons inventory so they would know it was trash. It changes the name when the object "says" something but the name in the inventory remains unchanged. What am I doing wrong?
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
11-04-2006 11:42
Actually, I think the wiki may be wrong in this case. This is a known bug (that llSetObjectName() doesn't update the inventory name of an attachment if called while it's worn) which has been around for awhile, and I think the Lindens have written that it's difficult to solve properly.
Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 11:47
Thanks for putting me out of my misery. I'll give up now that I know its useless.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-04-2006 11:57
The attachments description suffers similarly i believe but it has been a while since i've checked this.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-04-2006 13:00
There is a reason for this behavior, which is perfectly logical when you consider why permissions you set on inventory items get lost when you rez items in-world.

It turns out that the object and the inventory item are two seperate entities. The inventory item merely points to the object`s underlying asset.

If changing the permissions on the proxy entity in inventory does not change the permissions of the underlying object [and it does not], why should changing the name of the underlying object change the name of the inventory proxy?

When you Take an object, you are creating a brand-new inventory proxy for the underlying object, and the permissions for the new proxy are copied from the object asset. When you rez an object, the permissions that were saved with the object are restored in-world with the rest of the object, and not taken from the inventory proxy.

If the permissions on an inventory item are disjoint from the permissions on the underlying asset, why should the name be any different?

This, in turn, explains oddities in the Appearance Editor.

Again, assume that the inventory item for an item of clothing is just a proxy for the actual asset. Rename the inventory item for an item of clothing. Now wear it, and examine it in the Appearance Editor. It would seem that the underlying asset is still using the name it was created under, not the name the inventory item was renamed to.

All sorts of What the Bleep? behavior is suddenly explained when one understands that inventory items are independant entities that merely point to assets, yet have properties all their own.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 13:43
Not sure I totally understand all that but what about objects that there is only one of because its not copyable?
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-04-2006 13:54
From: Spacey Maa
Not sure I totally understand all that but what about objects that there is only one of because its not copyable?
The inventory proxy and the object asset are still distinct.

When you rez an object whose inventory proxy item`s Copy permission is set to No, the inventory item is deleted. When you rez an object whose inventory proxy item`s Copy permission is set to Yes, the inventory item is not deleted. In either case the object asset is copied into the server`s active memory.

When you later Take an object back into inventory, you get a brand new inventory proxy item, which points to what I presume is a brand new copy of the asset as it existed within the server`s memory. In the case of Take Copy, the copy within the server`s memory is left behind, while in the case of Take, the copy within the server`s memory is deleted.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 14:08
Then if it is a new inventory proxy why doesn't it have the new name?
Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 14:34
I have been experimenting with a box. If I rez it and touch it, it changes names no problem. If I wear it and touch it and then drop it, it also changes names. But if i wear it and then detach it, it doesn't change names. Not sure why there would be a difference between dropping and detaching except with detaching you don't have to take it back into your inventory. Maybe that is the key point.
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-04-2006 14:38
From: Spacey Maa
Then if it is a new inventory proxy why doesn't it have the new name?
You do. I was discussing how rezzing objects from inventory works, to explain why attachments have issues. I was not explicitly discussing the way the mechanism is "abused" to make attachments possible. I apologize that I was insufficiently clear.

The situation is slightly different for attachments, however. When you attach something from inventory, and later detach the item, you have not created a new inventory proxy item, but are still using the old inventory proxy item, which is not modified. Thus, when the name on the asset changes, the name of the inventory proxy that points to it is unaffected.

Don`t worry that I`m confusing you. This confuses me, too.:o Heck, I knew about the dichotomy between inventory items and assets, and I was still surprised when reading what Kelly posted about it recently in Linden Answers.

Footnote: I say "abused" above because it is clear that the original design of the object/inventory system was not intended to support attachments. The work-arounds within the Second Life codebase that allows this anyway have left a legacy of oddities that are plain to see for those who know how to recognize them. This situation is one of them. This dichotomy between the asset and the inventory proxy is also the root of many an answer of "that would be very difficult right now" regarding inventory-related feature requests.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-04-2006 14:39
From: Spacey Maa
I have been experimenting with a box. If I rez it and touch it, it changes names no problem. If I wear it and touch it and then drop it, it also changes names. But if i wear it and then detach it, it doesn't change names. Not sure why there would be a difference between dropping and detaching except with detaching you don't have to take it back into your inventory. Maybe that is the key point.
It is.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 14:52
Then is there any way to have a script cause an attached object to drop instead of detach?
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-04-2006 15:20
All I can find is this:
From: lslguide.html
A.29. llDetachFromAvatar

llDetachFromAvatar(key avatar);

Drop off of avatar.Alas, the wiki avers that this does not drop the item, but rather detaches it, as the name implies.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Spacey Maa
Registered User
Join date: 25 Sep 2006
Posts: 7
11-04-2006 15:27
Thanks.
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-04-2006 15:40
You`re welcome. I just wish my help could have been more useful. meanwhile, keep an eye on this.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?