Let’s make a HUD – pt.1

In the heat of battle, some gadgets need to be deployed quickly. None of that digging through inventory crap.
So for a while now, I’ve been using a simple HUD (Heads Up Display) I made for exactly this purpose – to whip things out of my bag of tricks without letting a wizard dueling moment go to waste.
So this will be the first post in an informative series of lessons on building a simple battle HUD.
Its name? Let’s go with AggroHUD. >:]
AggroHUD – The Beginning.
Aggro is a jargon word in WoW, probably originally derived from the English words “aggravation” or “aggression”, and used since at least the 1960s in British slang. In MMORPGs, such as WoW, aggro denotes the aggressive interests of a monster/NPC.
Some examples are “We’ve got aggro!” and “Go aggro that monster”.
Yep.
One would think it should be a good idea to write out some formal disclaimer segment notifying you that I am releasing toys of mayhem and annoyance, sure to be abused, for the sake of education only – but it’s not like doing so would have changed your mind if you were intending on doing so anyway. I’m not that talented a writer.
So without further horn-tooting, let’s do the deed.
Pushing; shoving; it happens. Push back, with a barrage of blocks.
Messes. They can teach the overly-neat an important lesson. Make big messes with a barrage of blocks.
Start with two cups of fresh, pure evil
Step 1: physically make the HUD.
I use 2 prims, one in which I press to do things, and which will listen for commands and what not (which we shall call Mom) – and the other, which I press to quickly clear any objects I make with the killscript inside (which we shall call Dad). Dad has this infanticide script contained in him.
Step 2: gather your ingredients.
Make a cube. Scale it up a little bit. Insert the deathscript. Now multiply this cube so that it forms a 2x3x4 brick of blocks. Ah-ah! Don’t link them!
Select all of them, and without releasing a single one so that it they don’t drop, set them all to physical. Now ‘take’ them as a group of single prims. Name it something. I call it dissed.
Step 3: let’s cook!
Inseminate Mom with the birthing script.
The Chef’s Science

Initializers; a flag called mode which will control the functions, and what results from touching the Mom button; and the channel which we use to change the mode via keywords.

In this first installment, we have one function so far, and this listener is pointless. Regardless, it is important as we’re going to use it plenty. It is the main segment which will be updated in every subsequent installment.
Typing /13 blox will set our mode to fire the barrage.

To rez and fire off our toy, we need 3 properties: our avatar’s position in world coordinates, the velocity (which is also apparently the direction), and a rotation to apply to the rezed object upon creation.
Line 9 computes our position, in addition to an offset which is also affected by the avatar’s rotation/look direction.
Line 10 figures out the direction to shoot, while multiplying it by the speed at which you want to shoot it to create a velocity value.
Line 11 is the orientation of our block of boxes. This is subject to change from what is shown depending on how you oriented your brick during creation.
Ref lookup: llRot2Fwd(rotation rot)
Ref lookup: llEuler2Rot(vector vec)

[...] you’re being knocked around by hooligans shelling you with prop launchers (ie: see Lesson 1), or are being attacked by a rogue Goku with a sim-shaking Spirit Bomb, or got hit by the classic [...]