Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Personal Pilot v0.1

Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
11-09-2004 14:47
Personal Pilot v0.1

Auto-pilot for your avatar

LEGAL

Copyright 2004 Shack Dougall

Licensed under the Apache License, Version 2.0 (the "License";);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

"Personal Pilot", "Auto-pilot for your avatar" and the Liferain tree logo are trademarks of Shack Dougall

DESCRIPTION

Personal Pilot is an attachment script that provides an auto-pilot function to move an avatar around and between sims.

For your convenience, Personal Pilot is available ready-to-use for $1 on the Liferain Park Skydeck in Atis(135,160,75)
Look for the transparent box with the Liferain tree logo.

Also, you can IM or e-mail me and I'll give you a copy for free.

However, everything you need is included in this post.

What this does:

1) flys an avatar to a place in global coordinates.
ideal for short hops between sims from a telehub or within a sim as an alternative to teleporting.
But could be used for long sightseeing trips and recreation. Also, could be modified to be the "engine" in an unmanned probe.
2) heads-up hovertext display with sim name, coordinates, sim FPS, and distance to destination.
3) able to move an avatar arbitrarily high.
4) reads locations from a notecard in the object's inventory
5) reads landmarks from the object's inventory
6) maintains a travel list of destinations to which the avatar is scheduled to go. This could be used to provide a tour feature or maybe even physical flying tricks.
7) collision detection and avoidance -- detects collisions and uses avatar-assisted avoidance :-)
8) off-world detection -- detects a path that is about to go off-world
9) cloaks when attached. uncloaks when unattached.
10) responds to chat commands when attached.

Included functions that I will eventually package separately:

1) llMoveToTarget engine: would be great for a slide-ways elevator that is capable of going in any direction across sim boundaries and to any height.
2) global coordinate functions, including a function for converting from a landmark's relative coords to global
3) heads-up hovertext display

What this doesn't have, but would work well with:

1) pathfinding -- for determining a path to travel from one sim to another, avoiding loaded and "missing" sims.
2) name service -- converting a sim name to a global corner coordinate and vice versa
3) location directory -- a global landmark service
3) keyboard control -- a flight or anti-grief script using llTakeControls
4) collision avoidance -- the ability to detect and avoid obstacles while in flight, perhaps with an off-world database of such objects
5) teleporting or phantom phasing -- Teleport at the beginning/end of a trip to allow exiting/entering buildings. Or engage phantom mode while traveling to pass through obstacles.
6) invisibility -- might make it less weird for people around as you phase through a building :-)

References:

Pathfinder (Karl Longwell)

Anti-Grief Script (Siro Mfume)

Phantom Avatars (Cross Lament)

Invisibility Prim (Beatfox Xevious)

How to Make:

1) Create a cube 1.5m x 1.5m x 1.5m and make it phantom. The size doesn't have to be precise, but...
1a) it can't be too big or the prim will be too heavy to move.
1b) it can't be too small or you will be too heavy to move.

2) create a notecard and add it to the object's contents
Call it 'locations'. copy the sample locations text into this notecard.

3) Create a new script in the object and paste the pilot script into it.

4) Name the cube something meaningful, so that you will know what it is in your inventory. Like "Personal Pilot v0.1".

5) attach it and you're ready to go.


How to Use:

Once the prim is attached, it will respond to the following commands on channel 7. You can change the channel in the script.
For example, in chat you could say "/7 display off" to turn off the hovertext display. It communicates with you using llDialogs and some chat whispers.

Commands:

display on
display off
cloak
uncloak

L name
looks up a location from the locations notecard or a landmark in the attachment's contents. Then, it opens a dialog to let you go there.

up x
down x
moves the avatar up or down x meters.

g x,y,z
moves the avatar to the specified coordinates in the current sim.

reset
causes the attachment to reload its locations notecard.

Cancel
cancels a trip, if you're moving. This returns control to the avatar.

Pause
pauses a trip and lets you fly around. Opens a dialog that lets you resume

