Difference between revisions of "Explosions.plist"
(New 1.81 explosions.plist) |
m (category added) |
||
Line 69: | Line 69: | ||
If a ship does not specify an explosion type the default is <code>("oolite-default-ship-explosion","oolite-builtin-flash")</code>. | If a ship does not specify an explosion type the default is <code>("oolite-default-ship-explosion","oolite-builtin-flash")</code>. | ||
+ | |||
+ | [[Category:Oolite]] | ||
+ | [[Category:Oolite scripting]] |
Revision as of 14:00, 24 November 2014
This is a planned feature for Oolite currently only available in the 1.81 nightly builds. It may change before release.
The explosions.plist file defines various explosion graphics which can be assigned to ship objects.
Each explosion entry has the following format:
"oolite-default-ship-explosion" = { "alpha" = 0.85; "color_order" = "rgb"; "count" = 25; "duration" = 1.5; "growth_rate" = 1.5; "size" = 2.5; "texture" = "oolite-particle-cloud2.png"; };
Explosions are created by overlapping several copies of the explosion texture with varying colours at slight offsets, and then growing and fading those colours according to the properties. Explosion texture files must be square textures, which will be treated as greyscale. To avoid display artifacts, in general the content of the texture should be kept within the largest circle which will fit within the square.
Contents
Properties
Getting an explosion to look 'right' takes quite a bit of trial and error in both the texture files and the configuration. Using the debug console to spawn and then explode ships makes it quicker.
alpha
Number between 0 and 1, the initial alpha opacity level of each explosion component.
color_order
This determines the initial colour of the explosion and how it fades out.
If the value is "white" the initial explosion component colours will be randomly selected shades of gray, and will fade to black while keeping all colour channels identical.
If the value is "rgb", "rbg", "grb", "gbr", "brg" or "bgr" then the following will happen:
- The colour channel represented by the first letter will be assigned a random intensity from 0 to 1.
- The colour channel represented by the second letter will be assigned a random intensity from 0 to 1. If the second channel is brighter than the first channel it will be reduced to be equal to the first channel.
- The colour channel represented by the third letter will be assigned a random intensity from 0 to 1. If the third channel is brighter than the second channel it will be reduced to be equal to the second channel.
So, for example, "rgb" will generate reds, oranges, yellows and whites, while "gbr" will generate greens, cyans and whites.
The colour will then fade away starting with the third channel. When that is zero, the second channel will start to fade, then the first. So with "rgb" the explosion will fade out from white through yellow, orange, red and then to black.
count
The number of explosion components per explosion object. Values greater than 10 will be reduced to 10 if the game is not in "Extra Detail" graphics mode.
duration
The total life of the explosion in seconds. Some components may last less time than this if their initial random brightness was low.
growth_rate
The growth rate of the explosion in arbitrary units. Higher is faster.
size
The size of the explosion relative to the collision radius of the exploding object. This property is ignored for explosions created from the dealEnergyDamage
method, which have a size proportional to their damage radius. Note that depending on how much of the space in the texture was used, the explosion may appear somewhat larger or smaller than this.
texture
The name of the texture file, placed in the Textures/
folder.
Usage
The explosion_type property in shipdata.plist is used to define the explosion method for a particular ship class. It consists of a list of explosion names, all of which will be set of simultaneously when the ship explodes.
Explosion names may be entries in explosions.plist or may refer to special built-in explosion types. The three builtin explosion types are:
- "oolite-builtin-flash"
- "oolite-builtin-slowcloud"
- "oolite-builtin-fastspark"
A combination of the three built in types is used as the explosion graphic when at minimum graphics settings.
If a ship does not specify an explosion type the default is ("oolite-default-ship-explosion","oolite-builtin-flash")
.