Tuesday, March 28, 2006

The uselessness of frames; a cathedral of sorts

As mentioned, I constructed a windmill that draws power from the movement of the wind, and was considering also building a solar panel, but then I thought: what sources of renewable energy are exclusive to Second Life? Why limit oneself to those existing in the Other World? I therefore created the latest generator, one that taps energy from the movement of frames. After all, frames mostly do nothing, there is plenty of excess power there for the taking. As long as the framerate remains high, it will continue to generate a reasonable number of Ordinal Energy Units.

One can find these items, as well as the battery, in the Engine Room at the Caledon Lighthouse. Please feel free to take a copy for your own examination. At the base of the lighthouse is a transit chair to take one directly there - one can also fly upwards, should one not have a great sensitivity to banging one's head.

~ * ~


A couple of other things of minor note: a neighbour of mine in Theretra very kindly offered to swap her plot (which was right in the middle of my other land) for a part of mine next door to it, which was advantageous for the both of us; I now have a large, continuous piece of land, and she is right next door to her friends without my firing range getting in the way.

I was not too sure as to what I was going to do with the increased area. I did have an idea concerning a ruined "steampunk cathedral", but a problem one faces when constructing things out of geometric primitives is that it is hard to actually make rubble without it involving a vast number of them - and so in the end, I simply built a sort of non-ruined cathedral.

