Difference between revisions of "Creating HUDs"

From Second Life Wiki
Jump to navigation Jump to search
Line 9: Line 9:
A HUD typically consists of a control panel with different buttons you can click on to do context-specific stuff. Some HUDs are "passive" and only meant to be looked at, not touched.
A HUD typically consists of a control panel with different buttons you can click on to do context-specific stuff. Some HUDs are "passive" and only meant to be looked at, not touched.


While general [[attachment|attachments]] appear on your avatar's body and other Residents can see them, HUDs are only visible to you and have a fixed viewpoint, similar to how they're used in video games and apps. However, the ''effects'' of a HUD, like [[:Category:LSL_Chat|emitted]] chat, can be visible to other Residents and objects.
While general [[attachment|attachments]] appear on your avatar's body and other Residents can see them, HUDs are only visible to you and have a fixed viewpoint, similar to how they're used in video games and apps. However, the ''scripted effects'' of a HUD, like [[:Category:LSL_Chat|emitted]] chat, can be visible to other Residents and objects.


Objects specifically designed to be used like that may have "HUD" in their name to tell you where they'll appear, or they may have "(wear me)" in their name.
Objects specifically designed to be used like that may have "HUD" in their name to tell you where they'll appear, or they may have "(wear me)" in their name.
Line 18: Line 18:


