BGS2 Doc

From Elite Wiki
Revision as of 23:05, 13 February 2018 by Svengali (talk | contribs)

Console usage

worldScripts.BGS._Help();


Autoconfiguration

Countdown

BGS checks the keys in customsounds.plist ([galactic-hyperspace-countdown-begun] and [hyperspace-countdown-begun]) to see if another soundpack is using them. If so BGS disables its own countdown.

Effects

On startUp BGS checks the shader support level. If it's switched off or no shader support is available all effects are disabled.


Properties

$pub - Holds various entries for customization via other AddOns.

chat
Array. Holds filenames for aegis chatter.
engineAmbi
String. Ambient sound while engine is running.
engineDown
String. Sound for decelerating.
engineUp
String. Sound for accelerating.
witch
Array. Countdown sounds starting with zero.
witchCNT
Number. Start countdown at +1.
witchG
String. Sound for galactic jump.
witchH
String. Sound for standard jump.


shipdata.plist

Additional keys for specific entities are available and can be specified via script_info dictionary.

Keys

bgs_engineAmbi
String/Filename. Playership - engine mumble sound.
bgs_engineUp
String/Filename. Playership - engine acceleration sound.
bgs_engineDown
String/Filename. Playership - engine deceleration sound.
bgs_tunnel_off
Boolean. Station - disables the tunnel effect.
bgs_tunnel_shape
Number. Station - range 0.38 - 5.0. If not specified the script takes the ratio of the first found dock bounding box x/y to get the shape.
0.5 - square 45 degrees rotated with aspect ratio
1 - circle with aspect ratio
>1 - squircle...rectangle (>1.1 with decreased aspect ratio to get a wider tunnel)
bgs_tunnel_texture
String/Filename. Station.
bgs_tunnel_tint
Array. Color for lines in docking effect.

Examples:

Playership (without preloaded sounds):

 script_info = {bgs_engineAmbi = "myEngine.ogg"; bgs_engineUp = "myEngineUp.ogg"; bgs_engineDown = "myEngineDown.ogg";};

Station:

 script_info = {bgs_tunnel_texture = "myOwnTexture.png";};

Docking FX

The effect is done via VisualEffect entity. The model is a plane and gets scaled to fullscreen (with z = -1).

The input texture (figure 1.1) gets wrapped around via abs(atan(y,x)) (figure 1.2). You can imagine this as a cylinder with infinite length and you are looking into it, with a mirror axis along x. As the shape can be adjusted we can reach square, circle and squircle (figure 1.3).

The shader applies some glowing lines and adds a opening door. Artists don't have to care much about it - the shaders does it on it's own. The interesting bit though is the coloring of the door. It's taken from the input image and gets mixed with the glowing lines to some extend to get a smoother transition between tunnel and door and the tint (bgs_tunnel_tint, default rgb: 0.2824, 0.171, 0.0507) gets applied.