Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to make an object change owners

Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-05-2007 21:22
Okay, maybe I'm missing something extremely simple here, but I've searched a ton and just can't find any info on this.

I'm scripting a Vendor to distribute objects that require some customization. So to do this, when a user buys an object, instead of the Vendor giving it directly to them (ie, with llGiveInventory), the Vendor is going to rez the object, do some back and forth communication with it so it can customize itself, and then once that it done, the Vendor will inform the user that the object is ready for them to take.

However, when the Vendor rezzes the object, it ends up with me being the owner. I want to be able to change the ownership so that the person who bought it is the owner. But I don't see how to do it!

Anyone able to point me in the right direction? (The object is no-mod/no-copy, if that matters)
Dnel DaSilva
Master Xessorizer
Join date: 22 May 2005
Posts: 781
01-05-2007 21:26
You can't rez an object with a different owner, nor change owners of an object, without the person becoming the owner interacting with the item in some fashion. Imagine the greifing possibilities, as one example, if anyone could 'make' an item owned by someone else.

Best I can think of off of the top of my head is to set the item for sale for a nominal fee, like L$0 or L$10, although this of course opens up the possibility of anyone in the vicinity buying it and kind of 'stealing' it.
_____________________
Xessories in Urbane, home of high quality jewelry and accessories.

Coming soon to www.xessories.net

Why accessorize when you can Xessorize?
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
01-05-2007 21:55
alternatively:


have a demo model for the person to customize, and have said model store it's customization settings. then instruct the buyer that when they buys their version (un-customized), they need to rez it near the vendor and say some pass-code (randomly generated per sale, or hard-coded), once the pass-code is said the demo object then broadcasts it's configurations out to the rezzed one, which then configures itself. you could even charge a small fee for the customization process so that if people changed their minds on how they wanted it they could just bring back their object and re-customize it. I'm developing a similar system for my R/C car demolition derby game.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-05-2007 23:40
From: Dnel DaSilva
You can't rez an object with a different owner, nor change owners of an object, without the person becoming the owner interacting with the item in some fashion. Imagine the greifing possibilities, as one example, if anyone could 'make' an item owned by someone else.

Best I can think of off of the top of my head is to set the item for sale for a nominal fee, like L$0 or L$10, although this of course opens up the possibility of anyone in the vicinity buying it and kind of 'stealing' it.


This sounds like I may be able to work with it. What do you think of this idea?

Set up my vendor so that it doesn't acutally sell the object - it goes through the customization user interface to get all the data. Then it rezzes the object and performs the customization. Then it actually sets the object itself for sale for the full price.

The user then actually buys the rezzed object directly.

That solves my transfer of ownership issue while still allowing me to do all the customization. It has the added benefit of showing the user directly a real living copy of what they are going to buy, with their own customization settings.

I can also simply include an llDie in the script so that if the user changes their mind and walks away without buying it, the object will delete itself in a default amount of time (like 60 seconds) And finally, I haven't looked too deep into the money() event yet, but I'm assuming that I can just run a check to make sure that the person paying the object is the same person who interacted with the Vendor to do all the customization in the first place, and thus avoid someone trying to "steal" it (even though they'd have to pay full price to walk away with it anyway)

Think that'll work? Any pitfalls with a plan like that? Anything I'm not thinking of?
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-06-2007 09:50
Well, after much hair pulling, I'm still stumped!

My previous idea doesn't seem to work well, since I can't really use that to track whther or not the user actually wen't through with the purchase. Moving the "buy" action out to the object once it's rezzed completely cuts the Vendor out of the loop, and the Vendor doesn't know what the user decided.

So, back to trying to figure out another solution.

Basically, my Vendor Rezzes an object and then does some communication with that object to customize it. Once the customization is complete, I want to allow the purchaser to take the item. But since it gets rezzed with me as the owner, how can I do that? Am I missing something simple here?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-06-2007 09:52
What sort of customisation is your vendor doing that the object itself couldn't?
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
01-06-2007 10:06
If you have a spare computer, you could always hire a child worker from india to be your vendor.


Just an idea!
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-06-2007 10:10
From: Ordinal Malaprop
What sort of customisation is your vendor doing that the object itself couldn't?


The customization involves external communication with a database to determine certain attributes that may be available that the user needs to know about prior to purchase. It also involves "stamping" the object with a unique serial number that the vendor puts into that database for sales tracking purposes and technical-support/customer service issues down the road. So that is all stuff that sort of needs to happen prior to the user "taking possession" of the object. I've done all the scripting necessary to get all of this to happen and get the object completely ready for the user to take possession.

Now the object is sitting there, right in front of the purchaser, all ready for them to take it. But it still thinks that I am it's owner. So how do I let the purchaser take it?
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
01-06-2007 10:20
From: Edison Swain


Now the object is sitting there, right in front of the purchaser, all ready for them to take it. But it still thinks that I am it's owner. So how do I let the purchaser take it?


Is he still there? Why don't I have patient customers like this?.





ps. Please feel free to stab me in eye with something very sharp.
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
01-06-2007 11:11
Ok, so what you are going to do is this:

Vendor rezzes object for person, then sends data to object where it will be customized.

Vendor also sends the name of the person who was customizing it.

After buying the item, have it do a check for owner when rezzed the first time. If the owner is the cutomizer, great, disable die mode or whatever, if not, then blip - it dies.

On the Vendor side, have it send a die message out to the object. Right before the object dies, it sends a confimation back to the vendor.

If the object was bought, the vendor obviously wont get a response.

...and the peasants rejoice.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-06-2007 11:12
From: Edison Swain
The customization involves external communication with a database to determine certain attributes that may be available that the user needs to know about prior to purchase. It also involves "stamping" the object with a unique serial number that the vendor puts into that database for sales tracking purposes and technical-support/customer service issues down the road. So that is all stuff that sort of needs to happen prior to the user "taking possession" of the object. I've done all the scripting necessary to get all of this to happen and get the object completely ready for the user to take possession.

Now the object is sitting there, right in front of the purchaser, all ready for them to take it. But it still thinks that I am it's owner. So how do I let the purchaser take it?

Well, the object can communicate with the database and "stamp" itself on its first rez, and then delete the script; giving the user information before purchase can be done by the vendor but you don't need to modify the object to do that.

If you really don't want to do that, you could have some system whereby the object is also "stamped" with the key of the potential buyer, and set to be bought as an original at L$0 when rezzed (this would depend on whether sell status is persistent across rezzing, of which I am not sure, and for some reason I can't log in to check, bah). Then, when rezzed or used, the script checks to see whether the owner is the right person - if not, it kills itself in some way (wipes all its scripts, llDie etc).
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-06-2007 12:10
Dustin and Ordinal, thanks for the info. I'll give your ideas a try.

