Friday, March 03, 2006

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.

1 Comments:

Anonymous Anonymous said...

I have a similar problem with my automatic ships. While I'm around they wander around the void sims perfectly. But every now and then I come across one that has just stopped. A touch, or right clicing and editing etc and off it goes again.

Great Blog by the way.

3/07/2006 06:40:00 PM  

Post a Comment

<< Home