Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script for giving items from a hud?

Jase Carlos
C-Lo in the HOUUUUSE!
Join date: 24 Jul 2005
Posts: 28
08-05-2008 12:42
Not sure if this is even possible but I was wondering if there is a way to set up HUDs so that you can have a button/command automatically give someone else a particular item. Say for example, I had book I want to pass out but instead of going thru the whole "drag-and-drop" process so may times, I just click on a button on my hud and then click on a name, and it gives that person the book. Is there anybody that can help with that? Thx
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
08-05-2008 13:55
Yes it's possible. It's probably not the kind of script you wish to start with as a newb scripter tho. You'll have to fire off a sensor - capture a list of nearby av names and associated keys - then throw up the dialog and listen for the response (remember a long av name won't fit in the buttons and may be truncated, so you have to have a third associated list of "button names" associated with the keys) - then finally give the object from the inventory.
_____________________
http://slurl.com/secondlife/Together
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
08-05-2008 14:42
When you know the text is going to be truncated, it can work to prepend (or append with proper truncation, I suppose) a prefex/suffix to the button string. For example, a number indicating the list index of the avatar being referenced. If you limit it to the 16 avatars you can detect with one sensor sweep, or limit it to the first 12 so you can do it with one dialog page, a single hex character works well (e.g. "0 Hewee Zetkin", "1 Escort DeFarge", "2 Jase Carlos", ..., "a Some Dude", "b Other Dude";). Then you just pull the value out of the response using llGetSubString() without worrying about the user readable name.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
08-05-2008 22:51
I sell exactly that at my shop in Midas Northwest. Go to Clockwerks in Midas Northwest, and look for the greeter hud. It's a hud that you wear, and you have 3 options, give a gift, notecard, or landmark. You touch the appropriate icon, a menu appears with the 16 closest avatar names, you select the name, and it gives the item. To setup, simply load your gift item, notecard, and landmark, then wear. Honestly, I forget, but I think it's $350L (jeez, can't even remember my own prices!).

http://slurl.com/secondlife/Midas%20Northwest/46/66/22

http://secondscripter.com
_____________________
My tutes
http://www.youtube.com/johanlaurasia