UPDATE: A version of this script as Java plug-in using the new plug-in API is available here. I suggest to use it instead of this older version.
___________
This is my first attempt at a script of some complexity. I hope it will be useful: tests, suggestions, comments and criticisms are welcome.
Version 0.1 - Features
*) Displays current player heading as a standard navigation route and position in 'standard' geographic coordinates (N E) and block altitude:
Note that internal RW positive W longitude is converted into a more common positive E longitude.
*) Define a Home position and display radial, side (to the left or to the right of the player) and distance to it:
*) Define up to 9 waypoints and display radial, side and distance to any of them in turn:
*) Teleport to home and to any defined waypoint. Teleporting to waypoints can be disabled for servers which do not like players popping up everywhere. In fact, it is disabled by default; edit allowTpToWaypoints = false at the begining of gps.lua into allowTpToWaypoints = true to enable.
*) The scripts comes with English UI. However, UI tetxts are all grouped in a single file (messages.lua) to make translations easier.
Commands
/gps | toggles whole GPS display on/off |
/gps on | turns whole GPS display on |
/gps off | turns whole GPS display off |
/gps sethome | set home position to current position |
/gps showhome | toggles home data display on/off |
/gps setwp [n] [name] | sets n-th waypoint with name 'name' (both index and name are optional) |
/gps showwp <n> | turns waypoint display on with n-th waypoint (n=0 to turn off) |
/gps list | lists defined waypoints (incl. home) |
/gps home | teleports to home (if defined) |
/gps goto <n> | teleports to n-th waypoint (if defined and enabled) |
/gps help | displays a help summary |
/home | same as '/gps home' (for compatibility) |
/sethome | same as '/gps sethome' (for compatibility) |
Installation
Extract the files in the ZIP placing the whole GPS folder into the scripts folder of RW.
Open points and known issues
*) The script uses a database relative to the script itself not to the world; this makes it less suited to single-player multi-world contexts, as the positions of home and waypoints will be common to all worlds. However, I am reluctant to pollute the world database with extraneous data.
*) When the player first appears in the world, his/her heading is displayed as 000°; the value changes to the correct radial as soon as the player moves. This depends on how data are filled by RW and there is little I can do about
*) If the player changes of heading without actually moving, particularly while flying, RW does not always notify the script which cannot update the displayed heading. The heading is updated as soon as the player moves.
Enjoy! M.
EDIT: the originally attached ZIP file contained an already filled database. Users which downloaded it are advised to re-download and re-install it. The old ZIP can be identified because it has no version numbers at the end of the name. Thanks.