|
Puka Sorbet
Registered User
Join date: 7 Jun 2008
Posts: 5
|
06-12-2008 01:36
Hello Everyone,
Your have to excuse my Ignorance on the forum of where to place this - as I'm new to this whole thing. But, I just got into the joy of scripting and was wondering If anyone could give me a hand on a script I'm having a bit of trouble, understanding.
I want to make a Dialog, which people navigate though to buy a product. I think I have the basic understanding of how to do a dialog script - still not sure on that yet - but I don't know how I would embed a buying request into the script, and thus to get what I need.
If anyone has any tips on this, I would be very grateful!
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-12-2008 03:45
Welcome to the forums, and to Scripting Tips. To keep naughty scripters from swindling the public (any more than we do already  ), the functions that take money from purchasers are kind of special, and require an explicit action of the purchaser (either "Buy" or "Pay" from the pie-menu). These can NOT be triggered by a script, as from within a series of dialogs. To use "Pay", the script has to enable the "Pay" button by having a money() event handler. For how this all fits together, one might consult one of the sample "vendor" scripts in the script library. With "Buy", a script can know after the fact if its object (or copy of its object) has been purchased, using the changed() event, specifically CHANGED_OWNER; see http://wiki.secondlife.com/wiki/CHANGED_OWNER. (For completeness: Theoretically it would be possible for a scripted object to be given to the intended purchaser, get debit permission from that purchaser, then go through a bunch of dialogs to decide what to give that purchaser and how much money to take from them. This isn't practical, though: purchasers shouldn't be willing to grant debit permission to such things, and even if they did, the script can't know if any llGiveMoney() transfer to the selling agent was successful--e.g., the buyer may not even have sufficient L$ balance for their purchase, and the script would have no way to know.) Hope this helps.
_____________________
Archived for Your Protection
|
|
Puka Sorbet
Registered User
Join date: 7 Jun 2008
Posts: 5
|
06-12-2008 04:23
From: Qie Niangao Welcome to the forums, and to Scripting Tips. To keep naughty scripters from swindling the public (any more than we do already  ), the functions that take money from purchasers are kind of special, and require an explicit action of the purchaser (either "Buy" or "Pay" from the pie-menu). These can NOT be triggered by a script, as from within a series of dialogs. To use "Pay", the script has to enable the "Pay" button by having a money() event handler. For how this all fits together, one might consult one of the sample "vendor" scripts in the script library. With "Buy", a script can know after the fact if its object (or copy of its object) has been purchased, using the changed() event, specifically CHANGED_OWNER; see http://wiki.secondlife.com/wiki/CHANGED_OWNER. (For completeness: Theoretically it would be possible for a scripted object to be given to the intended purchaser, get debit permission from that purchaser, then go through a bunch of dialogs to decide what to give that purchaser and how much money to take from them. This isn't practical, though: purchasers shouldn't be willing to grant debit permission to such things, and even if they did, the script can't know if any llGiveMoney() transfer to the selling agent was successful--e.g., the buyer may not even have sufficient L$ balance for their purchase, and the script would have no way to know.) Hope this helps. I see. Thank you very much for your help!
|