< LSL Protocol
May 07, 2009 Welcome to the Second Life Forums Archive. These forums are CLOSED. Please visit the new forums HERE. Or search the achive. Sometimes a hud designer will work on the assumption that the hud will always be in a certain part of the screen, and not consider any other possibilities. Unlike specialized HUDs, the Cool Hud may work with any scripted object which accepts commands on a private channel, provided the specifications of the protocol described here are followed. The Cool Hud itself is free (like in 'free beer') and freely redistributable (it got the copy-ok and transfer-ok permissions). Jan 22, 2015 Second Life Wiki HTML HUD Demo. 1 TODO: 2 HTML HUD Demo: 2.1 Screenshot: 2.2 Tip: 2.3 Source code: TODO: Suggest a Stop All Animations button be added to Animations selection frame for convenience. You must grant this HUD '+ 'permissions to animate your avatar for this feature to work.' The LIFE HUD for SL. L I F E is a Revolutionary HUD Changing the way you Role-play and enjoy your time with friends and family in Second Life. Explore L I F E Today! Dec 27, 2015 Particles do not generally work. Since Viewer 1.23 there is an experimental debug setting RenderHUDParticles that you can try, but it is incomplete and switched off by default. On very old viewers (before 1.23) HUD particles would show in world, at (0, 0, 0).
Back to LSL Protocol
- 4Basic Protocol
- 5Extended Protocol
What is the Cool Hud ?
The Cool Hud is a small, unobstrusive HUD which was designed by Henri Beauchamp to trigger the menus of his Cool Products.
It can be used to control up to 15 (for v3.20) different scripted items, each being associated with one of its buttons. When pressing a button of the HUD, the menu of the corresponding item is pulled down.The Cool Hud was originally designed to control scripted attachments, but nothing prevents you from using it with items rezed in-world (note however that the avatar wearing the HUD will then have to be within 20m of the item in order to be able to control the latter via the HUD).
Unlike specialized HUDs, the Cool Hud may work with any scripted object which accepts commands on a private channel, provided the specifications of the protocol described here are followed.
The Cool Hud itself is free (like in 'free beer') and freely redistributable (it got the copy-ok and transfer-ok permissions). You can get a Cool Hud from the Cool Shop, in the freebies corner. Reselling the Cool Hud is forbidden, please contact Henri Beauchamp if someone attempts to or did sell a Cool Hud to you.
Alternatively and using the specifications below, you may design your own, compatible HUD.
Over time, the Cool Hud functionalities were expanded, and the v2.00 specifications described here provide a relay messaging system between items declared in the Cool Hud.The Cool Hud v2.xx also includes a RestrainedLove relay (see LSL_Protocol/Restrained_Love_Relay/Specification), for which the v2.00 protocol also provides a command to declare trusted dominants.
Requirements
The items designed to be compatible with the Cool Hud must:
- Permanently listen to a private command channel. The channel number may be any positive or negative integer.
- Provide a command to pull down their main menu.
- Provide a texture UUID for use in the associated button of the Cool Hud. The texture shall be a square one and does not need to be larger than 128x128 pixels. It is better if it does not use any transparency (i.e. if it got no alpha channel).
- Declare themselves to the Cool Hud on rezing and on initialization of their scripts (see below).
- Either recognize or silently reject relayed commands from the Cool Hud.
Communications
They are bidirectional but performed on distinct channels.
- The Cool Hud permanently listens on channel -888888 and receives commands on this channel only.
- The compatible item may listen on any private channel number of its own, and must declare this channel to the Cool Hud (see below). The Cool Hud will then use this private channel to send commands to the item.
Basic Protocol
- On rezing (on_rez event) and on initializing (state_entry), the compatible item must declare itself to the Cool Hud. It does so by sending the following parameters on the Cool Hud channel as a CSV list: Id name (*), Texture UUID, Command channel, Command to send to pull down the menu
(*) Please note that for the Id name parameter, all names starting with 'Cool ' and ending with ' Hud' (i.e. 'Cool Whatever Here Hud') are reserved for Cool Products (the Cool Hud may use different, proprietary protocols with devices registering themselves with this form of Id name)
- Whenever the Cool Hud receives such a declaration message, it first checks to see if a corresponding button already exists, by comparing the Id name with the ones it already registered. If the name already exists, then the Cool Hud refreshes the associated data (texture, command channel and menu pull down command) with the newly received one. If the name was unknown so far, and provided it still got free slots (unaffected buttons), the Cool Hud 'adds' (renders visible) the corresponding button, using the texture which UUID was passed in the declaration as the button texture and storing the associated data for later use.
- Whenever a button of the Cool Hud is pressed, the Cool Hud renames itself to take the associated Id name, then it emits (with a llSay()) the associated command on the associated command channel. Once this is done, it renames itself back to its original name.
- On receiving the command on its command channel, the compatible item should check that the sender belongs to the same owner as itself, then if equal, it should take the appropriate action for the command it receives (it could also check for the name of the sender which is the Id Name it registered with the Cool Hud).
Implementation example for a compatible item
Extended Protocol
Over time, some extensions have been added to the above protocol, in the form of commands sent to the Cool Hud on its private channel (-888888). These commands are to be sent in the form:
%command;parameters
with:
Lords mobile garrison vs reinforce. So we have to manually put him there untill you see this it clearly says 'situation: garrisoned' now. Originally posted by:so i'm gonna post an example here. As you can see i start a brand new greenskin campaign waaaaghi recruit my brand new lord on turn 1he is recruited, but as you can see he is not actually inside the city.
![Second life lindo Second life lindo](/uploads/1/2/4/3/124391145/157767767.jpg)
Hide Hud Second Life
- 'command': the name of the Cool Hud command.
- 'parameters': the parameters for this command, which must not contain any semi-colon (';').
Note also that there shall be no space between the command and the semi-colon (i.e. '%command ;parameters' is not valid).
Crack for techstream 12.30. It is not necessary for the item issuing these commands to be registered with the Cool Hud, but they however must belong to the same owner as the Cool Hud to be taken into account and acted upon.
As of its v2.00, the Cool Hud accepts the following extended commands:
Dominants declaration
Second Life Hud Not Working
![Second Life Hud Not Working Second Life Hud Not Working](/uploads/1/2/4/3/124391145/773227914.jpg)
Your scripted objects may declare trusted dominants to the Cool Hud for use with its built-in RestrainedLove relay. The objects owned by the trusted dominants are also trusted by the RestrainedLove relay when the latter is in 'Auto-accept' mode, which means that in this mode no confirmation will be asked by the relay to its user when interacting with these trusted objects.
The general syntax for this command is:
%dominant;avatar1-uuid[,avatar2-uuid[,avatar3-uuid ..]]
Example:
By calling RegisterPrimaryDominant(), the item will register the primary dominant, while by calling RegisterSecondaryDominants() it will register all the secondary dominants to the Cool Hud.
Note that the Cool Hud will not make any difference between the two kinds of dominants in the above example: it simply considers all of them as trusted persons.
Messages relaying
It is possible for the Cool Hud to relay messages to the items which are registered with it. The advantage of using the Cool Hud for such a relay, is that any item can broadcast a message to other items for which it ignores what are their command channel. It avoids having to use one more permanent listener on a fixed private channel in all the items. The generic syntax for this extended command is:
%relay;message
where 'message' must not contain any semi-colon.
On receiving such a command, the Cool Hud relays it to all the items it got registered, on their respective private command channels, and in the following form:
%relay;message;originator object UUID
Note however that the Cool Hud does not rename itself (with the Id name) before relaying the command to each item like it does when one of its buttons is pressed.
This extended command is so far used by the Cool Products to relay arousal messages (for example between scripted genitals and scripted nipples), with the following conventions for the messages:
- arousal 0: avatar not aroused.
- arousal 1: avatar lightly aroused.
- arousal 2: avatar highly aroused.
- arousal 3: orgasm reached.
The 'hide' and 'show' commands are also implemented on some attachments so to allow hiding or showing them, depending on what other attachment is worn or showing (for example, a chastity belt will use a 'hide genitals' command to force the hiding of any worn genitals). Examples:
- hide genitals
- show genitals
- hide nipples
- show nipples
Finally, the 'status' command is also used to query the current state of a particular type of attachment and to allow syncing them with each others. Examples:
- status genitals
- status nipples
- status chastity
- status diaper
to which the attachments shall reply with either their state of arousal or with the last hide/show command they emitted.
So, for a scripted attachment sensitive to arousal (let's say nipples, for example), you could use some code like:
Retrieved from 'https://wiki.secondlife.com/w/index.php?title=LSL_Protocol/Cool_Hud_Protocol&oldid=1195245'
- 2Scripting HUDs
This article describes how to create your own HUDs. For basic information about HUDs, see Heads-up displays (HUDs)
Building and Texturing HUDs
It is easiest to keep the root prim rotation at <0., 0., 0.> while building. That way, you can know that the west side of the object will be the one facing the screen when attached. For a box prim, that is face 4.
Since an update about 2012 (SH-2646), HUD attachments are always rendered as full bright.
Prim alpha and texture transparency work as expected. If you want your HUD to be totally transparent, consider making only the front faces that way. The flat projection will keep the other sides hidden, and it will be easier for residents to find the object if accidentally dropped or forgotten on the ground.
HUD objects will capture mouse clicks, even on their transparent parts. If you are using a round interface element, a cylinder would not be a bad choice of prim, so it does not use more space than it needs.
Shiny works on the HUD, this can help to give an almost-3D appearance to some shapes, like spheres or sculpts. Not everybody enables shiny, so textured shading could still be your best bet.
Scripting HUDs
Most scripted functionality works with HUDs. They mostly work like any other attachment, but there are some special exceptions. A page with an HTML_HUD_Demo can be found on this wiki as well.
Differences in behavior
- 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.
- Like with all attachments, llSensor() will not detect the attachment or its wearer.
- Particles do not generally work. Since Viewer 1.23 there is an experimental debug setting RenderHUDParticles that you can try, but it is incomplete and switched off by default. On very old viewers (before 1.23) HUD particles would show in world, at (0, 0, 0) globally within the region (the southwest corner). SVC-2396
- Glow is not supported on HUD attachments. VWR-3167
- llSetText() is supported, but be aware that the text does not scale with the HUD or screen size, and the text size is under user control. Despite the limitations, some HUD objects use it to great advantage.
- Shared Media works on the HUD in Viewer 2.2 and later. On earlier 2.x viewers, clicks and audio may not be available.
Differences in coordinates
HUD center coordinates
HUD bottom right coordinates
HUD attachments are rendered with an orthographic projection, meaning that everything looks flat and there is no perspective. The objects are still 3D, and they can move in XYZ space and be rotated.
- The X coordinate moves away from and toward the wearer, a higher number is farther away and can hide a HUD prim behind others. You can use X changes in a single HUD object to reveal and hide buttons, for one example. There is no good way to grab the red X axis with the viewer editor, but scripts do not have this problem.
- Y moves right to left on the screen, a higher number is more to the left.
- Z moves bottom to top on the screen, a higher number is, well, higher up!
In HUD space, 1 meter is the height of the viewer window, including the menus and tool bar. The (0,0,0) position depends on the HUD attachment point. For the Center and Center 2 points, zero is the center of the screen. For the four corner HUD points, zero is that corner of the viewer window. Zero for the top and bottom is centered on the window, again hidden behind the menu or toolbar. There is no way provided to learn the width of the viewer window, or the pixel dimensions. (The FindScreenWidth script example can return the display width on touch, if the attachment is on one of the corner HUD slots.)
If 'Move & View>Automatic position for: Sidebar' is checked, the HUD coordinates will automatically be scaled to exclude the sidebar when it is open. If this feature is unchecked, the entire window width is used regardless. (Some third party themes may ignore this setting.)
Since HUD attachments cannot be clicked through even if they're invisible, the common solutions to getting them out of the way are moving, shrinking, or rotating.
Use llGetLocalPos() to learn an attachment's position on the screen, llSetPos() to move it. (llGetPos() looks tempting, but for attachments that tells us the avatar's position.)
Get mac apps for free. This example moves the HUD away from the wearer, possibly behind other HUD attachments:
Retrieved from 'https://wiki.secondlife.com/w/index.php?title=Creating_HUDs&oldid=1198584'