In the meantime, I did come up with another idea. Anyone see any downfalls with this?

I think that I can set the permissions in the object to "Allow Anyone to Copy". I also set the Next Owner Permissions of the object to No-Mod/No-Copy.

In the script of the object, I use the changed() event to detect a CHANGED_OWNER.

This way, once the object is rezzed and the customization complete, the purchaser can simply take a copy of the object. Once they have done so, the changed() event in the rezzed version will detect that there was an ownership change and perform an llDie to delete itself. And the purchaser walks off with their own No-Mod/No-Copy version of their customized object.

I think I may still have problems with someone having the ability to "lurk and steal" while standing near the purchaser. It would be nice to be able to set an object to "Allow (specific key) to Copy", instead of "Allow Anyone to Copy"!

Thanks for the help everyone - I really appreciate it!
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-06-2007 12:29
If you allow anyone to copy it, the original will stay and not know that it's been copied - it hasn't changed owner, though the copy will have and a changed() event will trigger as soon as it is rezzed.

Do note that llDie does not work on attachments, so if this is an attachment you will have to do something else in case of the wrong person picking it up.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-06-2007 12:50
From: Ordinal Malaprop
If you allow anyone to copy it, the original will stay and not know that it's been copied - it hasn't changed owner, though the copy will have and a changed() event will trigger as soon as it is rezzed.

Do note that llDie does not work on attachments, so if this is an attachment you will have to do something else in case of the wrong person picking it up.


It's not an attachment, so that's no worry.

As per the wiki:

http://www.lslwiki.com/lslwiki/wakka.php?wakka=changed

half way down in the large table, it states that:

"changed() is triggered: in the original object when a user takes the object or a copy of the object."

So the original should know that someone took a copy, shouldn't it?

I'll have to do some testing, but not sure if I'll get to that today!
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-06-2007 13:04
Hm, I wouldn't have thought that would have triggered (not exactly logical!) but based on what's there it would seem that it is. I've not tried it myself but it would be convenient for you if it worked.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-07-2007 21:24
Just wanted to give a huge thanks to those who helped me out in this thread. Especially Dustin and Ordinal, who gave me good ideas.

After a lot of tinkering, I finally got a process that I'm happy with. It basically involves rezzing the Object and having it set itself for sale. So the user actually buys the Object directly instead of paying the Vendor. I keep the Object transparent while completing the customization process, so the user can't buy it prematurely (in case of customization delays due to communication lags). Then transparency is set to zero, and they are told it is ready for purchase. If they don't buy it in 30 seconds, it tells the Vendor that it is wasn't purchased then it Dies. And if they do buy it, it tells the Vendor, and it makes sure to tell the user to wait until they receive a "Customization Complete" notification before taking the Object into their inventory. I think this is the best way that I can make sure that everything I need to do gets done.

Anyway, thanks again for all the help! It's greatly appreciated!