Arma 3
Call of Duty 4 - Modern Warfare [RU]
This topic has been locked
Leopard20 3 Nov, 2019 @ 3:35pm
Creating an explosion
So to create an explosion, you can use something like this:
[getpos player, 1, 0] spawn { params ["_pos", "_size1", "_size2"]; _posASL = AGLToASL _pos; playSound3D [ "A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_01.wss", player, false, _posASL, 5, 1, 0]; _emitters = []; _duration = _size1/2 max 1; _source1 = createVehicle [ "#particlesource", _pos, [], 0, "CAN_COLLIDE" ]; _source1 setParticleClass "GrenadeExp"; _source1 setParticleParams [ [ "\A3\data_f\ParticleEffects\Universal\Universal", 16, 0, 32, 0 ], "", "Billboard", 0.3, 0.3*_duration, [ 0,0,0 ], [ 0,1,0 ], 0, 10, 7.9*_size1, 0.1, [ (0.0125 * 0.3 + 4)*_size1, (0.0125 * 0.3 + 1)*_size1 ], [ [1,1,1,-6],[1,1,1,0] ], [ 1 ], 0.2, 0.2, "", "", _this, 0, true, 0.6, [ [ 30,30,30,0 ],[ 0,0,0,0 ] ] ]; _source1 setParticleRandom [ 0, [ 0.4,0.1,0.4 ], [ 0.2,0.5,0.2 ], 90, 0.5, [ 0,0,0,0 ], 0, 0, 1, 0.0 ]; _source1 setParticleCircle [ 0, [ 0,0,0 ] ]; //_source1 setParticleFire [1,15,0.1]; _emitters pushBack [ _source1, 0.3 ]; if (_size2 != 0) then { _source2 = createVehicle [ "#particlesource", _pos, [], 0, "CAN_COLLIDE" ]; _source2 setParticleClass "GrenadeSmoke1"; _source2 setParticleParams [ [ "\A3\data_f\ParticleEffects\Universal\Universal", 16, 9, 1, 0 ], "", "Billboard", 1, 8, [ 0,0,0 ], [ 0,1.5,0 ], 0, 0.0522, 0.04*_size1, 0.24, [ (0.013 * 8 + 3)*_size1, (0.0125 * 8 + 6)*_size1, (0.013 * 8 + 8)*_size1, (0.013 * 8 + 10)*_size1 ], [ [0.7,0.7,0.7,0.36],[0.8,0.8,0.8,0.24],[0.85,0.85,0.85,0.14],[0.9,0.9,0.9,0.08],[0.9,0.9,0.9,0.04],[1,1,1,0.01] ], [ 1000 ], 0.2, 0.2, "", "", _this, 0, true, 0.6, [ [ 30,30,30,0 ],[ 0,0,0,0 ] ] ]; _source2 setParticleRandom [ 2, [ 0.8,0.2,0.8 ], [ 2.5,3.5,2.5 ], 3, 0.4, [ 0,0,0,0 ], 0.5, 0.02, 1, 0.0 ]; _source2 setParticleCircle [ 0, [ 0,0,0 ] ]; _source2 setDropInterval ( 0.08 ); _emitters pushBack [ _source2, 5 ]; }; _light = createVehicle [ "#lightPoint", _pos, [], 0, "CAN_COLLIDE" ]; _light setLightAmbient [ 0,0,0 ]; _light setLightBrightness 10; _light setLightColor [ 1,0.6,0.4 ]; _light setLightIntensity 10000; _light setLightAttenuation [ 0, 0, 0, 2.2, 500, 1000 ]; _emitters pushBack [ _light, 0.3 ]; _time = diag_tickTime; while{ count _emitters > 0 } do { { _x params[ "_source", "_length" ]; if ( diag_tickTime > _time + _length ) then { deleteVehicle _source; _emitters set[ _forEachIndex, objNull ]; }; }forEach _emitters; _emitters = _emitters - [ objNull ]; }; };

Alter the size to get a bigger explosion!

Of course, this only uses a grenade explosion effect so you should replace it by a better one. You can ask on the forum about this.
Last edited by Leopard20; 3 Nov, 2019 @ 3:40pm
< >
Showing 1-1 of 1 comments
< >
Showing 1-1 of 1 comments
Per page: 1530 50