* '''[[AO|Animation overrides]]''' - Click buttons to change how your avatar looks when moving. Turn off the AO if animations conflict with sitting on furniture.
* '''[[AO|Animation overrides]]''' - Click buttons to change how your avatar looks when moving. Turn off the AO if animations conflict with sitting on furniture.
* '''Books''' - HUDs are useful for viewing info that may be tricky to camera-zoom in on, or you simply don't want others to see it.
* '''[[Combat|Combat systems]]''' - See your health, stamina, experience points, and other relevant in-game info. Use special powers (cast spells in an RPG) to attack enemies.
* '''[[Combat|Combat systems]]''' - See your health, stamina, experience points, and other relevant in-game info. Use special powers (cast spells in an RPG) to attack enemies.
* '''Customizable attachments''' - Click color swatches to change your hair, clothes, shoes, or more exotic accessories like [http://en.wikipedia.org/wiki/Catgirl neko] tail and ears. Make particle effects (like fire and smoke).  
* '''Customizable attachments''' - Click color swatches to change your hair, clothes, shoes, or more exotic accessories like [http://en.wikipedia.org/wiki/Catgirl neko] tail and ears. Make particle effects (like fire and smoke).
* '''Multi-tools''' - Be alerted when other avatars are nearby (including when you want privacy). Eject intruders from your land. Get region performance stats. And many more.
* '''Multi-tools''' - Be alerted when other avatars are nearby (including when you want privacy). Eject intruders from your land. Get region performance stats. And many more.
* '''Photo enhancements''' - Show a fancy frame around your Viewer window to add an ornamental touch when [[taking snapshots]].
* '''Vehicles''' - Dashboards with speedometers and remaining fuel. Some cars even have a "turbo" or ''Back To The Future''-esque "fly" button.


{{KBtip|You can browse and buy many HUDs on the [http://bit.ly/gHFpCI Second Life Marketplace].}}
{{KBtip|You can browse and buy many HUDs on the [http://bit.ly/gHFpCI Second Life Marketplace].}}


== Scripting HUDs ==
== Troubleshooting HUDs ==


Most scripted functionality works with HUDs, with the following exceptions. (The list is not exhaustive!)
=== How do I move my HUDs? ===
 
HUDs are usually positioned towards a corner so they don't obscure your field of view (unless that's desired).
 
Once an HUD is worn:
 
# Right-click the HUD onscreen (not in your inventory) and select '''Edit'''.
# Drag the arrows to reposition the HUD.
 
The HUD remembers where it is the next time you login. In some circumstances (like a sudden Viewer crash), the HUD may forget its position, so use this workaround in addition to the above:
 
# Right-click the HUD and select '''Detach'''.
# Find the HUD in your inventory, right-click it and select '''Wear'''.


* Particles do not work. Don't have HUD [[prim]]s generate them. If a HUD attempts to generate particles, they appear at <0,0,0> in the current sim, annoying your neighbors.
=== Why does wearing one HUD make another HUD disappear? ===


* If a sound is triggered using [[llPlaySound]](), only the HUD wearer will hear it. If the land parcel they're over restricts sound entry/exit, the sound will not play.
These HUDs are being worn on the same attachment point. There are eight HUD attachment points: '''Center 2''', '''Top Right''', '''Top''', '''Top Left''', '''Center''', '''Bottom Left''', '''Bottom''', and '''Bottom Right'''. Despite their names, these only indicate where an HUD is initially positioned when you first wear it — as described above, you can always move them around as you wish.
** If a sound is triggered using [[llTriggerSound]](), the wearer and any bystanders will hear it.
* The [[Sensor]] will not detect the avatar wearing the HUD.


Scripted movement of HUD pieces is relative to the attachment points. The position vector used by [[llSetPos]]() is interpreted as [DESCRIPTION MISSING!]. A depth of -1 will render in front of a depth of 0.
To solve this:


Since HUD attachments cannot be clicked thru even if they're invisible, the common solutions to getting them out of the way are moving them and shrinking them.
# In your inventory, right-click one of the HUD and select '''Attach To HUD'''. In brackets, it shows you which point(s) other HUD(s) are currently attached to. Select a different attachment point that isn't already occupied.
# Move the HUD according to your taste using the above steps.


If you are trying to move the HUD around relative to its current position, use [[llGetLocalPos]]() rather than [[llGetPos]]().
=== I can't see my HUD ===


example:
There are several possible solutions:


<lsl>llSetPos(llGetLocalPos() + (<0.25,0,0> * llGetLocalRot()));</lsl>
HUDs scale depending on your Viewer window resolution. For example, if you shrink the window, they become smaller. There are several




== Solving problems with HUDs ==


==== HUD is invisible ====
This problem arises when the person who made the HUD (or gave it to you) has a screen resolution greater than yours: The HUD is attached at the position that it had on their screen, but that is outside your field of view. The solution is:
This problem arises when the person who made the HUD (or gave it to you) has a screen resolution greater than yours: The HUD is attached at the position that it had on their screen, but that is outside your field of view. The solution is:
# Attach another HUD (one that you know works properly for you).
# Attach another HUD (one that you know works properly for you).
Line 57: Line 69:
This will only bring the HUD back into view temporarily.  Once you close the HUD and reopen it, the problem will repeat itself.
This will only bring the HUD back into view temporarily.  Once you close the HUD and reopen it, the problem will repeat itself.


== Advanced usage ==


{{red|clean up!}}
The below details are for Residents who want to create their own HUDs.


In fighter aircraft and first-person shooters, the HUD (or Heads-Up Display) shows the user important information directly in their field of vision. In Second Life, HUD attachment points have been added to the right-click/pie menu and inventory right-click menu for objects you own. To attach an object to your HUD, right-click it, choose 'Attach HUD >' and pick one of the eight attachment points. The object will be attached to your viewer and only you will see it.
=== Scripting HUDs ===


The biggest advantage to HUD attachment points is that they do not show up in-world as attached to your avatar. Other Residents will not see them. Many applications for this feature can be imagined, including games where you do not want the other players to see what you have; Informational displays such as speedometers, simulator statistics, radars, ammunition remaining, etc. and photo slideshows of your grandmother's visit to the largest ball of cling-wrap in the world. Subjecting others to that should be abuse-report-worthy. Keep them in your HUD!
Most scripted functionality works with HUDs, with the following exceptions. (The list is not exhaustive!)


HUD attachments can be scripted to take advantage of LSL, with a few limitations. Particles do not work on HUD attachments. In addition, there are a few known issues with HUD attachments. HUD attachments obscure chat bubbles if they overlap. HUD attachments can not be clicked-through because HUD attachments can receive touch events (by design). HUD attachments only appear in snapshots if you have the 'UI in snapshot' option enabled.
* Particles do not work. Don't have HUD [[prim]]s generate them. If a HUD attempts to generate particles, they appear at <0,0,0> in the current sim, annoying your neighbors.
 
* If a sound is triggered using [[llPlaySound]](), only the HUD wearer will hear it. If the land parcel they're over restricts sound entry/exit, the sound will not play.
** If a sound is triggered using [[llTriggerSound]](), the wearer and any bystanders will hear it.
* The [[Sensor]] will not detect the avatar wearing the HUD.
 
Scripted movement of HUD pieces is relative to the attachment points. The position vector used by [[llSetPos]]() is interpreted as [DESCRIPTION MISSING!]. A depth of -1 will render in front of a depth of 0.
 
Since HUD attachments cannot be clicked thru even if they're invisible, the common solutions to getting them out of the way are moving them and shrinking them.
 
If you are trying to move the HUD around relative to its current position, use [[llGetLocalPos]]() rather than [[llGetPos]]().
 
example:
 
<lsl>llSetPos(llGetLocalPos() + (<0.25,0,0> * llGetLocalRot()));</lsl>

Revision as of 05:15, 1 December 2010

Right-click an object in inventory and choose Attach to HUD > ... to use it as a HUD

What's a HUD?

In Second Life, objects can be worn on one of the eight HUD (short for heads-up display) attachment points). HUDs are essential to understand, since every SL Resident eventually comes across them sooner or later.

A HUD typically consists of a control panel with different buttons you can click on to do context-specific stuff. Some HUDs are "passive" and only meant to be looked at, not touched.

While general attachments appear on your avatar's body and other Residents can see them, HUDs are only visible to you and have a fixed viewpoint, similar to how they're used in video games and apps. However, the scripted effects of a HUD, like emitted chat, can be visible to other Residents and objects.

Objects specifically designed to be used like that may have "HUD" in their name to tell you where they'll appear, or they may have "(wear me)" in their name.

What are HUDs used for?

HUDs are used in many kinds of products where information needs to be directly communicated to you. Popular uses:

  • Animation overrides - Click buttons to change how your avatar looks when moving. Turn off the AO if animations conflict with sitting on furniture.
  • Books - HUDs are useful for viewing info that may be tricky to camera-zoom in on, or you simply don't want others to see it.
  • Combat systems - See your health, stamina, experience points, and other relevant in-game info. Use special powers (cast spells in an RPG) to attack enemies.
  • Customizable attachments - Click color swatches to change your hair, clothes, shoes, or more exotic accessories like neko tail and ears. Make particle effects (like fire and smoke).
  • Multi-tools - Be alerted when other avatars are nearby (including when you want privacy). Eject intruders from your land. Get region performance stats. And many more.
  • Photo enhancements - Show a fancy frame around your Viewer window to add an ornamental touch when taking snapshots.
  • Vehicles - Dashboards with speedometers and remaining fuel. Some cars even have a "turbo" or Back To The Future-esque "fly" button.
KBtip2.png Tip: You can browse and buy many HUDs on the Second Life Marketplace.

Troubleshooting HUDs

How do I move my HUDs?

HUDs are usually positioned towards a corner so they don't obscure your field of view (unless that's desired).

Once an HUD is worn:

  1. Right-click the HUD onscreen (not in your inventory) and select Edit.
  2. Drag the arrows to reposition the HUD.

The HUD remembers where it is the next time you login. In some circumstances (like a sudden Viewer crash), the HUD may forget its position, so use this workaround in addition to the above:

  1. Right-click the HUD and select Detach.
  2. Find the HUD in your inventory, right-click it and select Wear.

Why does wearing one HUD make another HUD disappear?

These HUDs are being worn on the same attachment point. There are eight HUD attachment points: Center 2, Top Right, Top, Top Left, Center, Bottom Left, Bottom, and Bottom Right. Despite their names, these only indicate where an HUD is initially positioned when you first wear it — as described above, you can always move them around as you wish.

To solve this:

  1. In your inventory, right-click one of the HUD and select Attach To HUD. In brackets, it shows you which point(s) other HUD(s) are currently attached to. Select a different attachment point that isn't already occupied.
  2. Move the HUD according to your taste using the above steps.

I can't see my HUD

There are several possible solutions:

HUDs scale depending on your Viewer window resolution. For example, if you shrink the window, they become smaller. There are several


This problem arises when the person who made the HUD (or gave it to you) has a screen resolution greater than yours: The HUD is attached at the position that it had on their screen, but that is outside your field of view. The solution is:

  1. Attach another HUD (one that you know works properly for you).
  2. Right-click it and select "Edit".
  3. Zoom out until you can see the other HUD.
  4. Left-click on the stray and move it back within the white rectangle marking your viewer's screen size. Note: use the arrowheads to move the HUD, clicking on the arrows' tails sometimes drops you out of edit mode.
  5. Close the Edit window to return to normal viewing.

This will only bring the HUD back into view temporarily. Once you close the HUD and reopen it, the problem will repeat itself.

Advanced usage

The below details are for Residents who want to create their own HUDs.

Scripting HUDs

Most scripted functionality works with HUDs, with the following exceptions. (The list is not exhaustive!)

  • Particles do not work. Don't have HUD prims generate them. If a HUD attempts to generate particles, they appear at <0,0,0> in the current sim, annoying your neighbors.
  • If a sound is triggered using llPlaySound(), only the HUD wearer will hear it. If the land parcel they're over restricts sound entry/exit, the sound will not play.
    • If a sound is triggered using llTriggerSound(), the wearer and any bystanders will hear it.
  • The Sensor will not detect the avatar wearing the HUD.

Scripted movement of HUD pieces is relative to the attachment points. The position vector used by llSetPos() is interpreted as [DESCRIPTION MISSING!]. A depth of -1 will render in front of a depth of 0.

Since HUD attachments cannot be clicked thru even if they're invisible, the common solutions to getting them out of the way are moving them and shrinking them.

If you are trying to move the HUD around relative to its current position, use llGetLocalPos() rather than llGetPos().

example:

<lsl>llSetPos(llGetLocalPos() + (<0.25,0,0> * llGetLocalRot()));</lsl>