Resume
restarts a paused trip.

There are a couple more, but I'll leave that as an exercise for the reader. :-)


Suggestions:

Start in a sim that you know.
Create a few landmarks in the sim and copy them to the pilot prim's contents. Rename the landmarks so that they are short, have no spaces, and can be typed easily.

Then, play with /7 L landmarkName.

Also, /7 up x is a good starting point.


Known problems:

1) Responds slowly after teleporting to a new area. Be patient, manual flying isn't great in these conditions either.
2) Multiple dialogs -- Sometimes more than one dialog will pop up. One of these is a result of a bug in llDialog when crossing sim boundaries. Also, sometimes it detects too many collisions and this opens more than one avoidance dialog.
Use the top dialog and "Ignore" the rest.
3) Avatar goes into falling animation -- If you want to look cool, make sure that you are flying when you engage the auto-pilot.
In fact, it's good to be flying for a number of reasons. this will also help you avoid obstacles.
4) A couple of times, it has seemed to stall right after crossing a sim boundary. But it continued normally when I hit the right or left key.
5) If something goes wrong, you could end up damped to your current position, i.e., you would be unable to move. A teleport should break you out of this or open your inventory and detach the pilot.
6) hangs if it goes into a no-script area under 15m. See 5)
7) the source is right at the 32K max size limit for scripts. I'm releasing it now because I'm about to break it into pieces and I don't know when it will be functional again.

SOURCE CODE

http://liferain.com/downloads/personal-pilot/

locations notecard:

CODE

// locations file for Personal Pilot
// entries are of the form:
// locationName : region corner : local coordinates
overlook: <260096, 258048, 0> : <10,10,65>
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
ziphren Moonflower
Future Full-Time Resident
Join date: 31 Oct 2003
Posts: 94
12-24-2004 03:20
hallelujiah!!!!
Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
This is a great idea!
02-18-2005 07:58
I really love the idea of this script. But it won't work for me because i am ignorant enough to not know what the region corner is or how to find it! Could someone clue me in please?
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
02-18-2005 19:05
From: Jincey Firefly
I really love the idea of this script. But it won't work for me because i am ignorant enough to not know what the region corner is or how to find it! Could someone clue me in please?


Good question and easy to answer :)

Put this script in any prim and touch it to get the region corner.
CODE

default
{
state_entry()
{
}

touch_start(integer total_number)
{
llSay(0, "Region corner is " + (string) llGetRegionCorner());
}
}


For more information check the wiki entry here. There's a good discussion of Global coordinates as a link.

It's also possible to copy landmarks to the inventory of the Pilot object and to go to that landmark by issuing the command "L <landmark name>". Where the <landmark name> is the name you have given the landmark in the Pilot's inventory. Best to shorten this from the original landmark name for easy typing.

This isn't a polished product and is meant as an aid to scriptors learning LSL. Also, I wanted to gage the demand for something like this but so far people aren't beating down my door for it.

I need to update it tho, since I've learned some things since the first post. Most notably, I was totally wrong about the Pilot needing to be a certain size. You can make it as small as you wish. Although you do need to worry about this if you adapt the script to function not as an attachment.

It could definitely be made a lot better. Anyone, let me know if you'd be interested in this as a product with support. I was thinking it'd be a good deal in the L$300-L$500 price range. That is polished and with support.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
02-18-2005 21:33
Bravo!
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
Thank You!
02-19-2005 15:43
Thank you for the quick reply and the script to find the right coodinates!

From: Shack Dougall
Good question and easy to answer :)

It's also possible to copy landmarks to the inventory of the Pilot object and to go to that landmark by issuing the command "L <landmark name>". Where the <landmark name> is the name you have given the landmark in the Pilot's inventory. Best to shorten this from the original landmark name for easy typing.

This isn't a polished product and is meant as an aid to scriptors learning LSL. Also, I wanted to gage the demand for something like this but so far people aren't beating down my door for it.



