2012-12-30

A HUD to lock a HUD

I've long been a fan of the RealRestraint Elegance Cuffs. They look great and, sized up for a male shape, they look pretty serious too. They were always Miss Vila's favourite.

Back when I last used to wear them 24/7 I never made use of the outfit manager of my viewer of choice. Back when I first started wearing them all the time (and had them locked on) there wasn't even an outfit manager. After they were last unlocked I started experimenting with the outfit manager and have got very used to using it. Recently, of course, I've started having items locked on me with RLV again and I've found, to my delight, that this actually does mix well with outfit management.

With one small wrinkle though...

The HUD that the RR cuffs rezzes and attaches doesn't seem to lock itself on with RLV. This means that any outfit that doesn't contain a link to the HUD (which is all of them) will throw the HUD off. And, of course, the HUD doesn't like this. It moans and blabs and says I'm doing bad things. Which is a little annoying because I'm not.

I did a little bit of searching through the docs and couldn't find an obvious solution (if I have missed one, please do say so) so I fixed it the one way I know how: with scripting. I wrote a little script that I've dropped into a prim that I've attached as a HUD (in my case a 0.02x0.02x0.02 sphere). Touch toggles it on and off. When toggled on it locks itself and the attachment point that's used by the RR HUD. Because of this outfit changes now happen without knocking the RR HUD off.

On the off chance that it's useful to anyone else... here it is:

//////////////////////////////////////////////////////////////////////
// RR HUD Locker
// By Antony Fairport.
//
// I wear the Real Restraint Elegance Cuffs pretty much all the time.
// They're locked on and they stay locked on. The probem, I've found
// is that the HUD they rez and attach doesn't lock itself in place.
// This means that every time I change my outfit, with the outfit
// manager in Firestorm, if the HUD isn't in the outfit (which it
// generally isn't because many of these outfits were created before
// I had the cuffs locked on), it gets knocked off. When it gets
// knocked off another one ends up being rezzed and attached and
// it moans and whines at me and, it seems, at my Mistress.
//
// So I created this script that I drop in a small prim that I
// also attach as a HUD. When touched *after* a RR HUD is in place
// it'll lock itself and the RR HUD. This means the RR HUD won't
// get knocked off during outfit changes.
//
// That's the idea anyway. Suggestions of smarter solutions are
// very much welcome.
//////////////////////////////////////////////////////////////////////
// Colours to use when in different states.
vector UNLOCKED_COLOUR = < 0.0, 1.0, 0.0 >;
vector LOCKED_COLOUR = < 1.0, 0.0, 0.0 >;
//////////////////////////////////////////////////////////////////////
// Lock with RLV.
RLVLock()
{
llOwnerSay( "@detach=n,detach:bottom=n" );
}
//////////////////////////////////////////////////////////////////////
// Unlock with RLV.
RLVUnlock()
{
llOwnerSay( "@clear" );
}
//////////////////////////////////////////////////////////////////////
// Default state.
default
{
//////////////////////////////////////////////////////////////////
// State entry.
state_entry()
{
// Simply jump to the unlocked state.
state Unlocked;
}
}
//////////////////////////////////////////////////////////////////////
// Unlocked state.
state Unlocked
{
//////////////////////////////////////////////////////////////////
// State entry.
state_entry()
{
// Set the colour.
llSetColor( UNLOCKED_COLOUR, ALL_SIDES );
// Ensure that all RLV restrictions are cleared.
RLVUnlock();
}
//////////////////////////////////////////////////////////////////
// Handle a touch.
touch_end( integer num_detected )
{
// Jump to the locked state.
state Locked;
}
}
//////////////////////////////////////////////////////////////////////
// Locked state.
state Locked
{
//////////////////////////////////////////////////////////////////
// State entry.
state_entry()
{
// Set the colour.
llSetColor( LOCKED_COLOUR, ALL_SIDES );
// Deny detaching this HUD and the RR HUD (which normally goes
// on "Bottom").
RLVLock();
}
//////////////////////////////////////////////////////////////////
// Handle a touch.
on_rez( integer start_param )
{
// We're being rezzed, which likely means the avatar is logging
// in. We should do the lock here. However, because I probably
// can't be sure what order attachments rez on login, and
// because I want to lock the RR HUD *after* it exists (dur!)
// we'll set off a timer and do the lock when that fires. It's
// not pretty but it works.
llSetTimerEvent( 5.0 );
}
//////////////////////////////////////////////////////////////////
// Handle a timer event.
timer()
{
// Kill the timer.
llSetTimerEvent( 0.0 );
// Apply the lock.
RLVLock();
}
//////////////////////////////////////////////////////////////////
// Handle a touch.
touch_end( integer num_detected )
{
// Jump to the unlocked state.
state Unlocked;
}
}

2012-12-23

Shakespeare Insult

Earlier today I happened upon this page, which is related to this page. Well, that just had to be turned into a bit of LSL, didn't it? Grab it and drop it into a prim and then touch it to get an insult. For bonus points attach the prim as a HUD to insult people around you.


