Lib Starmap

From Elite Wiki
Revision as of 12:58, 6 October 2018 by Svengali (talk | contribs) (First draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
IconLib.png

Overview

Lib_Starmap introduces In-System-Maps in 3D (or 2.5D *sigh*). These maps can be shown on missionScreens and inflight. On missionScreens they can be animated (e.g. through Lib_Animator). Inflight users can control them via the Advanced Space Compass. Usage for AddOns is easy.

Lib_Starmap requires shader support to work.


Technical

missionScreen

Lib_Starmap creates a missionScreen and places the objects based on real world coordinates and assigns textures. Up to 12 elements can be shown (either standard objects like the sun, planet, mainStation, etc or custom). The object positions are scaled down for display. Far out positions beyond a hardcoded point are compressed, so it will still work even if AddOns like DistantSuns are used. The next step is to zoom the whole thing to fit in the screen. And finally it can be animated (optional) to give a visual impression of the things the player should know. Animations can contain text, sounds and movements. The created objects are just planes using a billboard vertex shader, so they will always point to the player. Standard objects like secondary stations, carriers, beacons will use a color-scheme, custom objects can use this scheme as well.

Inflight

The mechanism allows inflight usage as well. This is specially interesting for missions. The script creates a visualEffect for it and tracks marked objects to update positions on the map. If they slip away (exploded, removed or jumped) they are cleaned from the map. The map disables itself on red alert and enables itself again when things have settled. The orientation of the map is bound to the compass, so you can control it easily to see it from different angles. The visualEffect gets removed on docking, dying or jumping.

General

Both maps (missionScreen and inflight) do work in interstellarSpace as well, so it is possible to get back to the [0,0,0] position, which was hard before (through using the FPS display). The maps are not accessible through equipment or interface handling - they have to be called by script. And the calling script decides what kind of elements will be shown. Usage for scripts is easy - for a standard setup it's only one line of code!


Methods

_start

_start: function( obj, force )

Start a map on .missionScreenOpportunity or .shipLaunchedFromStation.

Parameters:

obj
Object.
ini
Array. Required. Max 12 entries. Either String or Object { map:TEXTURE, ent:ENTITY [,col:Number] }
PS
Player ship.
WP
Witchpoint.
S
Sun.
P
Planets (the first one will be the mainPlanet).
M
Moons.
ST
Main station.
STG
Secondary stations with allegiance of galcop, hunter or neutral.
H
Rock Hermit.
AS
Asteroid fields.
message
String. Optional. Initial message text.
title
String. Optional. Screen title.
ani
Object. Optional. Animation for Lib_Animator. Requires capture flag!
force
Bool. Optional. Forces update of system entities before settings up the map.

Returns:

true or false.


Example:

worldScripts.Lib_Starmap._start({ini:["PS","WP","P","S","ST","H","AS","AS","AS","AS","AS","AS"]});