Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

hud to allow removal of clothing prims

Micheal Steadham
Second Life/WOW lover
Join date: 4 Aug 2006
Posts: 25
01-31-2007 17:57
I'm trying to design a HUD that will allow someone to remove a prim once it's touched. It must have a permissions script, as it should ask for it to be removed, if by someone other than owner. It should also have the ability to "Say" what the individual has done in general chat.

I've gotten close, but can't quite get it. I have the HUD, but when I click the option, I get an invalid options response.

I still need to add the "return to inventory" script, but would like to get the HUD controls first. Has anyone ever done something like this?

Anyone help would be greatly appreciated.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-01-2007 00:20
From: Micheal Steadham
I'm trying to design a HUD that will allow someone to remove a prim once it's touched. It must have a permissions script, as it should ask for it to be removed, if by someone other than owner. It should also have the ability to "Say" what the individual has done in general chat.

I've gotten close, but can't quite get it. I have the HUD, but when I click the option, I get an invalid options response.

I still need to add the "return to inventory" script, but would like to get the HUD controls first. Has anyone ever done something like this?

Anyone help would be greatly appreciated.


The general sequence will be something like this

Av touches / clicks prim clothing
Clothing sends its ID and the key of the toucher to the HUD
The hud displays a message to the owner (if not the owner touching)
Hud sends yes (or no) back to Clothing
HUD (or Clothing) says something suitiable
Object dettaches

The prim clothing will need to be scripted so that it can communicate with the HUD, I assume you have this side covered?

I think llDettach will return the dettached object to inventory automatically so shouldnt be a problem.

Try posting the code and/or the exact error sequence for more help.
Micheal Steadham
Second Life/WOW lover
Join date: 4 Aug 2006
Posts: 25
hud to allow removal of clothing prims
02-01-2007 09:02
Here is what I have so far, as I said it's a work in progress. Haven't checked compile yet....


// when clothing prim is touched, present a dialog with choices

integer CHANNEL = 42; // dialog channel
list MENU_MAIN = ["Ruffle", "Tug On", "Rip Off"];

default {
state_entry()
{
llListen(CHANNEL, "", NULL_KEY, "";);

}

touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "What do you want to do?", MENU_MAIN, CHANNEL);
}

listen(integer channel, string name, key id, string message)
{
string response_string;

if (llListFindList(MENU_MAIN, [message]) != -1)
{
//llSay(0, name + " has chosen to '" + message + " your prim " +"'.";);
response_string = name + " has chosen to '" + message + " your prim " +"'.";

if (message == "Ruffle";)
{
//llSay(0, "ruffled your prim";);

response_string = name + " has chosen to '" + message + " your prim " +"'.";
response_string = response_string + "Click prim for dialog of options";

else if (message == "Tug On";)
{
//llSay(0, "tug'd on your prim";);
response_string = name + " has chosen to '" + message + " your prim " +"'.";
response_string = response_string + "Click prim for dialog of options";

else if (message == "Rip Off";)
{
//llSay(0, "violently ripped off your prim";);
response_string = name + " has chosen to '" + message + " your prim " +"'.";
response_string = //Detach;
}
}
else
{
//llSay(0, name + " picked invalid option '" + llToLower(message) + "'.";);
response_string = name + " picked invalid option '" + llToLower(message) + "'.\n";
response_string = response_string + "Click prim for dialog of options";
}


llSetText(response_string, <1,0,0>, 1.0);

}
}