Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

HUD help

Cooper Conover
Registered User
Join date: 28 Jun 2006
Posts: 10
10-12-2006 13:38
I am trying to create a HUD and am having problems figuring how to get it to interact with the user. "Touching" the HUD doesn't seem to have the same effect as it does on a regularly scripted prim and I am wondering how I make "buttons" that will do tasks when "touched" using a script. I would appreciate any help or advise anyone can give.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
10-12-2006 14:15
What problem are you seeing? I've created HUDs with buttons that react to touch, and the script works exactly the same as an regular non-HUD object.

You can't right-click on a HUD and get the Touch option, you'll have to left-click on it. Also (and this is true for all objects), if your script is in the root prim, the whole object responds to touch, otherwise only the scripted prim responds. And finally, there was a bug recently where some people couldn't get touch to work on the edges of their screen. Moving the HUD further out into the screen area made it work.

If you've taken care of those issues and still can't get touch to work, then something else is wrong.
Cooper Conover
Registered User
Join date: 28 Jun 2006
Posts: 10
10-12-2006 14:46
The purpose of the HUD is to give a virtual tour of a sim, right now I am just working on moving an avatar from one location to another when the HUD is touched. Here is the code I have so far:

float x = 92.0;
float y = 96.0;
float z = 301.0;

vector next_location = <x, y, z>;

default
{
touch_start(integer total_number)
{
vector location;
location = (next_location - llGetPos()) * (ZERO_ROTATION/llGetRot());
llSitTarget(location, ZERO_ROTATION);
llUnSit(llDetectedKey(0));
}
}

When just an object in front of me, I can touch the prim and I will be taken to the next location, but when I attach it as a HUD (even in the center of the screen) it does nothing when left clicked. I also have the prim set so that when left clicked an avatar will sit on the object. Any suggestions?
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
10-12-2006 14:51
That's because you can't sit on an attachment, it's not allowed. Try this as a non-HUD attachment (say, a block attached to your hand or something) - it still won't work. So the touch part of it should be working, what's not working is getting an avatar to sit on an attachment.
Cooper Conover
Registered User
Join date: 28 Jun 2006
Posts: 10
10-12-2006 15:00
I guess that shold have been common sense... Anyway, in that case does anyone have any suggestions on how to move an avatar from one location to another in the same sim? I know there is no llTeleportAvatar function so I'm not sure how to go about this. Is animation an option?
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
10-12-2006 18:41
i am no scripting person but i belive there is a llMoveTo command and if i am correct i think that this is what your looking for.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
10-12-2006 21:58
You may also want a look at llMapDestination()
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-12-2006 22:44
You can get the menu to rez an object that when touched will teleport the person to the next location. If less then 300 meters; just use the sit hack, if over; then warpPos.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-12-2006 23:56
From: Jesse Barnett
You can get the menu to rez an object that when touched will teleport the person to the next location. If less then 300 meters; just use the sit hack, if over; then warpPos.


Only problem is that you wont be sat on the object thats rezzed?
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
10-13-2006 09:54
Not if that newly rezzed object is set to sit on touch. It should probably delete itself after the un-sit, so you don't leave prims littered around the place. The only catch is that this won't work in no-rez land.