Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Linking a Touch Menu with a Poseball show/hide controller?

Jubei Kagu
Registered User
Join date: 12 Feb 2007
Posts: 7
05-18-2007 10:54
hi all,i'm a noob at scripting and i was wondering if it is possible to link a touch menu script with a poseball show/hide controller.basically so u touch the menu and it sends out the command via button push instead of saying hide or show in open chat.

here are the scripts im working with:

Touch Menu Script:

CODE

// when touched, present a dialog

integer CHANNEL = 42; // dialog channel
list MENU_MAIN = ["", ""]; // the main menu

default {
state_entry() {
llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users)
}

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

listen(integer channel, string name, key id, string message)
{
if (llListFindList(MENU_MAIN, [message]) != -1) // verify dialog choice
{
llSay(0, name + " picked the option '" + message + "'."); // output the answer
if (message == "Options...")

llDialog(id, "What do you want to do?", MENU_MAIN, CHANNEL); // present main menu on request to go back
// here you have the name and key of the user and can easily verify if they have the permission to use that option or not
else if (message == "Sit")
llSay(0, "This is where stuff would happen if this wasn't just an example");
} else
llSay(0, name + " picked invalid option '" + llToLower(message) + "'."); // not a valid dialog choice
}
}




and the Show/Hide Controller:

CODE

default
{
touch_start(integer total_number)
{
llSay(0, "show");
llSay(1, "show");
llSay(2, "show");
llSay(5, "show");
llSay(7, "show");
llSay(9, "show");
llSay(69, "show");
//llShout(5, "unlock");
//llWhisper(0, "unlock");
state hide;
}
}

state hide
{
touch_start(integer total_number)
{
llSay(0, "hide");
llSay(1, "hide");
llSay(2, "hide");
llSay(5, "hide");
llSay(7, "hide");
llSay(9, "hide");
llSay(69, "hide");
//llShout(5, "lock");
//llWhisper(0, "lock");
state default;
}
}




so like i said i want to be able to use the touch menu to send out the commands to the to the show/hide controller.any help would be greatly appreciated and ya might just get a really really nice free item inworld...tyvm in advance.. :D
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
05-18-2007 11:55
From: Jubei Kagu
hi all,i'm a noob at scripting and i was wondering if it is possible to link a touch menu script with a poseball show/hide controller.basically so u touch the menu and it sends out the command via button push instead of saying hide or show in open chat.


so like i said i want to be able to use the touch menu to send out the commands to the to the show/hide controller.any help would be greatly appreciated and ya might just get a really really nice free item inworld...tyvm in advance.. :D


You just need to cater for the menu selection of show or hide i.e. add Show and Hide to your menu (or trigger the functionality when sat upon) and then send a linked message to the other script or you could invoke the code you currently have in the other script as a function call.

Be aware that you cannot force the avatar to sit from a dialog only change the animation being played.
_____________________
I'm back......