Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Possible HUD bug

Kinki Vacano
Registered User
Join date: 22 Dec 2006
Posts: 7
05-10-2007 05:57
Hi all. I have a question about moving child prims around the HUD. Basically I want a root prim to sit out of view and for it to swap child prims in and out of view. This works fine except that the child prim seems to leave a residual copy of itself in view. The child prim clearly moves out of view, but when its previous position is touch, the HUD registers it.

I have created a simple script to demonstrate the problem. Just build two prims, link them, toss the script in the root, and attach to the HUD. The script will handle the rest. Speak 'show' on channel 0 and the child prim will move into view. Speak 'hide' and the child prim will move out of view. Detach and attach to reset.

You will notice that before the first 'show', you are able to touch normally. Once you show the child prim, any touch in that area will register on the child, even if it is moved out of view with 'hide'.

I have tried lots of things to solve the problem. I tried using llSetText after a move from in the root and the child prim. I tried moving the child prim from inside the child with llSetPrimitiveParams. I tried using llSetPos in the child. Nothing seems to matter. The child always seems to leave a 'ghost' image in way.

Any suggestions?

Thanks so much

CODE
default
{
state_entry()
{
llListen(0, "", llGetOwner(), "");
}

// On attach to the HUD, setup the parts for the test
// Root prim is the sphere, child is the box
attach(key attached)
{
if (attached != NULL_KEY)
{
if(llGetAttached() > 30)
{
llSetLinkPrimitiveParams(1, [PRIM_POSITION,
<0.0, 0.0, 0.0>,
PRIM_TYPE,
PRIM_TYPE_SPHERE,
0,
<0.0, 1.0, 0.0>,
0.0, <0.0, 0.0, 0.0>,
<0.0, 1.0, 0.0>]);

llSetLinkPrimitiveParams(2, [PRIM_POSITION,
<0.0, 0.0, 0.0>,
PRIM_TYPE,
PRIM_TYPE_BOX,
0,
<0.0, 1.0, 0.0>,
0.0,
<0.0, 0.0, 0.0>,
<1.0, 1.0, 0.0>,
<0.0, 0.0, 0.0>]);

llSetLinkPrimitiveParams(1, [PRIM_POSITION, <0.0, 0.0, 1.0>]);
}
}
}

touch_start(integer total_number)
{
llSay(0, "HUD was touched");
}

listen(integer channel, string name, key id, string message)
{
// move child prim into view on "show"
if(message == "show")
{
llSetLinkPrimitiveParams(2, [PRIM_POSITION, <0.0, 0.0, -1.0>]);
}
// move child prim out of view on "hide"
else if(message == "hide")
{
llSetLinkPrimitiveParams(2, [PRIM_POSITION, <0.0, 0.0, 0.0>]);
}
}
}
Kinki Vacano
Registered User
Join date: 22 Dec 2006
Posts: 7
05-10-2007 09:30
Well, I found a work around for this bug. A bit of a pain, but it works ... scale the child prim after the move.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
05-10-2007 09:48
I know a lot of huds use a 3-dimensional model that rotates different items in and out to have different menu options available. Others just make the inactive buttons go alpha and go to a state with no touch event so they cannot be activated.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
05-14-2007 13:43
I tried this and I too see the issue. It's a problem because if you are trying to click on something in world, you actually end up clicking on this phantom prim. Certainly seems to be odd and undesired behavior.
_____________________
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
05-14-2007 13:47
Nevermind
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.