Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Moving prims in the HUD

Dzar Overlord
Registered User
Join date: 16 Mar 2007
Posts: 8
03-22-2007 14:26
Hey there. I was wondering how to get a child prim of a link set to move in the HUD. I was told that llSetPrimitiveParams() works but I just can't get it to work. Simply put, all I want is a small red box to move from in front of to behind a large blue box so in effect it looks like it disappears without actually deleting the prim. If possible I would also like to change the shape of the red box to maybe a red rectangle or sphere. Thanks in advance for the help.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-22-2007 15:36
From: Dzar Overlord
Hey there. I was wondering how to get a child prim of a link set to move in the HUD. I was told that llSetPrimitiveParams() works but I just can't get it to work. Simply put, all I want is a small red box to move from in front of to behind a large blue box so in effect it looks like it disappears without actually deleting the prim. If possible I would also like to change the shape of the red box to maybe a red rectangle or sphere. Thanks in advance for the help.


Itd my understanding of it that HUD items have a restricted z axis (into the screen) , so you cannot move infront or behind. You could just rezise it so that it is no longer visible , or rotate it out of view
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
03-22-2007 15:39
This broadly illustrates how I Get and Set primitive parameters:

CODE
//This script goes in the child prim and is typically controlled from the root prim.
list POSITION1 = [<0.0, 0.0, 0.0>];
list SIZE1 = [<1.0, 1.0, 1.0>];
list TYPE1 = [0, 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>];

list POSITION2 = [<0.0, 0.0, 0.0>];
list SIZE2 = [<1.0, 1.0, 1.0>];
list TYPE2 = [0, 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>];

list pParams;

default
{
link_message(integer sender_number, integer int, string str, key id)
{
if (str == "get")
{
llOwnerSay("PRIM_POSITION " + (string)llGetLocalPos());
llOwnerSay("PRIM_SIZE " + (string)llGetPrimitiveParams([PRIM_SIZE]));
llOwnerSay("PRIM_TYPE " + (string)llGetPrimitiveParams([PRIM_TYPE]));
}
else if (str == "set1")
{
pParams = [];
pParams += [PRIM_POSITION] + POSITION1;
pParams += [PRIM_SIZE] + SIZE1;
pParams += [PRIM_TYPE] + TYPE1;
llSetPrimitiveParams(pParams);
}
else if (str == "set2")
{
pParams = [];
pParams += [PRIM_POSITION] + POSITION2;
pParams += [PRIM_SIZE] + SIZE2;
pParams += [PRIM_TYPE] + TYPE2;
llSetPrimitiveParams(pParams);
}
}
}
The steps are that you manually edit the child prim into the first position and then send it the "get" Link Message. It then reports its settings... which you make a note of. :) Then manually edit the child prim to its second position, "get" settings, make a note - and so on, if you have more transformations.

The fiddly bit is that you then have to manually transcribe the settings you made a note of into properly formed list elements and paste them into the script. The "set1", and "set2" Link Messages will then set those parameters.

I include the 6 populated lists so that you get an idea of what they look like. You'll need to "get" your own values.

You can, of course, Get and Set more or less of the parameters. It gets a deal trickier if you're interested in any of the per-face parameters. :)

To just change the postion I think llGetLocalPos, and llSetPos would suffice.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
03-22-2007 15:51
From: Newgate Ludd
Itd my understanding of it that HUD items have a restricted z axis (into the screen) , so you cannot move infront or behind. You could just rezise it so that it is no longer visible , or rotate it out of view
Having just checked :) ...you can't freely edit a HUD object while it's attached to your HUD. However, if you set up the object in-world, once it's attached it will reposition in all dimensions under script control.

The 'transforms' look identical in the HUD view as they do normally.