Jump to content

vendor script - the zero linden item glitch


Sylvia Wasp
 Share

You are about to reply to a thread that has been inactive for 328 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have always written my own vendors "old school" with my own scripts and I've honed the script over the years so that it's almost perfect.  

There is one classic "glitch" with these older LSL scripts that I never learned, which is that if the item is worth zero lindens, the script fails to show a dollar option on the dialogue that comes up when you right click and select "pay."  I never had a huge problem with this before as I've never sold stuff for zero lindens before, but now I want to set up a vendor full of demos, which are all free of course.  

I'm aware that there are two "fixes" for this that evolved over time.  The first is those vendors that charge you a dollar and then pay it right back, but there are also some vendors that do it right and present the user with a proper  "$0" pay button.  That would be better.  

Anyone who understands what I'm saying here and can point me to the right place would be appreciated.  :) 

Link to comment
Share on other sites

I would also like to know if there really are vendors that are able to show a "L$0" pay price. Do you happen to know any by name?

It doesn't seem possible with llSetPayPrice, and I'm going to update the wiki with that detail unless somebody knows a trick.

Edit: Well, I guess one trick is to set the "default price" parameter to 0, which sets that value to the text box of the "Pay" window and allows you to click the Pay button. I'm assuming you mean the 4 preset price buttons though.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

You can set the price to 0 with llSetPayPrice but paying L$0 doesn't trigger any event.

To turn a prim into a vendor that you can buy the contents for L$0 just edit the vendor prim and under the general tab select the "For Sale" check mark and set the price to 0 and then from the drop down select contents then select Apply. You can then set the click action to "buy object". Put in what you want to sell in the contents of the vendor.

Link to comment
Share on other sites

adding on

the money event does not fire when the amount paid is L$0. Even tho is possible to display the choose amount box set to L$0, with llSetPayPrice(0, [0])

 

edit: what Gayngel said

Edited by elleevelyn
Link to comment
Share on other sites

36 minutes ago, Wulfie Reanimator said:

I would also like to know if there really are vendors that are able to show a "L$0" pay price. Do you happen to know any by name?

It doesn't seem possible with llSetPayPrice, and I'm going to update the wiki with that detail unless somebody knows a trick.

Edit: Well, I guess one trick is to set the "default price" parameter to 0, which sets that value to the text box of the "Pay" window and allows you to click the Pay button. I'm assuming you mean the 4 preset price buttons though.

Well, it's just my impression over the years that I have seen vendors that do it.  Maybe I'm wrong and it's just CasperVendors? (which are quite different I think).  I don't need multiple prices, I just need the zero lindens button to show if the item is zero lindens.  

 

Edited by Sylvia Wasp
Link to comment
Share on other sites

1 minute ago, Gayngel said:

You can set the price to 0 with llSetPayPrice but paying L$0 doesn't trigger any event.

To turn a prim into a vendor that you can buy the contents for L$0 just edit the vendor prim and under the general tab select the "For Sale" check mark and set the price to 0 and then from the drop down select contents then select Apply. You can then set the click action to "buy object". Put in what you want to sell in the contents of the vendor.

Thanks for the suggestion but these are scripted multi-vendors (multiple items in each, each with their own price).  I can't have dozens of boxes laying around.  The point of having the vendor is to avoid that.  

Link to comment
Share on other sites

The Caspervend multi-vendor does it two ways. Either you pay L$1 /  get L$1 or you can right click and select touch for a dialog menu and select the deliver button and deliver the item from the listen event. I'm not sure how your vendor is set up but a 3rd possible way is to on display of a free item disable the actual Buy button on the right click menu with llSetPayprice(PAY_HIDE,[PAY_HIDE]) and change the "Touch" button on the right click menu to "Buy" with llSetTouchText and set llSetClickAction to touch and then in a touch event deliver the item.

Edited by Gayngel
Link to comment
Share on other sites

10 minutes ago, Gayngel said:

The Caspervend multi-vendor does it two ways. Either you pay L$1 /  get L$1 or you can right click and select touch for a dialog menu and select the deliver button. I'm not sure how your vendor is set up but a 3rd way is to on display of a free item change the "Touch" button on the right click menu to "Buy" with llSetTouchText and set llSetClickAction to touch and then in a touch event deliver the item.

