fn_explosionParticles.sqf 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. Author: TheTimidShade
  3. Description:
  4. Creates dust cloud particles and rock debris for beam impact.
  5. Parameters:
  6. 0: OBJECT - The object the beam is created above.
  7. 1: ARRAY - Colour of dust/rock debris created on impact in format [r,g,b].
  8. Returns:
  9. NONE
  10. */
  11. if (!hasInterface) exitWith {}; // dedicated server & HC should not run particles
  12. params ["_impactEmitter", "_col"];
  13. // dust wave
  14. _wave = "#particlesource" createVehicleLocal getPos _impactEmitter;
  15. _wave setParticleParams [["A3\Data_F\ParticleEffects\Universal\universal.p3d", 16, 7, 48], "", "Billboard", 1, 7, [0, 0, 0],[0, 0, 0], 0, 1.5, 1, 0, [50, 100], [[_col#0, _col#1, _col#2, 0.5], [_col#0, _col#1, _col#2, 0.5], [_col#0, _col#1, _col#2, 0.3], [_col#0, _col#1, _col#2, 0]], [1,0.5], 0.1, 1, "", "", _impactEmitter];
  16. _wave setParticleRandom [2, [20, 20, 20], [5, 5, 0], 0, 0, [0, 0, 0, 0.1], 0, 0];
  17. _wave setParticleCircle [50, [-80, -80, 2.5]];
  18. _wave setDropInterval 0.001;
  19. // dust cloud
  20. _cloud = "#particlesource" createVehicleLocal getPos _impactEmitter;
  21. _cloud setParticleParams [["A3\Data_F\ParticleEffects\Universal\universal.p3d", 16, 7, 48], "", "Billboard", 1, 18, [0, 0, 0],[0, 0, 0], 0, 1.5, 1, 0, [50, 65], [[_col#0, _col#1, _col#2, 0.5], [_col#0, _col#1, _col#2, 0.5], [_col#0, _col#1, _col#2, 0.3], [_col#0, _col#1, _col#2, 0]], [1,0.5], 0.1, 1, "", "", _impactEmitter];
  22. _cloud setParticleRandom [2, [10, 10, 5], [10, 10, 5], 0, 0, [0, 0, 0, 0.1], 0, 0];
  23. _cloud setParticleCircle [50, [8, 8, 5]];
  24. _cloud setDropInterval 0.005;
  25. // dust tower
  26. _tower = "#particlesource" createVehicleLocal getPos _impactEmitter;
  27. _tower setParticleParams [["A3\Data_F\ParticleEffects\Universal\universal.p3d", 16, 7, 48], "", "Billboard", 1, 18, [0, 0, 0],[0, 0, 0], 0, 1.5, 1, 0, [40, 90], [[_col#0, _col#1, _col#2, 0.5], [_col#0, _col#1, _col#2, 0.5], [_col#0, _col#1, _col#2, 0.3], [_col#0, _col#1, _col#2, 0]], [1,0.5], 0.1, 1, "", "", _impactEmitter];
  28. _tower setParticleRandom [2, [10, 10, 5], [5, 5, 20], 0, 0, [0, 0, 0, 0.1], 0, 0];
  29. _tower setParticleCircle [20, [2, 2, 20]];
  30. _tower setDropInterval 0.01;
  31. // rocks
  32. _debris = "#particlesource" createVehicleLocal (getPosATL _impactEmitter);
  33. _debris setParticleParams [["\A3\data_f\ParticleEffects\Universal\Mud.p3d", 1, 0, 1, 1], "", "SpaceObject", 1,30,[0,0,0],[0, 0, 20], 1, 500,15,0,[2.5],[[0, 0, 0, 1]], [0.125],0, 0, "","",_impactEmitter, 0, true,0];
  34. _debris setParticleRandom [10,[25, 25, 0.1],[30, 30, 20],0.5,1,[0, 0, 0, 0],0,0,0,0];
  35. _debris setParticleCircle [0.5,[10, 10, 10]];
  36. _debris setDropInterval 0.0004;
  37. sleep 0.1;
  38. deleteVehicle _debris;
  39. sleep 0.9;
  40. {deleteVehicle _x} forEach [_wave, _cloud, _tower, _debris];