It doesn't look terribly like a cathedral from the outside at the moment - I would like gargoyles and similar flim-flammery, and more rivets are clearly required - but I am running out of prims I'm afraid, and I do actually wish to put some objects inside it as well. Inside, it does, at least a little more. My plan, vague as it is at the moment, is to incorporate much in the way of gears and machinery, and also a miniature museum of computational history. (I'd like to build an Enigma machine in LSL, for a start.) It may, however, be a little blocky in appearance.

This would all be a lot easier were the land next to me not apparently Linden-owned, but set to sell to only one person. Dash it. There are several plots in that state nearby and, while on one hand I relish the peace of empty plots and dread the appearance of some appalling casino or other lag establishment, on the other, if I wish to extend myself I need to be able to actually buy these things. I could purchase random plots around Theretra simply for their prim allowance, but I would prefer to have continuous land, as stated above.

If only my prim mine did not simply distribute prims to other parts of the grid, but rather allowed me to keep them. I should really have thought of that, I now see.

~ * ~


Ah. Yes. One final point. I did also speak with a gentleman on Sunday who was interested in my Touring Dirigible script, visible in Caledon at the moment. I promised to inform him when said work was publicly released, only, rather predictably, I failed to take his name down. I do most humbly apologise and would ask him, if he is reading this particular piece, to contact me forthwith. 'Tis not actually publicly released as yet, but likely will be shortly, as soon as I decide on a price and arrangement for it. Clearly it should be copiable, as vehicles are prone to all sorts of mishaps, but on the other hand, should the smallholder wishing a brief tour of his or her land pay the same as the landowner using it for ferry tours across multiple sims?

Oh, Second Life is too short to worry about such stuff. I shall just pick a sum and sell at that.

Saturday, March 25, 2006

Butterfly windmill

As is so often the case, the butterfly nature of my mind has led to me completely forgetting to continue work on any of my past projects, and I have, instead, been working on something completely different today - a power distribution system. Clearly if one needs to have such large items as a lighthouse lamp working, one needs a power source, and as of the current moment, it is powered by a windmill.

Windmill close-up

The windmill itself generates electrical power which is then transmitted to, and stored in, a battery of my own design. (All power connections are safely buried underground or otherwise well insulated, do not be concerned.) The lighthouse then takes energy from the battery whilst it is lit.

Windmills do not actually generate an awful lot of power, but I take advantage of the peculiar cycle of day and night in Second Life here. Astronomers have calculated that a day lasts for three hours, whereas night lasts for only one - thus the windmill has three times the length of the nighttime when it is not required to power the lamp, and can therefore charge the battery.

For any parties interested in how this particular arrangement is scripted, it is a fairly simple three-part arrangement of shouts and listens. Only one permanent active listen is required, in the battery itself, on channel -70809.

Generator objects such as the windmill send energy to the battery by shouting a positive number on this channel. The battery then adds a number of OEUs (Ordinal Energy Units) to its store. At the moment, it is limited in capacity to 100,000 OEUs - more than this is released as a harmless shower of particles, though I would not expect it to ever get there.

Battery in lighthouse

The windmill's script is more complicated as it also alters the speed of the rotation according to the current wind velocity, and produces different amounts of power depending again on wind velocity, but a simple example of this sort of object would be the Etheric Generator, a fairly simple device producing energy through ambient ether flow (unfortunately, not powerful enough to light the lamp).

Consumer objects such as the lamp request energy from the battery by shouting both a negative number and a randomised channel for a response, for example "-300,-2379845". They then start to listen on their randomised channel for the battery's reply, because the battery might not actually have enough energy to fulfil their request. The battery removes either the given number of OEUs from its store, or all of the remaining ones, whichever is less, and shouts back the number of OEUs provided.

Flare Bulb and Etheric Generator

Again, the lighthouse lamp itself is rather more complicated than is necessary to illustrate this point, seeing as how it must also rotate and check for sunset and sunrise, but I have constructed a simple and inefficient Flare Bulb which takes power and wastes it by merely spitting out particles.

At this point, you, the reader may or may not be curious as to the scripting of these things, and in case of the latter I here present:

- The Battery script
- The Etheric Generator script
- The Flare Bulb script

So relatively simple, but more interesting things could perhaps be done with these basic principles. Note how the Flare Bulb only requests power once per minute usually, for efficiency, but if it does not receive its maximum, it will request more power once that has run out. On the matter of efficiency, as long as we do not have dozens of these devices or ones running at high timers, there is only one open listen, and the system should have relatively little impact on sim performance I would judge.

- - -

What is the purpose of this, I hear the gentleman at the back ask? Yes, you, sir. You look to me like some sort of clerk or other man of business, possibly even an accountant. Where is your soul, sir? Do you have no appreciation of the joys of simple creative activity? Begone with you, and run through the park with no shoes on until you have re-united yourself with the pleasures of experience rather than commerce, or until you tread on a squirrel, at which point you may stop so as not to cause further harm.

Tuesday, March 21, 2006

A Simulator Notification

The latest version of the model of the proposed Steampunk Sim can now be found in the back garden of the Manor at Caledon.

Steampunk Model - new home

The old location has disappeared, but this is a more appropriate place. Whilst there, why not visit Ordinal Enterprises and take advantage of the Steel Pigeon Projector (plus free rifles for sporting folk) or perhaps, take a ride on the Touring Dirigible, newly updated to process around Caledon?

Yes, some actual scripting posts soon. I have been working on a polite "Do Not Disturb" notifier which simply tells visitors that you do not wish to be bothered and would prefer it if they would leave - a civilised alternative to security devices. More significantly, I am also writing a key database system, which will allow one to store a practically indefinite number of keys, using linked scripts and rezzing of more when necessary. And there are always other projects on the hop, as it were.

Wednesday, March 15, 2006

Towering Issues

I have to say that, while the update to version 1.9 has been delayed for three hours, which will likely cause my fingernails to become practically non-existent, looking at the video by Ben Linden regarding camera controls - a sizeable Quicktime file - gives me hope that I will be able to tailor the view inside of the lighthouse to make it perfectly possible to view the interior, rather than the visitor's camera bouncing through stone walls in an unfortunate manner. This should be an extremely interesting thing to play with, in any case. Top show, Linden Labs! (At least I say that now, on the assumption that other problems will not be broken. It does not do to take a negative outlook on these things when one has no hope of actually affecting the outcome.)


I foresee that it might perchance become used a little much generally, but hopefully the necessity to script it will restrain some of the more egregious uses. And of course, one can always refuse to allow an interloper to control one's worldview.

Edit: Well, looking at the details, it appears that only attachments and vehicles can control the camera as yet, which is something of a blow. But I'm sure something will arrive at some point. Meanwhile, there are other things to consider.

Caledonianism, Enterprise and Bubbles

Recently I have been spending most of my time in Caledon, where one can be assured of good and polite conversation and fine design. I do occasionally pop back to the mainland when I wish to design something that explodes, but not too often these days.

I referred earlier to my confusion as to what to do with the plot; this has not really disappeared. Mr Desmond Shang, the landowner, provides every resident with their choice of one of his fine houses - I originally selected the Fogg Residency, which is extremely impressive but also, well, far too large for me, really. For a while it sat there, intimidating me with its immense open spaces, and while I made some pathetic efforts to furnish it, it became clear that I was unlikely to ever do so in a manner that would satisfy me.

There are those that have an instinct for interior design and the building of furniture, and I am afraid that I am not one of them. I can also be both ridiculously perfectionist and extremely tight-fisted. I was aware that I would not be able to build enough quality furniture of my own to decorate the place, and I was not prepared to spend the time and Linden Dollars necessary to select and buy it from others. (One might contrast all of this with Mr Gould's fabulous work on the Manor nearby - well worth seeing.)

I therefore removed the Residency (do not be concerned, it is still in my inventory and shall doubtless find its way out at some point in the future) and engaged in some extensive landscape gardening.

The Lighthouse, Caledon

The relatively flat terrain of Caledon has now developed a small hill, atop which is a lighthouse. I think that a lighthouse is a more suitable home for an inventor, really. As noted on the photograph above, the top deck, designed for socialising, supports one of my Champagne Waiters (now for sale) and a small table, though should really also have some chairs and perhaps a telescope. The lamp itself detects the rise and fall of the sun and, once it dips below the horizon, lights and begins to rotate. Inside the tower one can find transit chairs to take one to the different decks, as well as a vendor of my free items.

The issue that I have at the moment is that I have decided to begin a small career as a merchant, and really, the inside of a lighthouse is not a particularly good commercial environment. It is difficult for a customer to look around without their viewpoint going outside of the tower and their being presented with a blank stone wall, unless they enter mouselook, that is, in which case they lose many of the camera controls that they are used to. Baffling one's customers is not a terribly effective commercial strategy and thus I think that if I am to sell any of my creations, an exterior building might have to be, well, built. For the meantime I will be placing them in a separate vendor.

For posterity, here is a short list of other things that I am working on or plan to release soon:

* A non-physical ground vehicle script, enabling a design to be more stable and controllable than current ground vehicles in Second Life (which are, well, not) and also of greater than 31 prims. This works fairly well but unfortunately ignores the presence of other objects, which is amusing but not that desirable. I think it may emerge that physical vehicles and flattish terrain are the best solution. Given this, I expect that I shall be putting out the script for general inspection as a freeish item.

* A bubble machine, and associated scoreboard which counts the number of bubbles popped. I may have mentioned this earlier; it was a toy that I was working on a while ago and recently remembered. I find it rather diverting and others have as well. This will be appearing at my home area and in the appropriate vendor.

* I have also put my Steampunk Car up for sale, a large and unwieldy vehicle that nevertheless some people expressed an interest in. I think the wheels need a little work, as they are currently unsupported by spokes of any sort and look a little bizarre.

* The Cranial Pistol, a concealed device mounted on the side of the head. Upon entering mouselook, an protective monocle and barrel appear, and one can fire a series of small, somewhat inaccurate projectiles. This will be another that I shall be selling closer to market prices.

* I shall also be putting out the Mk909 Engine Rifle, which I really must stop fiddling with and just sell for heaven's sake.

* I had a request for a simple chat relay script - a chat relay is a device that allows the owner or another person to listen to speech from an area that they would not normally be able to do so. For this end I here publish two scripts - a simple chat relay, and an advanced chat relay which detects whether the owner is offline or within range of the relay device already. Be warned! Simple as it is, this script can be used for surveillance, which can land one in trouble should those being eavesdropped upon not appreciate it. Pay attention to propriety and simple good manners.

* And probably a number of other things which I have entirely forgetten.

---

Oh, I nearly forgot! The makers of SLurl have now officially incorporated my SLurlBuilder page into their site - thus no longer will one have to visit scrappy Geocities in order to access it. I have added a SLurl for the Lighthouse at Caledon to the side of this journal in honour, and hope to continue using this fine service whenever referring to a place in Second Life.

Wednesday, March 08, 2006

The Pepperment of Nearby Objects

I am most gratified by the number of people who have mentioned to me, during conversation in Caledon and elsewhere, though mostly in Caledon itself, that they have read this particular "blog" and, amazingly to me, continue to read it and even find it not completely worthless. Dear reader, your correspondent is most flattered indeed, and will certainly try to continue producing whatever it is that people actually come here for.

As to my current activities, well, I have been and continue to be somewhat busy, though not producing an awfully large number of actual products as such. One thing I have done is construct a Pepperbox Pistol for Professor Jefferson Gould. This is a six-barrelled firearm, designed to be used at close range, perhaps across a poker table.

A pepperbox pistol, from both sides 'George Bemis . . . wore in his belt an old original "Allen" revolver, such as irreverent people called a "pepper-box." Simply drawing the trigger back, cocked and fired the pistol. As the trigger came back, the hammer would begin to rise and the barrel to turn over, and presently down would drop the hammer, and away would speed the ball. To aim along the turning barrel and hit the thing aimed at was a feat which was probably never done with an "Allen" in the world. But George's was a reliable weapon, nevertheless, because, as one of the stage-drivers afterward said, "If she didn't get what she went after, she would fetch something else." And so she did. She went after a deuce of spades nailed against a tree, once, and fetched a mule standing about thirty yards to the left of it. Bemis did not want the mule; but the owner came out with a double-barreled shotgun and persuaded him to buy it, anyhow. It was a cheerful weapon--the "Allen." Sometimes all its six barrels would go off at once, and then there was no safe place in all the region round about, but behind it.'
- Mark Twain, "Roughing It"


I have decided to make all of my projectile armaments use (at least) two seperate scripts in the same prim for firing and control, as this eliminates the awkward and somewhat unpredictable sleep after each projectile is rezzed. One script is merely something along the lines of the following:

// Firing sub-script
// Ordinal Malaprop
// 2006-03-08

float gBulletSpeed = 60.0;

default
{
link_message(integer c, integer n, string msg, key id)
{
if (n != 0) return;
vector rot = llGetRot();
vector dir = llRot2Fwd(rot);
llRezObject("Bullet",
llGetPos() + dir + <0.0, 0.0, 0.75>,
dir * gBulletSpeed, rot, 1);
}
}


and with the other, whenever one wishes to fire a bullet, one simply calls

llLinkMessage(LINK_THIS, 0, "", NULL_KEY);

from one's main firing script. (One would also likely trigger a sound and activate other special effects.) In the case of the Pepperbox Pistol, the accuracy must be reduced, which is done by modifying the third parameter in the above script - the velocity of the bullet - by a random vector, thus making it travel in a different direction. For completeness it would be better to apply a random factor to the rot variable and thus rez and point the bullet precisely in its direction of travel, but really, in this case, it makes no practical difference.

The other element is to add a chance that the pistol will discharge all of its ammunition at once. For this purpose, we use an llFrand check whenever the trigger is pulled and, if this succeeds, instead of issuing one link message we issue a number equal to the current number of bullets left:

do {
llLinkMessage(LINK_THIS, 0, "", NULL_KEY);
} while (--gAmmo > 0);


The beauty of using link messages for this purpose is that they queue up whilst the fire script is asleep. Recall that after every llRezObject call, there is a short pause, depending on the mass and velocity of the rezzed object. If we had these calls issued from the main script the whole thing would sleep for a while, but given that it doesn't, we can do other things whilst the pistol is chain-firing. Any controls or sensors, for instance, would still activate, say one that detected whether the owner had left mouselook. (In this case there are no other things to be doing, but I can certainly imagine cases where one might.)

One does not wish to have one's master control script ever pausing any more than is absolutely necessary, and this holds even more true when one is considering such particularly sleepy functions as llGiveInventory and, God forbid, llEmail, which pauses for twenty seconds at each invocation. The use of link messages and sub-scripts is a vital tool for any complex scripting, and if I ever become organised enough to put together a scripting class for Withnail Academy, as I have occasionally muttered about doing, I shall certainly devote a lesson or more to it.

Tuesday, March 07, 2006

Communistic Troublemaking

Whilst not actively scripting, building or taking tea with like-minded folk, as I have mentioned previously, I am known to be involved in politics, much as I'm sure that many of you find that a bore. Occasionally I am known to engage in events such as political debates, helping in the construction of a Black History Month exhibit, or, in the case of last Sunday, a protest rally regarding the shameful laws recently passed in the state of South Dakota. Whilst I am not personally affected by the laws of the United States, it is a matter of both principle and international solidarity.

Merely touch the image below to view photographs of the event:

At the start

We visited Democracy Island, the Neualtenberg Marketplatz and the Welcome Area, pursued by a helicopter from the Metaverse Messenger and a selection of our regular team of griefers, who were actually relatively quiet and unobtrusive (once muted, anyway). It was only upon reaching the Welcome Area that we received a little opprobium from those around us - I believe that they were put out at their in-depth and wide-ranging debates on science, ethics and the Arts (these are standard topics for conversation at Welcome Areas) being interrupted by a squalid team of ragged Communists. For which I can only apologise.

Despite having Linden approval, I and many others ended the rally being frozen by a Linden; I was forced to leave Second Life due to technical issues anyway at this point. Certainly, it was an interesting experience and, I consider, worthwhile, though as with all rallies one is never quite sure whether one has made a blind bit of difference.

Friday, March 03, 2006

The property ladder

In a fit of enthusiasm last night I rented a large plot of waterfront land in Desmond Shang's new Victorian sim, Caledon. (This is not the steampunk sim that I and others have been discussing, but a number of us can be found there regularly.) It is an extremely pleasant sim generally and well worth a visit, even at this early stage. However, this morning I must admit that I have absolutely no clue as to what I am going to do with this plot.

I really have been spending money insanely on Second Life this month, buying land and L$, increasing my tier and so on, and the time has come for my accountant to grab me by the scruff of my neck, haul me back and wag a finger in my face, saying "Malaprop! Stop immediately! Spend a cent more and I'll have your guts for garters!"

So, hm. I shall probably put a shop there of some sort, selling my more complex and decorative items for a price. I am not giving up my old land or stopping building freebies and toys, they will always be available, but I have to make a little money or I will end up in debtor's prison at this rate. I think I may also build a café. I did also have another idea but I'm not sure of the demand for it... sorry to be cryptic, I shall mention it if I do go ahead. I'm sure that, as more people build there, ideas will start to come to mind.

I shall provide a direct link to the area once there is actually something there to look at. And there will be no more tier boosting, no more huge Lindex purchases. Well. Okay. There is one more thing to do. Don't look at me like that! It's really important, and it's a great investment, it will boost the value of my existing land... what are you doing with that ledger?

(Exit, pursued by an accountant.)

If a prim falls in the forest...

Goodness, it's been a while, hasn't it? Well, I have been reasonably busy, though that is not a very good excuse, I know. Conversing with my fellow steampunks takes up quite a bit of time, as has building various pieces of gadgetry - the Prim Mine in my home area, for one. As I say to new residents, you don't think prims come out of thin air, do you? No, they have to be extracted by dint of hard labour, sorted, and distributed across the grid.

I cannot hope to equal the output of some of the great Linden-owned prim mines, where the suspended are put to work (this stuff about "the cornfield" is nonsense, they hand the miscreant a pick and shovel and don't let them out until they've come up with the required number of toruses). However, I do have a steady flow of prims emerging from the ground now, which gratifies the heart.

My distribution system is causing me some irritation, though, and I can't see why. One can't let the prim reservoir overflow so, at regular intervals, a balloon takes off from next to the mine, ascends to a specified height and then shoots the prims off in all directions - a noisy process, but one which takes place quite high in the air. It then returns to await the next load.

I could simply have moved the balloon with llSetPos but I felt that this would be cheating. Instead, I made it into a self-piloted vehicle, like my tour balloon. The cycle is quite simple really, it all depends on the actions of a timer, which every time it ticks reasons thusly:
Am I within 2m of my current target? If so...
If the current target is the mine:
I've returned home. Turn physics off and use llSetPos to make sure I'm precisely at the home position - also, this way I can't be pushed about while asleep.
Go to sleep for sixty seconds.
Set current target to 100m up.
Turn physics back on again.
Toot whistle, announce departure.

Otherwise:
I must be at the top. Shoot prims out in random directions and make a lot of noise.
Then set current target to home (the home position is stored in a global variable at state_entry).

If not within 2m of my current target...
Calculate direction from current global position to global position of target.
Set velocity to be that divided by my rotation (I think that's what it is, I hate rotations).
It's quite simply really and while it took me a while to get working, that was just me being a fool.

What I'm finding rather annoying about it now, though, is that it is quite simply lazy. When I'm actually there, watching it, following it or sitting on it, it seems to perform as required, toot, up, bang bang bang, down, toot, up and so on. However, when I leave and return I invariably find that it is not at the mine. I take a quick jaunt upwards and what do I see? The balloon sitting there motionless. I have to give it a "push" somehow to get it moving again, either by sitting on it, touching it or, bizarrely enough, right-clicking and just selecting the edit option, not actually making any changes. Any of those things sends it down again and the cycle resumes.

I thought the idea of mechanical servants was that they didn't need watching all the time, that they wouldn't slope off for a fag whenever your back was turned, and then have the cheek to sit there insolently until you actually pushed them back to work. Clearly I was mistaken.

---

There are a couple more devices available at the showroom, a blank sign for protestors which is scripted to let one hold it in a reasonable posture rather than just dangling it vaguely, as avatars are wont to do if not given specific instructions, and a balloon, also for protestors or advertisers or anyone having a message to annoy others with, which follows its owner at a set (yet changeable) height above the owner's head. This balloon is much more obedient. Perhaps it knows it is being watched.

There is perhaps a serious point here that for purely cosmetic systems, one might consider that there is no actual point in them being active and laggy in situations where there is nobody around to see them. I prefer the idea that my balloon is actually active while nobody is around, certainly considering that sim resources in Theretra are hardly taxed, but were they to be I might incorporate a sensor that activates on returning home. If nobody is around, it turns the timer off and enters a waiting state, where it scans once a minute for avatars, and if any are around it wakes up and continues.