ChangeLog

25 August 2013

11 April 2013

17 March 2012

  • After some discussions with LuckyBuck Resident, support for items with names exceeding the dialog button limit was added.

02 December 2011

  • Added notecard based giver variant, for holidays and such events.

23 November 2011

  • Added object types and a variation to give out only one single object. Please refer to the configuration section to configure your script before you use it.

Motivation

I have seen a number of commercial givers out there on the marketplace and wanted to implement a free one. What is does is offer a menu on touch with forward and backward browsing capabilities and lists the items contained in the same prim as the script resides in. When a user clicks a button, named after the object in the prim, the script gives a copy of that object to the user.

Applications

This script has multiple applications depending on what you want to use it for; for example, a simple application would be an automated bartender that people can click to browse and get a drink. Another example would be landmark and notecard givers.

Limitations

One limitation is that the objects within the prim should have names smaller in length than 24 bytes. Also, please bear in mind that the menu buttons are generated from the inventory contents of the prim, so if your object has a long name, it will be truncated when it appears on the button. A simple way to avoid this is to give simple and meaningful names to the items in the giver prim. In case you want to add items or remove items, just reset the script after you have done your adjustments: I could have included an event handler to trigger when the inventory changes but I preferred to keep things simple.

Hacking

To use the script, create a prim and add objects, notecards, or whatever you want people to be able to get from the prim. After that, drop this script in the prim. You can configure the script easily, here are some pointers for some cosmetic changes you might want to make to the script:

  • The back and forward buttons for the dialog are named in the code ⟵ Back and Next ⟶ respectively. If you want to change those to something more fancy, just replace every instance of ⟵ Back and Next ⟶ with your desired text.
  • The dialog text is set to “Please browse the available items:\n”. Again, if you wish to enter your own text, just replace every instance of “Please browse the available items:\n” with what you want the dialog to say.
  • The script currently works for everybody who touches it. If you wish to change this and allow only the owner to be able to interact with it, simply replace all instances of llDetectedKey(0) with llGetOwner().

Index


secondlife/giver.txt · Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor


For the copyright, license, warranty and privacy terms for the usage of this website please see the license and privacy pages.