Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need HUD to trigger particle fx attatched to agent

Catarina Bourne
Registered User
Join date: 29 Jan 2007
Posts: 2
01-31-2007 09:08
Hi Guys!

I've really struggled to find any pertinant information on scripting HUDs. The LSLWiki doesn't have enough examples for me, I really need to see the functions in context to understand how to put a script together.

Anyway, I really want to build a HUD that can trigger various particle effects that are embedded in a prim that is attatched to my avatar. I guess I will drop several "poofer" scripts into the prim, so I will need each button on the HUD to trigger one of the scripts.

I'm also anticipating wanting to extend the HUDs capabilities, so any advice on calling an object to attatch to my av, displaying a radar etc. would be greatly appreciated.
For now though I'd be happy with just a poofer HUD ^_^
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
01-31-2007 11:57
First piece of advice... don't get hung up on something being described as a 'HUD device'. A HUD is nothing special, it's simply a regular object attached to a HUD point - objects that were around before the HUD points even existed can be attached as HUD devices.

Armed with this advice you can now proceed down the usual routes.

The basic way to trigger an effect is to say a command: /123 poof1, for example, and use a script's listen Event to respond to those commands.

A more elegant way is using an llDialog menu in conjunction with the listen Event - search for llDialog in this forum and you'll find masses of examples and discussion.

The more 'bespoke' route is to create your own prim-buttons and use the touch_start Event to trigger the same effects - touch_start is as simple as it gets, but making and texturing your own buttons can be time consuming.

All of these methods are basically the same - one object (or agent) 'speaks' a command on a chosen channel, and other object(s) independently listen and respond to the commands on that channel.

If you're familiar with scripting then the 'HUD' thing is a red-herring... if not, then I'd grab some freebie scripts from Yadni's Junkyard and start experimenting. :D


(Waiting for forums secondlife.com... dunno about anyone else but posting here is getting painful!)
Catarina Bourne
Registered User
Join date: 29 Jan 2007
Posts: 2
02-01-2007 08:59
Thanks, that made total sense, I think I'l take the lldialog route. I was wondering though; is there anyway to make this work without using listen? I hear it causes a lot of lag but I can't think of a way around it.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-01-2007 10:50
Not unless the prims trying to 'talk' to each other are linked in which case there's llMessgeLinked and the link_message Event. This communication is completely isolated within the linked object and is definitley the way to go if the scripts reside in a linked object.

Listens aren't that bad. Just make sure that the listen Event is listening to only the owner on a specific channel, for example: llListen(123, "", llGetOwner(), "";);

Things only get really laggy when the listen is set to 'hear' everyone on the open chat channel zero: llListen(0, "", NULL_KEY, "";); ...which is a so-called Open Filter.