Hi
I have an object which will be giving other objects from it's inventory to other AV's
What i would like to do is change the description of the object I am giving before it is given to the AV.
Any one know if this is possible?
thanks
These forums are CLOSED. Please visit the new forums HERE
Changing object description before giving to an AV |
|
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
|
10-23-2009 05:04
Hi
I have an object which will be giving other objects from it's inventory to other AV's What i would like to do is change the description of the object I am giving before it is given to the AV. Any one know if this is possible? thanks |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-23-2009 05:30
llSetObjectDesc(). See http://lslwiki.net/lslwiki/wakka.php?wakka=llSetObjectDesc
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
|
10-23-2009 05:44
Thanks, but
That only seems to work from within the object itself. I want to change the description of an object in the objects inventory. Basically what I am planning involves an object which when touched will give the user an object from it's inventory. I wanted to set the object description in the object being given to a unique value before it's given, so that when the users rezzes the recieved object it can use that value to recieve data from a web page. Using the avatar UUID is not practical for this as it is possible the avatar may recieve more than one of these these items, and would need to recieve a different response depending on which on is rezzed. |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-23-2009 06:37
Ah.... So you put a script in the object that looks something like this...
CODE
The object's description won't be changed as it is given, but when it is rezzed for the first time. Your script removes itself at that point. _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
|
10-23-2009 07:12
Ok, that's good,
but the unique description needs to be generated by the object going the giving, hence the requirement to set it just before the inventory object is given to the AV. But it's looking like that's not possible.... Time to rethink my concept I guess .... |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-23-2009 08:08
Still no problem, although it makes life more complicated for you to set it up. Structure your on_rez event so that it sends an e-mail to the vendor identifying itself and then receives a unique response that sets its object description.
CODE
In your vendor script, you include parallel language that receives the e-mail from the newly-rezzed object and sends a message that is to be stored as its description. This takes a little more work than you might have expected, but it's not impossible. ETA: Ah.... I forgot to include the bit about removing this script once it has done its job. If you don't do that, it will send a new e-mail and reset its description every time the new owner rezzes it..... ![]() _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
|
10-23-2009 08:37
that's very helpful thanks.
![]() |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-23-2009 09:54
YW. I should probably mention that e-mail can be a bit clumsy at times. I haven't had much trouble myself, but it may take several cycles or, if SL's e-mail system hangs, a longer time for a message to get through. It's probably smart to put a few llOwnerSay calls in the script to let the new object's owner know what's happening. In the on_rez event, put something like ...
llGetOwner("Thank you for your purchase. Product registration is in progress ....." ![]() and then in the timer event, put another one like .. llGetOwner(" .... still working. If registration is not complete within 2 minutes, please contact me by IM for assistance. Niall Braveheart" ![]() and finally, in the email event .... llGetOwner("Registration is complete. Enjoy your product." ![]() A little cosmetic dressing can soothe anxious customers. ![]() _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Lear Cale
wordy bugger
![]() Join date: 22 Aug 2007
Posts: 3,569
|
10-23-2009 13:37
I would use the rezzed object's key as the unique ID, rather than having the giver-object create it.
Of course, if the object is copiable to next owner, it gets more comlicated, because its key will change each time it's rezzed. In that case, if rez-arg is nonzero, it gets its key and sets its description to the key. After that the description is used. |
Lear Cale
wordy bugger
![]() Join date: 22 Aug 2007
Posts: 3,569
|
10-23-2009 13:40
ETA: Ah.... I forgot to include the bit about removing this script once it has done its job. If you don't do that, it will send a new e-mail and reset its description every time the new owner rezzes it..... ![]() |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-23-2009 13:54
Easily avoided by rezzing with nonzero rez arg, and only doing the init behavior if rez arg is nonzero. True. I just figure there's no reason to keep a script around once it's not needed. Extra baggage. _____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Lear Cale
wordy bugger
![]() Join date: 22 Aug 2007
Posts: 3,569
|
10-24-2009 07:20
True. I just figure there's no reason to keep a script around once it's not needed. Extra baggage. |
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
10-25-2009 01:02
If you're communicating with the web anyway, why not get your unique value from your server on_rez instead? This way you can keep your values unique and if you are tracking your items by uuid, serial #, and owner then it's easier to do so in your database, and your web script will know if it's a newly bought product or something being re-rezzed, or if you throw in some http-in you'll even be able to tell if someone has more copies inworld than they should.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-25-2009 05:33
I didn't get the impression that the OP was communicating with an external server. If he were, though, that would open up a whole new realm of data possibilities, as you say.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
|
10-25-2009 12:58
Well ultimately it will be communicating to an external server.
The object is effectively a gift, and the purchaser will have an option to leave a additional info for the recipient, which will be stored on a server and retrieved at rez time. The unique ID will be generated when the purchaser completes the purchase, which is why i want to set ot when the object is given to the utlimate recipient. It's possible an AV could recieve more than one objext from onr than one sender, so using the recipient AV's UUID isn't an option either (oh how much simpler that would be!!) The object's UUID would be perfect too, but as that wouldn't be known until the object was rezzed i don't see how it can work in this scenario. |
Lear Cale
wordy bugger
![]() Join date: 22 Aug 2007
Posts: 3,569
|
10-25-2009 14:05
The object's UUID would be perfect too, but as that wouldn't be known until the object was rezzed i don't see how it can work in this scenario. |
Niall Braveheart
Registered User
Join date: 5 Oct 2008
Posts: 27
|
10-25-2009 14:55
Unfortunately the object won't be rezzing it, but giving it directly to the other AV
who may then rezz it at anytime and/or location that suits them |
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-25-2009 15:24
That's exactly why I suggested having it register with the vending object when the new owner rezzes it. It doesn't need a unique ID until it is rezzed, so don't worry about creating one during the sale process. You can build a unique number in any number of ways (I suggest using a portion of the new owner's key, maybe adding a bit of the object's key or a model number... whatever) and then you have the object e-mail that number back home to the vendor. Now, if you're really going to be working with an external server, it does make sense to build a database of unique numbers there instead, as ElQ suggested. The idea's the same, though..... create an ID when the new owner rezzes the object and then send it somewhere that you can find it later, in world or outside.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |