The Marathon Markup Language - Fader Elements: <faders>
This kind of element is for specifying various fader features,
the faders being what causes the whole screen to change color
when one is underneath a liquid or getting hit by something.
It has two kinds of child elements, <fader> and <liquid>.
The first kind, <fader>, specifies features of each individual fader;
it has attributes
- index: which fader
- type: which type of fade effect to apply
- initial_opacity (floating point: 0 = none, 1 = complete)
- final_opacity (floating point: 0 = none, 1 = complete)
- period: time for fader effect to complete, in engine ticks (1/30 second)
- flags: various features; get this value by adding the numerical values
corresponding to the desired features:
- 1 (hex 0001) Full screen
- 2 (hex 0002) Random transparency; makes flickering effect
- priority: higher is higher priority
and a child element <color>, which is not indexed.
For more on specifying colors, go here.
The fader types are these:
Tint: fade to the fader's color value:
[new color] = [old color] + ([fader color] - [old color])*[opacity]
Randomize: do random shifts of the colors:
[new color] = [old color] + [opacity]*[random numbers]
Negate: darkens light colors and lightens dark colors. For each channel:
[opacity complement] = 1 - [opacity]
if [old color] > 0.5 then
[new color] = max([old color], xor([fader color], [old color]) + [opacity complement])
else
[new color] = min([old color], xor([fader color], [old color]) - [opacity complement])
Intermediate results may be out of (0,1) range.
Dodge: some weird processing. For each channel:
[new color] = max([old color], 1 - (1 - [fader color])*[old color] - [opacity])
Intermediate results may be out of (0,1) range.
Burn: some weird processing. For each channel:
[opacity complement] = 1 - [opacity]
[new color] = max([old color],[fader color]*[old color] + [opacity complement])
Intermediate results may be out of (0,1) range.
Soft tint: fade to the fader's color value multiplied by the intensity
(maximum of color-channel values):
[intensity] = max(color channels of [old color])
[new color] = [old color] + ([fader color]*[intensity] - [old color])*[opacity]
In all these equations, color values are from 0 (black) to 1 (white),
and out-of-range result values are reduced to that range by subtracting whichever integer
will put the result into that range.
The second kind, <liquid>, specifies faders for liquids;
it has attributes
index: which liquid to apply the fader to
fader: this specifies which fader to use for this liquid.
opacity: how strong is the fader effect (floating point: 0 = none, 1 = complete)
The index is which one of these liquid types:
Water
Lava
Sewage
Jjaro
Pfhor
Home