Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problems with dialog menu in a linked prim

Hanna Markstein
Registered User
Join date: 18 Oct 2007
Posts: 7
01-17-2009 02:55
I have a problem with a linked prim (not main prim). You can touch the prim and you get a dialog menu. Normally when you click on certain parts in the menu you get special submenus. I use this script in several of my houses (I build and sell houses), they work fine.

But in one special house the same script does not work probably. When you click on the main menu, no submenu appears. I cannot find the issue. When I unlink one of the prims, no matter which one, the submenu works fine. When I take this changed house and rez it again, the same issue is there. This is very strange.

Do you have any idea what went wrong?
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
01-17-2009 05:07
Really difficult to say without seeing some code but it suggests you're losing your listen - the Main Menu will be 'saying' its button text which the script needs to be ready to 'hear'.

Out of interest does your script include a changed Event Handler? And does it, for example, do a script reset for: if (change & CHANGED_LINK)?

Is there an on_rez Event Handler with a: llListenRemove?

State changes?
_____________________
Hanna Markstein
Registered User
Join date: 18 Oct 2007
Posts: 7
01-17-2009 07:15
Thank you very much for your fast response.

The script has 3 states, no on_rez evenhandler and no change link handler. And yes, the listen event is not started after using the menu (tested this by adding a llSay in the first line of the listen event).

I have a timer event with a llListenRemove when someone clicks on ignore in one of the menues.

The very strange thing is that I use this script in all my houses, they are linked together and I cannot find out why it does not work in THIS special house. This is soo odd. And the strangest thing is when I unlink ONE prim of the house, no matter which one, everything works until I take the house and rez it again (without the unlinked prim).

Here is the main code:
------------------------------------------
default
{
state_entry()
{
llSetObjectName("SK House Remote";);
state idle;
}
}

state idle
{
state_entry()
{
llSetTimerEvent(0);
}

touch_start(integer total_number)
{
integer ok = 0;
Toucher = llDetectedName(0);
ToucherKey = llDetectedKey(0);

ok = checkaccess(Toucher, ToucherKey);
if (ok) state activated;
else llSay(0,"Sorry, only authorized people can use this remote control.";);
}
}

state activated
{
state_entry()
{
llListen(CHANNEL,Toucher,NULL_KEY,"";);
llDialog(ToucherKey, "Housecontrol", MENU_MAIN, CHANNEL);
llSetTimerEvent(20);
Button = 0;
Avatare = [];
loeschen = FALSE;
Channelaendern = FALSE;
}

timer()
{
list Knoepfe=[];
if (!Button)
{
if (Channelaendern)
{
llListenRemove(Zuhoerer);
}
llSetTimerEvent(0);
state idle;
}
else Button = 0;
}


listen(integer channel, string name, key id, string message)
{
...
}
}
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
01-17-2009 07:25
Is the house big enough that the prim creating the dialog could be more than 20 meters from the root prim? That's an ongoing problem, really an old bug but it's been more apparent now that we can make larger linked objects.

The quick fix is to rearrange things so that the dialog is generated nearer (or even in) the root prim.

The bug is at http://jira.secondlife.com/browse/SVC-2133 if you would like to follow the story.

There is a second related bug where things can seem to work fine, but then break after taking and re-rezzing, because the listen point can move! The solution is the same though, if you make the dialog near the root the potential distance change won't come into play. That bug is https://jira.secondlife.com/browse/SVC-3170
Hanna Markstein
Registered User
Join date: 18 Oct 2007
Posts: 7
01-17-2009 09:49
yessssssss

Thank you so much Victoria, that was the problem :-) Now everything works fine. I am so glad, thank you thank you thank you :-))
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
01-17-2009 09:52
One test might be to use a simple channel number, say 1, click to get the main menu dialog, and then have your AV shout /1 Housecontrol ...if the sub menu dialog appears then it's not an inherent problem in the scripting, but something, as Viktoria suggests, to do with link distances.

[Edit: hehe ...too slow :)]
_____________________
Hanna Markstein
Registered User
Join date: 18 Oct 2007
Posts: 7
01-17-2009 11:50
Thank you Pale, this is a good idea. I will keep that in mind if I ever have strange problems again.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
01-17-2009 12:46
Just for completeness, this bug can affect attachments (both on the body and HUD) too. When you are sitting on a link set, the listen point for your attachments moves to that root prim. So, it's a good strategy to make the root prim somewhere near the middle of a large object, if possible, and if it's likely that people will try to sit on it. "Hollow" linksets like fences might be better left in separate pieces, unless the idea of messing with people's heads and HUDs seems appealing at the moment.