LaunchLightning
Category: Environment
/ Weather
Since engine version: 4.6.5.0 CP
(extended in 4.9.1.0 GWE)
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 iX, int iY, int iXAdvance, int iXRange, int iYAdvance, int iYRange, bool fDoGamma);
Parameters
- iX:
X position
- iY:
Y position
- iXAdvance:
Horizontal average speed of the lightning bolt
- iXRange:
Maximum deviation of iXAdvance
- iYAdvance:
Vertical average speed of the lightning bolt
- iYRange:
Maximum deviation of iYAdvance
- fDoGamma:
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.
PeterW, November 2001