Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle return on dismount?

Starchaser Webb
Artist / Builder
Join date: 23 Feb 2006
Posts: 30
03-13-2006 06:39
Is there any way to script a vehicle so it will return itself to the owner's inventory a set number of seconds after the owner unsits from it?

I want to create a vehicle which would include some no-copy animations for the pilot and passenger positions. So I want to ensure that it comes back after every use, even if I am unintentionally unseated from it by a security system or a sim boundry glitch.

Is this at all rational? Or should I make arrangements with the creator of the animations to get a copyable version of them, and not worry about losing a vehicle once in a while?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-13-2006 06:44
I don't believe that there's any way to have an object put itself in your inventory, so no, I don't think so.

You could have a vehicle that responded to emails, and went into "beacon" mode, telling the owner where it was and how far from the owner's current position, so it could be tracked down more easily that way. But I think in practice that it's easier and more convenient for the purchaser for you to get copy anims.
Starchaser Webb
Artist / Builder
Join date: 23 Feb 2006
Posts: 30
03-13-2006 06:54
Thanks. I think that perhaps an e-mail remote control might work. Though I definitely plan to approach the animation creator about paying extra for a set that I can copy, to be safe.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-13-2006 07:10
Here's a simple example of the sort of thing I mean:
CODE
integer gLId = 0;
integer gBeacon = FALSE;

beacon()
{
llInstantMessage(llGetOwner(), "I am at " + llGetRegionName() + " " + (string)llGetPos());
}

default
{
on_rez(integer p)
{
llOwnerSay("My email address is " + (string)llGetKey() + "@lsl.secondlife.com");
llOwnerSay("Email me with the subject 'beacon on' to start tracking beacon, or 'beacon off' to stop it.");
}

timer()
{
if (gBeacon) beacon();
llGetNextEmail("", "");
}

email(string time, string address, string subj, string message, integer num_left)
{
if (subj == "beacon on") {
gBeacon = TRUE;
beacon();
}
else if (subj == "beacon off") gBeacon = FALSE;
}
}

You'd probably also want some way for people to set an allowed email address, or a password, so that they only and only they could email the object.
Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
03-13-2006 09:11
After the avatar has been unseated for an appropiete amount of time, make sure physics are on, make the object go phantom, and then use llApplyImpulse(<0,0,100000>;) until the object leaves the grid.

:)
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
03-13-2006 09:22
Static - awesome trick, I'll have to try that some time. :)

Starchaser, one other thing to keep in mind; I've only seen it happen with very large vehicles, but they can also occasionally become unlinked, so you'll want to make sure that if your animations are not in your root prim, then the child prim with your animations also has a "return script"... But personally, I'd just try to get the animations so that you can make copies of the vehicle...
Starchaser Webb
Artist / Builder
Join date: 23 Feb 2006
Posts: 30
03-13-2006 11:36
I like the beacon script idea. I'll try that.

Static? I take it that if something 'goes off the edge of the world', by going too high up, that it will be forced to auto-return?
Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
03-13-2006 15:04
Correct. Anything that leaves the grid will return in your Lost & Found folder.

<grumbling>Assuming of course the asset server isn't acting wonky like it has for the past week. [Edit: this is partly why sometimes when you "take" something it either doesn't show in your inventory, or takes a very long time. I'm told it's either been fixed, or at least mitigated and to wait for v9 to roll out.]</grumbling>