LaunchLightning

Category: Environment / Weather
Since engine version: 1.0 OC

Description

Creates a bolt of lightning. This will then move from the starting position (iX, iY) at the specified speed and the specified deviation (iXRange, iYRange). Setting the deviation values to 0 would create a straight, linear bolt.
Coordinates are global, even in local calls.

Syntax

bool LaunchLightning(int x, int y, int xspeed, int xrange, int yspeed, int yrange, bool do_gamma);

Parameters

x:
X position
y:
Y position
xspeed:
Horizontal average speed of the lightning bolt.
xrange:
Maximum deviation of xspeed.
yspeed:
Vertical average speed of the lightning bolt.
yrange:
Maximum deviation of yspeed.
do_gamma:
If true, the lightning will cause a screen flash for all players.

Examples

LaunchLightning(Random(LandscapeWidth()), 0, -20, 41, +5, 15);
This call creates normal weather lightning.
LaunchLightning(100, 100, +5, 15, -10, 21);
This will create a bolt such as the one in the magic lightning spell, directed to the right.
See also: LaunchEarthquake, LaunchVolcano
PeterW, 2001-11