I did try to copy a landmark to the notecard, but the landmark was in the form of:

Villiage of Cotessa, Ukanipo (52, 231)

So 1st I changed it to:

Cotessa: Ukanipo: (52,231)

and that didn't work. I got a little script message saying it would not work because it needed the region corner (can't remember the exact wording). Then I tried changing it to:

Cotessa: (52,231)

and still no go with a similar message. That's when I came back to the forum to try and find out how to get the correct region corner. :)

As I am not a scriptor, but just a tinkerer of scripts so far, I can comment that I was able to learn a great deal from studying your script! And I think if you get it all polished up and release it to the market it could become quite popular. I think newbs and oldbies alike would love to be given a braclet or other item with this script in it to guide them to landmarks, events, places of interest, or on guided tours. Although I am not sure of the pricing for an item like that. But it could become popular and it seems that selling a lot of something less expensive is better than selling a few of something else that is more expensive. :o JMHO, and not even written in the sand :) .

And Thank You again!
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
02-22-2005 15:28
From: Jincey Firefly

I did try to copy a landmark to the notecard.



Ah, okay. I got ya. Short answer is that you need to copy the landmark to the inventory of the prim instead of to the notecard.

Here's the deal on using landmarks with PersonalPilot.

So, what you want to do is create a landmark in the usual way (World>Create Landmark Here).

The landmark will show up in your inventory under (My Inventory/Landmarks).

Now, Edit the Pilot prim and select the Contents tab.

Drag the landmark from your inventory into the contents of the Pilot prim.

It will show up in the contents of the prim. Sometimes this is referred to as the inventory of the prim.

Rename the copied landmark to be short and memorable. For this example, lets say that you rename it to be called "home".

Then, attach the Pilot prim and issue the command "L landmark_name". In this example, "L home".

Landmarks are searched before the notecard, I think. So if you had a "home" entry in the notecard, a landmark named "home" in the Pilot prims inventory would trump it.

Thanks for the questions! It's really helpful to me and I'm sure it will help others who come across this later.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
Such a simple mistake...
02-28-2005 06:14
Ah, I think now we can see why I am merely a tinkerer of scripts! :D If I had read more carefully the 1st time I would have been all set!

I am off to drop landmarks into the Pilots content window!

Thanks again!
Alex Lumiere
Registered User
Join date: 1 Jun 2004
Posts: 228
03-12-2005 09:27
thanks!
Halbert Bienenstich
Registered User
Join date: 18 Dec 2005
Posts: 36
02-10-2006 07:11
Wonder if you could load this into the root prim of a "Doctor Who Tardis" vehicle and actually teleport to various sims in it.
tre Zobel
Registered User
Join date: 21 Jan 2006
Posts: 55
...
03-26-2006 13:49
Hi, nice invention, i know its kind of an old thread, but do you think this could be put into a vehicle? Thad be really cool lol.
Greentea Drebin
Registered User
Join date: 15 Mar 2006
Posts: 2
auto pilot
07-23-2006 08:19
Where is the attached code?
And can it be used in a craft?

The LSL code is zipped and attached. It was too big to post.
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
07-25-2006 14:48
From: Greentea Drebin
Where is the attached code?
And can it be used in a craft?

The LSL code is zipped and attached. It was too big to post.


Looks like the code got removed during a forum cleanup.

I don't think it will work in a true vehicle, but it's a good starting point.

Been so long since I looked at it that I'm not 100% sure that it still works.

In it's current form, it's mostly intended as a learning tool for scripters. Not as a polished product.

[UPDATE 2008-02-29]

It can now be found at: http://liferain.com/downloads/personal-pilot/
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Randal Kline
huh?
Join date: 1 Jul 2007
Posts: 192
02-09-2008 21:37
cant seem to locate this creation anymore. anyone still with a copy?
_____________________
* Snapshots *
http://sluniverse.com/pics/Default.aspx?name=Randal%20Kline