I'm not sure I get this.  My vendors are three prims, the vendor and a forward and back button on each side, so you cycle through the items by pressing the buttons, than right-click and select "Pay" for whatever item you stop on.  The Pay dialogue has a single button with the price of the item on it.  If the item is zero lindens though, that button doesn't show on the dialogue.  

If it's really true as Wolfie says that llSetPayPrice can't generate an event on a zero linden item, then maybe the "take a dollar - give a dollar" thing is the only way.  

Link to comment
Share on other sites

17 minutes ago, Sylvia Wasp said:

I'm not sure I get this.

I think the idea is to pop up a llDialog box rather than the usual payment box, or give the item immediately instead of asking for confirmation if the item is 0L$. Any way you slice it, it needs some annoying special handling.

  • Like 1
Link to comment
Share on other sites

26 minutes ago, Sylvia Wasp said:

I'm not sure I get this.  My vendors are three prims, the vendor and a forward and back button on each side, so you cycle through the items by pressing the buttons, than right-click and select "Pay" for whatever item you stop on.  The Pay dialogue has a single button with the price of the item on it.  If the item is zero lindens though, that button doesn't show on the dialogue.  

If it's really true as Wolfie says that llSetPayPrice can't generate an event on a zero linden item, then maybe the "take a dollar - give a dollar" thing is the only way.  

On the right click menu the Pay button will give the pay dialog with the pay buttons and the Touch button can either give an llDialog menu (blue pop-up menu) where the customer can select Deliver and the item be delivered from the listen event, or the Touch button can just deliver the item directly from the touch event without a dialog.

Edited by Gayngel
Link to comment
Share on other sites

9 minutes ago, Gayngel said:

On the right click menu the Pay button will give the pay dialog with the pay buttons and the Touch button can either give an llDialog menu (blue pop-up menu) where the customer can select Deliver and the item be delivered from the listen event, or the Touch button can just deliver the item directly from the touch event without a dialog.

OK, I see what you're driving at now.  I'm thinking that would be probably too confusing for customers though.  I can't see how to do it without posting a page of instructions for the user. 

17 minutes ago, Quistess Alpha said:

I think the idea is to pop up a llDialog box rather than the usual payment box, or give the item immediately instead of asking for confirmation if the item is 0L$. Any way you slice it, it needs some annoying special handling.

Thanks for the translation. :)  I'm not sure about it, but I think using llDialog rather than a payment box would be a security risk.  

Maybe, because the entire vendor is full of zero linden items (Demos), I could just tell the script they were all $1L and then even though the button says "$1L", don't charge it anyway?  But then the viewer will still think they are paying at first even though the charge doesn't ultimately happen.  

I'm thinking there must be a way to fiddle it somehow, considering the vendor only has zero linden items and always will only have zero linden items.  

Link to comment
Share on other sites

integer lhandle;
default
{
    state_entry()
    {
        llSetPayPrice(PAY_HIDE,[1]);
    }
    
    // if the customer right clicks and select Pay from the menu

    money(key id, integer amount)
    {
       llGiveMoney(id,amount); 
       llGiveInventory(id, llGetInventoryName(INVENTORY_OBJECT,0)); 
    }
    
    // if the customer right clicks and selects Touch from the menu
    
    touch_end(integer num)
    {
      // llGiveInventory(id, llGetInventoryName(INVENTORY_OBJECT,0)); 
      // either give the item directly or bring up a dialog menu to deliver the item
        
        
       llListenRemove(lhandle);
       lhandle = llListen(-777,"","","");
       
       llDialog(llDetectedKey(0),"Select deliver to get your free item!",["Deliver"],-777); 
        
        
    }
    
    listen(integer chan, string name, key id, string msg)
    {
        if(chan == -777)
        {
           
           if(msg == "Deliver")
           {
          llGiveInventory(id, llGetInventoryName(INVENTORY_OBJECT,0)); 
           llListenRemove(lhandle);
           }
            
        }
        
        
    }
}

 

Edited by Gayngel
  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 328 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...