KDScript →

The following scripts dynamically update the fog, precipitation, and environment map settings used by the Dark Engine's renderer.

Parameter | Type | Description | Default value |
---|---|---|---|

`transition` | time | length of transition between states | `0` (instantaneous) |

`curve` | string | shape of curve to interpolate values along | `linear` |

The fog and weather scripts can provide smooth transitions between the old and new values. The `transition`

parameter specifies the length of the transition. If that parameter is undefined or set to `0`

, the transition will be instantaneous. The `curve`

parameter specifies the shape of the interpolated curve, from among the values below. (*t* is the progress of the transition in the range [0.0, 1.0], while *α* is the multiplier used to interpolate between the starting and ending values at that time.)

`linear`

- Straight line:
*α = t*(solid black line) `quadratic`

- Parabolic curve:
*α = t*(solid red curve)^{2} `radical`

- Radical curve:
*α = √t*(solid blue curve) `log_10`

- Logarithmic curve (base 10):
*α = log*(solid green curve)_{10}(0.9t + 0.1) + 1 `pow_10`

- Power curve (base 10):
*α = (10*(solid orange curve)^{t}- 1) / 9 `log_e`

- Logarithmic curve (base
*e*):*α = log*(dashed green curve)_{e}((1 - 1/e)t + 1/e) + 1 `pow_e`

- Power curve (base
*e*):*α = (e*(dashed orange curve)^{t}- 1) / (e - 1)

The usual trap control flags, locking, and timing (before the start of the transition, not its length) are also respected by these scripts.

This documentation is part of the KDScript module. Copyright © 2012–2014 Kevin Daughtridge. See introduction for details.