WANTED: Vendor script that will give discount to group members
|
Annyka Bekkers
Registered User
Join date: 25 Jun 2007
Posts: 98
|
10-24-2007 10:52
I need a script for a vendor that will let me set one price for the general public and another price for members of my group. Ideally, it would be as transparent to the buyer as possible. So one customer walks up and sees one price, while a group member sees a totally different price. I've seen scripts that will sell only to a groupmember, so I could just set up two separate vendorboxes if I have to, but I'd love to just have it look like one box to the customer if at all possible Thanks! 
_____________________
www.lickdontbite.blogspot.com
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
10-24-2007 11:05
Here's one that asks for everyone_price but gives change, depending on group_price, if the customer has the correct group active while paying the vendor. From: someone // Cost L$ integer everyone_price = 10; // Group cost L$ integer group_price = 5; // Name of new object inside for sale string item = "Object"; default { state_entry() { // Start up. key owner = llGetOwner(); llSetPayPrice(PAY_HIDE,[everyone_price,PAY_HIDE,PAY_HIDE,PAY_HIDE]); llRequestPermissions(owner, PERMISSION_DEBIT); } money(key id, integer tendered) { // The vendor received money. integer sameGroup = llSameGroup(id); integer price = everyone_price; if(sameGroup) { // Customer has correct group active. price = group_price; } if(tendered < price) { // Customer paid too little. Refund. llGiveMoney(id, tendered); llInstantMessage(id, "The purchase price is L$ " + (string)price + ". Your payment of L$ " + (string)tendered + " was refunded to you. Please try again."  ; } else { // The customer has made the purchase. string thanks = "Thank you for your purchase!"; if(tendered > price) { // Customer overpaid. Give change. integer change = tendered - price; llGiveMoney(id, change); thanks += " Your change is L$ " + (string)change; if(sameGroup) { thanks += " due to group discount ^^"; } } // Fulfill vendor's end of the contract. llInstantMessage(id, thanks); llGiveInventory(id, item); } } }
|
Annyka Bekkers
Registered User
Join date: 25 Jun 2007
Posts: 98
|
10-25-2007 08:05
Thanks for the response, Day  Your script is pretty close to what I need and would do the trick, but I'm really hesitant to use it for my new business promotion. I'd have to ask my potential customers to pay full price on faith that my vendors would refund their money. I know from my own shopping habits, that I would be leery of that myself from an unknown vendor. What I really want is something that the customer doesn't really have to think about. If you have the right tag showing, you get one price, any other tag and you get a different price. Its too bad I dont know any scripting, because maybe I'd be able to modify your script to do that. Oi! the complications of SL business drive me nuts! 
_____________________
www.lickdontbite.blogspot.com
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
10-25-2007 15:39
What you *could* do is modify the script so that it lets the customer choose from *both* prices, and if they pay too little, of course, it gives it back. I felt that would cause more discomfort, but it'd not be hard to add, as the money() event is already designed to handle that kind of thing. To have it only show the person only the correct price on the little PayPrice dialog, though, isn't easy like you'd think. A script can't detect when people click an (Click to pay) object trying see what price it wants: it has to set up the price in advance of that. And since there's not any sure-fire way to tell just who is about to ask the object how much it wants, there's not any way to adjust the price just for them. I can think of a few silly things you could try... You could try adjusting the price when a new avatar becomes the closest person to the object, but the closest avatar is certainly not always the next one to give it money. You could get someone to right-click and "Touch" the object before clicking it to see the price, thus locking in their price, but then they'd have to buy before someone else clicks because they may see the wrong price. The problem might can be avoided if you only have one customer browsing your shop at any given time, but it will be there... you just can't tell who is going to be the next one to give money. I hope someone comes up with interesting ideas (: If you want to show both prices to everyone and have them choose, change the llSetPayPrice line in state_entry() from From: someone llSetPayPrice(PAY_HIDE,[everyone_price,PAY_HIDE,PAY_HIDE,PAY_HIDE]); to From: someone llSetPayPrice(PAY_HIDE,[everyone_price,group_price,PAY_HIDE,PAY_HIDE]); After they choose a price and send money, the script will be able to see whether they should get a discount, or what.
|
Annyka Bekkers
Registered User
Join date: 25 Jun 2007
Posts: 98
|
10-25-2007 17:16
That's sounding a lot better  So what would it do if someone is not in the group and chooses the lower price? Does it refund the money? Also, where in the script does it determine which group it should be looking for? Thanks 
_____________________
www.lickdontbite.blogspot.com
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
10-26-2007 00:17
(:
If someone pays the lower, group, price, but doesn't pass the group test, it will refund the moneys and give the message "The purchase price is L$ (the price they should have paid). Your payment of L$ (how much they paid) was refunded to you. Please try again."
A paying customer will only pass the group test if they have the same group active (with your group's title over their name bubble) as the object (edit and use the Set button next to Group on the General tab)
If you want to check whether the customer's active group is one other than the object's active group, that's doable
Best wishes!
|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
10-26-2007 07:56
heyas;
i have a heavily modified svn script that shows two pay prices for group members. that way, people in the group can get a discount, or if they're rich and generous they can choose to pay full price ;)
the caveat is, they have to touch the vendor first, and the vendor has to have a 'user lock' mode.
that, plus they have to be wearing the right group tag, but that is standard for getting group discounts.
what base vendor script are you using?
_____________________
Why Johnny Can't Rotate: http://forums.secondlife.com/showthread.php?t=94705
|
Annyka Bekkers
Registered User
Join date: 25 Jun 2007
Posts: 98
|
10-26-2007 13:55
Day, that sounds like a pretty good solution. I'll give it a try. Ive got one other question, just because I like being difficult: is it possible to have custom labels in the price dialog so that each price could be explained, or is that beyond SL's scripting ability? Bloodsong, your script sounds alot like Day's modified script, except I dont know what "svn" means or "user lock mode"  In the meantime, I did set up the two separate vendor option for now, with one vendor selling full price and one selling at a discount to my group. Its not the neatest solution, but it is working.
_____________________
www.lickdontbite.blogspot.com
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
10-26-2007 20:32
Labels with the prices on the pay dialog isn't do-able, and I can't think of any workaround since the script doesn't get notification of someone checking the price. SVN looks like a very nicely featured free multivendor. I'm not sure how the modified version offered would address the problem of someone seeing the wrong price when it's not their turn to buy, but hey, it's free ^^ Personally I like the separate vendors solution.
|