//////////////////////////////////////////////////////////////////////
// Shakespeare Insult. Written by Antony Fairport after seeing
// http://www.pangloss.com/seidel/shake_rule.html and feeling that it
// needed to be made into a script, fast.
//////////////////////////////////////////////////////////////////////
// The three columns of parts of the insults.
list COLUMN1 = [
"artless",
"bawdy",
"beslubbering",
"bootless",
"churlish",
"cockered",
"clouted",
"craven",
"currish",
"dankish",
"dissembling",
"droning",
"errant",
"fawning",
"fobbing",
"froward",
"frothy",
"gleeking",
"goatish",
"gorbellied",
"impertinent",
"infectious",
"jarring",
"loggerheaded",
"lumpish",
"mammering",
"mangled",
"mewling",
"paunchy",
"pribbling",
"puking",
"puny",
"qualling",
"rank",
"reeky",
"roguish",
"ruttish",
"saucy",
"spleeny",
"spongy",
"surly",
"tottering",
"unmuzzled",
"vain",
"venomed",
"villainous",
"warped",
"wayward",
"weedy",
"yeasty",
"cullionly",
"fusty",
"caluminous",
"wimpled",
"burly-boned",
"misbegotten",
"odiferous",
"poisonous",
"fishified",
"Wart-necked"
];
list COLUMN2 = [
"base-court",
"bat-fowling",
"beef-witted",
"beetle-headed",
"boil-brained",
"clapper-clawed",
"clay-brained",
"common-kissing",
"crook-pated",
"dismal-dreaming",
"dizzy-eyed",
"doghearted",
"dread-bolted",
"earth-vexing",
"elf-skinned",
"fat-kidneyed",
"fen-sucked",
"flap-mouthed",
"fly-bitten",
"folly-fallen",
"fool-born",
"full-gorged",
"guts-griping",
"half-faced",
"hasty-witted",
"hedge-born",
"hell-hated",
"idle-headed",
"ill-breeding",
"ill-nurtured",
"knotty-pated",
"milk-livered",
"motley-minded",
"onion-eyed",
"plume-plucked",
"pottle-deep",
"pox-marked",
"reeling-ripe",
"rough-hewn",
"rude-growing",
"rump-fed",
"shard-borne",
"sheep-biting",
"spur-galled",
"swag-bellied",
"tardy-gaited",
"tickle-brained",
"toad-spotted",
"unchin-snouted",
"weather-bitten",
"whoreson",
"malmsey-nosed",
"rampallian",
"lily-livered",
"scurvy-valiant",
"brazen-faced",
"unwash'd",
"bunch-back'd",
"leaden-footed",
"muddy-mettled",
"pigeon-liver'd",
"bscale-sided"
];
list COLUMN3 = [
"apple-john",
"baggage",
"barnacle",
"bladder",
"boar-pig",
"bugbear",
"bum-bailey",
"canker-blossom",
"clack-dish",
"clotpole",
"coxcomb",
"codpiece",
"death-token",
"dewberry",
"flap-dragon",
"flax-wench",
"flirt-gill",
"foot-licker",
"fustilarian",
"giglet",
"gudgeon",
"haggard",
"harpy",
"hedge-pig",
"horn-beast",
"hugger-mugger",
"joithead",
"lewdster",
"lout",
"maggot-pie",
"malt-worm",
"mammet",
"measle",
"minnow",
"miscreant",
"moldwarp",
"mumble-news",
"nut-hook",
"pigeon-egg",
"pignut",
"puttock",
"pumpion",
"ratsbane",
"scut",
"skainsmate",
"strumpet",
"varlot",
"vassal",
"whey-face",
"wagtail",
"knave",
"blind-worm",
"popinjay",
"scullian",
"jolt-head",
"malcontent",
"devil-monk",
"toad",
"rascal",
"Basket-Cockle"
];
//////////////////////////////////////////////////////////////////////
// Return a random integer.
integer IntRand( integer iMin, integer iMax )
{
return iMin + (integer) llFrand( iMax - iMin + 1 );
}
//////////////////////////////////////////////////////////////////////
// Default state.
default
{
//////////////////////////////////////////////////////////////////
// Respond to a touch.
touch_start(integer total_number)
{
// Get random parts of the insult.
string s1 = llList2String( COLUMN1, IntRand( 0, llGetListLength( COLUMN1 ) - 1 ) );
string s2 = llList2String( COLUMN2, IntRand( 0, llGetListLength( COLUMN2 ) - 1 ) );
string s3 = llList2String( COLUMN3, IntRand( 0, llGetListLength( COLUMN3 ) - 1 ) );
// Say the insult.
llSay( 0, "Thou " + s1 + " " + s2 + " " + s3 + "!" );
}
}

2012-12-20

Math Error

Anyone who's been in the Z&A main store over the last year or two will have met Zanda at some point. He's our shop bot (or, more correctly, an avatar run by some software and with scripted agent status registered with Linden Lab). Chat near him shows up in his console and this includes object chatter and, of course, chatter on the debug channel. I'll often see errors thrown by people's attachments, the most common being AOs complaining about missing animations, the very common "stack-heap collision" and, on occasion, "too many listens".

And, now and again, there'll be a "Math Error". None have been quite as amusing as this one I just saw:

BOOBS FOR HUD: [script:mm_resize] Script run-time error
BOOBS FOR HUD: Math Error

I'm afraid to ask...

2012-12-13

Isolation, Raven Park style

One of my earliest introductions to heavy use of RLV came in late December 2009 when I first discovered the POD Prison at Stonehaven. I won't go into lots of details about how it works here, but simply put it's a RLV-based prison system that involves very heavy isolation for a fairly short period of time (at least to begin with -- long-term use can end up with very long sentences, if you wish it).

So when we were working on the new Mansion for Raven Park it was decided that one of the new rooms would be a perfect location for a POD Prison. Today I gave it a quick test with a one-hour sentence:


It worked well and brought back a lot of fond memories of my early days of experiencing RLV (a time before I started dabbling with the API myself).

Normally POD Prisons tend to have a very futuristic sci-fi/space feel to them (it is designed to be a space station prison after all) but we've had a go at making it feel a little more Raven Park. The design is aiming for a Victorian mad scientist sort of feel. Think Tesla gone mad with a vague Steampunk feel. Perhaps with a nod to something HG Wells might have written about. I think we might have pulled it off.