Jump to content
aetherthedragon

Amplifying thunder and lightning help.

Recommended Posts

So the idea of my little mission today is its sandbox, in an apocalyptic world, and quite heavily based on the wonderful game S.T.A.L.K.E.R. In STALKER there are events named "Emissions" where thunderous storms rock the land and cause damage to all of those outside in the open to experience it.

 

(

is an example)

 

Now what I'd like to do is attempt to recreate the sound and aesthetics of the storm, I've managed to abruptly cause the storm with triggers by using setOvercast, setRain and setLightnings command, but I find that I'd love to have two or even three times as much lightning as there is occurring now even the maximum setting. I think seeing the night sky light up every 10 seconds and the sound of thunder rolling through the land would be pretty immersive.

 

I haven't found any scripts or any leads on how one might be able to have a whole lot of thunder and lightning, so any tips would be greatly appreciated.

 

I'm creating these storms from timed triggers although I'm guessing we're going to have to work this into a full script.

 

Thanks for your help.

Share this post


Link to post
Share on other sites

So the idea of my little mission today is its sandbox, in an apocalyptic world, and quite heavily based on the wonderful game S.T.A.L.K.E.R. In STALKER there are events named "Emissions" where thunderous storms rock the land and cause damage to all of those outside in the open to experience it.

 

(

is an example)

 

Now what I'd like to do is attempt to recreate the sound and aesthetics of the storm, I've managed to abruptly cause the storm with triggers by using setOvercast, setRain and setLightnings command, but I find that I'd love to have two or even three times as much lightning as there is occurring now even the maximum setting. I think seeing the night sky light up every 10 seconds and the sound of thunder rolling through the land would be pretty immersive.

 

I haven't found any scripts or any leads on how one might be able to have a whole lot of thunder and lightning, so any tips would be greatly appreciated.

 

I'm creating these storms from timed triggers although I'm guessing we're going to have to work this into a full script.

 

Thanks for your help.

 

This might be a starting point for you, I used part (edited other parts) of the BIS function to create lightning and then just added a loop essentially:

h = [] spawn {
	private _fncLightning = {
		params [
			["_centre", position player, [[]]],
			["_radius", 300, [0]],
			["_dir", random 360, [0]]
		];
		private _pos = _centre getPos [_radius, _dir];
		private _bolt = createVehicle ["LightningBolt", _pos, [], 0, "can collide"];
		_bolt setPosATL _pos;
		_bolt setDamage 1;

		private _light = "#lightpoint" createVehiclelocal _pos;
		_light setPosATL (_pos vectorAdd [0,0,10]);
		_light setLightDayLight true;
		_light setLightBrightness 300;
		_light setLightAmbient [0.05, 0.05, 0.1];
		_light setlightcolor [1, 1, 2];

		sleep 0.1;
		_light setLightBrightness 0;
		sleep (random 0.1);

		private _lightning = (selectRandom ["lightning1_F","lightning2_F"]) createVehiclelocal [100,100,100];
		_lightning setdir _dir;
		_lightning setpos _pos;

		for "_i" from 0 to (3 + random 1) do {
			private _time = time + 0.1;
			_light setLightBrightness (100 + random 100);
			waituntil {
				time > _time
			};
		};

		deletevehicle _lightning;
		deletevehicle _light;
	};
	
	while {true} do {
		_intensity = 2 + floor (random 3);
		for "_i" from 0 to (_intensity -1) do {
			[position player, linearConversion [0, 1, random 1, 300, 800]] call _fncLightning;
		};
		sleep 2 + (random 2);
	};
};

Put that in the debug console, I can add comments if you want me to.

Share this post


Link to post
Share on other sites

This might be a starting point for you, I used part (edited other parts) of the BIS function to create lightning and then just added a loop essentially:

h = [] spawn {
	private _fncLightning = {
		params [
			["_centre", position player, [[]]],
			["_radius", 300, [0]],
			["_dir", random 360, [0]]
		];
		private _pos = _centre getPos [_radius, _dir];
		private _bolt = createVehicle ["LightningBolt", _pos, [], 0, "can collide"];
		_bolt setPosATL _pos;
		_bolt setDamage 1;

		private _light = "#lightpoint" createVehiclelocal _pos;
		_light setPosATL (_pos vectorAdd [0,0,10]);
		_light setLightDayLight true;
		_light setLightBrightness 300;
		_light setLightAmbient [0.05, 0.05, 0.1];
		_light setlightcolor [1, 1, 2];

		sleep 0.1;
		_light setLightBrightness 0;
		sleep (random 0.1);

		private _lightning = (selectRandom ["lightning1_F","lightning2_F"]) createVehiclelocal [100,100,100];
		_lightning setdir _dir;
		_lightning setpos _pos;

		for "_i" from 0 to (3 + random 1) do {
			private _time = time + 0.1;
			_light setLightBrightness (100 + random 100);
			waituntil {
				time > _time
			};
		};

		deletevehicle _lightning;
		deletevehicle _light;
	};
	
	while {true} do {
		_intensity = 2 + floor (random 3);
		for "_i" from 0 to (_intensity -1) do {
			[position player, linearConversion [0, 1, random 1, 300, 800]] call _fncLightning;
		};
		sleep 2 + (random 2);
	};
};

Put that in the debug console, I can add comments if you want me to.

 

I appreciate this Hally, it has worked absolutely beautifully and I've chucked it into an SQF so I can trigger it when these "storms" commence, its beautiful and really adds that immersion, although we'd need to be able to stop it after about 60 seconds, I tried to use the for _i" from 1 To 4 do { to limit the number of loops it will commit, but of course I have no idea what I'm doing and it appears to have had no effect on it at all haha. I appreciate your help thus far.

Share this post


Link to post
Share on other sites

Paste this over the while loop at the end and it should end after 1 min

 

    _timeOut = time + 60;
    while {time < _timeOut} do {
        _intensity = 2 + round (random 3);
        for "_i" from 1 to _intensity do {
            [position player, (random 500) + 300] call _fncLightning;
        };
        sleep 2 + (random 2);
    };
  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×