Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llDialog and listen problem

Lyndzay Meili
Registered User
Join date: 2 Sep 2007
Posts: 28
04-01-2008 19:48
Hi there every one :)

I've hit on of those silly walls and I can't seem to figure out what mistake I've made.

I'm modifying the Ready Jack pistol script so that it has a dialog box to pick the hold animation. (the device is two handed so it doesn't fit people with really big or small shoulders, so I've made a series of poses with the hands at different places and need a way for the user to select the right(ish) size for them)

Anywho, I've got the dialog box set up and it will work on it's own in a prim, but when I copy and paste it into the existing script, I keep getting a syntax error on the listen line of the script and I can't figure out what I'm doing wrong.

I've put up a snippet of it to se if anyone can see what I'm doing wrong

Thanks so Much :)

PHP



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

touch_start(integer x)
{
if (llDetectedKey(0) != llGetOwner()) {
return;
} else if (!llGetAttached()) {
getPerms();
} else if (gArmed) {
disarm();
} else {
arm();
}
{
llDialog(llDetectedKey(0), "Pick you Avatar size", MENU_MAIN, CHANNEL); // present dialog on click
}

listen(integer chan, string name, key id, string msg) //<=== Syntax Error at start of line
{
if(msg=="Large";)
{
llStartAnimation(gAnim);
llOwnerSay(name + " changed the pose to ' " + msg + " '.";);
}
else if(msg=="Huge";)
{
llStartAnimation(gAnim2);
llOwnerSay(name + " changed the pose to ' " + msg + " '.";);
}
else if(msg=="Average";)
{
llStartAnimation(gAnim3);
llOwnerSay(name + " changed the pose to ' " + msg + " '.";);
}
else if(msg=="Small";)
{
llStartAnimation(gAnim4);
llOwnerSay(name + " changed the pose to ' " + msg + " '.";);
}
else if(msg=="Tiny";)
{
llStartAnimation(gAnim5);
llOwnerSay(name + " changed the pose to ' " + msg + " '.";);
}
else if(msg=="Reset";)
{
llStartAnimation(gAnim);
llOwnerSay(name + " has ' " + msg + " ' the pose.";);
}
}

snip
/PHP
_____________________
"Be who you are and say what you feel, because those who matter don't mind, and those that mind, don't matter."
—Dr. Seuss
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
04-01-2008 21:03
You are missing a "}" to close the touch_start event.

Either that or you have an extra "{" above the llDialog()

~Boss
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-01-2008 21:03
Toward the end of your 'touch_start' handler, you have an extra open curly brace ({). This is a perfectly valid (multiple-statement) block of code (I believe that is true in LSL), but it means you aren't closing the 'touch_start' event handler two lines later, before the 'listen' event handler. Either add an extra close curly brace (}), or remove the extra open curly brace ({), which has no effect in that context anyway.
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
04-03-2008 06:45
did you happen to define CHANNEL in this script?

:X



btw, if only the owner can change the animations, you should use llGetOwner() where NULL_KEY is.


*actually*, you should only activate the listener when the dialogue is up, and kill it shortly after. but that's optional.


oh, THAT listen. well. never mind, then :X
_____________________
Why Johnny Can't Rotate:
http://forums.secondlife.com/showthread.php?t=94705