Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to know the last owner of an object?

Own Westland
Second.Life@msn.com
Join date: 24 Dec 2007
Posts: 49
03-02-2008 02:55
How to know the last owner of an object? Is there a script for it? Or just a function? Or other process available for it? ... ?
_____________________
Helpful MSN Group: Second.Life@msn.com
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
03-02-2008 04:25
You can use the changed(integer change) event:
CODE


changed (integer change)
{

if (change & CHANGED_OWNER)
{
llSay (0, "New owner key is: " + llGetOwner() );
}
}


Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-02-2008 06:20
From: Own Westland
How to know the last owner of an object? Is there a script for it? Or just a function? Or other process available for it? ... ?

by storing it in the script, most likely in a list.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
03-02-2008 08:15
key oldowner;//memorizes llGetOwner() before it can change.

on_rez{
oldowner=llGetOwner(); //memorize the actual owner of the prim. it is the old owner on the first rez IF the prim has been copied to someone elses inventory.
llResetScript;//sets llGetOwner() to actual prim owner, if the prim owner changed since the last rez llGetOwner() will now return aa different key.
}state_entry{
if (oldowner!=llGetOwner());llSetObjectDesc( llKey2Name (oldowner)); //if the owner changed, store NAME of old owner in object description the first time the object is rezzed by a changed owner.
oldowner=llGetOwner();//memorize actual prim owner in case the owner will change inworld after rezzing.
}changed (integer change){
if (change & CHANGED_OWNER){
llSetObjectDesc( llKey2Name (oldowner));//stores NAME of the old owner in object description.
}}
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-02-2008 11:41
does state entry fire before on rez ? I honestly can't remember... might want to have the above code from state entry in a function called by both on rez and state entry if it doesnt
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-02-2008 12:28
Unfortunately there's no way to tell FOR SURE. If a resident obtains an object, then passes it along without having attached/detached it, or rezzed in-world and re-taken it, there's no way for a script to determine that person ever owned it. My suggestion is to remove from your design/requirements any dependence on having to know the ownership history of the object. Or start caring only about who has (owned AND) USED the object maybe....
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-02-2008 12:31
From: Void Singer
does state entry fire before on rez ? I honestly can't remember... might want to have the above code from state entry in a function called by both on rez and state entry if it doesnt

Yes. There's no way to stuff into, or start a script in, an object that's not rezzed, so if the script is running at the time you rez the object, the script will definitely already have had its default state_entry called.
Own Westland
Second.Life@msn.com
Join date: 24 Dec 2007
Posts: 49
03-03-2008 00:20
Yes, that's really my concern. For example, resident A sent an object to resident B by draging it from the inventory of A. How does the object know its last owner is A?
_____________________
Helpful MSN Group: Second.Life@msn.com
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-03-2008 01:33
From: Own Westland
Yes, that's really my concern. For example, resident A sent an object to resident B by draging it from the inventory of A. How does the object know its last owner is A?

Answer: it can't.