Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.14 KB | None | 0 0
  1. fpx_fnc_sandStorm = {
  2.     _eff = ppEffectCreate ["colorCorrections", 1501];
  3.     _eff ppEffectEnable true;
  4.     _eff ppEffectAdjust [1,1.02,-0.005,[0,0,0,0],[1,0.8,0.6,0.65],[0.199,0.587,0.115,0]];
  5.     _eff ppEffectCommit 10;
  6.  
  7.     fpx_sandEmitter = "Land_Bucket_F" createVehicleLocal (position player);
  8.     fpx_sandEmitter attachTo [vehicle player,[0,0,0]];
  9.     fpx_sandEmitter hideObject true;
  10.     fpx_sandEmitter allowDamage false;
  11.     fpx_sandEmitter enableSimulation false;
  12.  
  13.     _parent = "#particlesource" createVehicleLocal (getPosASL player);
  14.     _parent attachTo [fpx_sandEmitter,[0,0,0]];
  15.  
  16.     // create the children emitters that will follow the parent emitter
  17.     _objN = "#particlesource" createVehicleLocal (getPosASL player);
  18.     _objS = "#particlesource" createVehicleLocal (getPosASL player);
  19.     _objE = "#particlesource" createVehicleLocal (getPosASL player);
  20.     _objW = "#particlesource" createVehicleLocal (getPosASL player);
  21.  
  22.     ["vehicle", {
  23.         detach fpx_sandEmitter;
  24.         fpx_sandEmitter attachTo [vehicle player, [0,0,0]];
  25.     }] call CBA_fnc_addPlayerEventHandler;
  26.  
  27.  
  28.     _parms = [
  29.         ["\A3\data_f\ParticleEffects\Universal\Universal", 16,12,13,0],
  30.         "",
  31.         "Billboard",
  32.         1,                  //Time Period
  33.         30,                 //LifeTime
  34.         [0,0,0],            //Position
  35.         wind,               //Velocity
  36.         0,                  //rotationVel
  37.         10,                 //Weight
  38.         7.84,               //Volume - higher number causes more float (in relation to weight)
  39.         0.0001,             //Rubbing
  40.         [5,15,10,15,20],    //Scale
  41.         [[.6,.5,.4,0.0],[.6,.5,.4,.04],[.6,.5,.4,.02],[.6,.5,.4,.03],[.6,.5,.4,.02],[.6,.5,.4,.01],[.6,.5,.4,.01],[.6,.5,.4,.01]], //Color
  42.         [1000],             //AnimSpeed
  43.         0,                  //randDirPeriod
  44.         0.0,                //randDirIntesity
  45.         "",
  46.         "",
  47.         _parent
  48.     ];
  49.     // define a master random array for the EFX
  50.     _params_rand = [0,                  // random time period
  51.         [0,0,-0.8],         // [+right, +forward, +upward] random position based on position emitter is attached to
  52.         [0,0,0],            // random velocity value
  53.         0,                  // random rotation value
  54.         0.215,              // random scale value (ie. .25 or 25% of the declared value in param array)
  55.         [0.02,0,0.02,0.106],    // randomized color
  56.         0,                  // random direction period value
  57.         0                   // random direction period intensity value
  58.     ];
  59.  
  60.     // for each child emitter, set class/circle and attach
  61.     {
  62.         _x setParticleClass "HousePartDust";
  63.         _x setParticleCircle [0.0,[0,0,0]];
  64.         _x attachTo [_parent,[0,0,0]];
  65.     } forEach [_objN,_objS,_objE,_objW];
  66.  
  67.     // master arrays are modified for each childs specific parameters, then applied to the child
  68.     _parms set [5,[0,100,0]];
  69.     _params_rand set [1,[70,0,-0.8]];
  70.     _objN setParticleParams _parms;
  71.     _objN setParticleRandom _params_rand;
  72.  
  73.     _parms set [4,20]; // lifetime
  74.     _parms set [5,[0,-40,0]];
  75.     _params_rand set [1,[70,0,-0.8]];
  76.     _objS setParticleParams _parms;
  77.     _objS setParticleRandom _params_rand;
  78.  
  79.     _parms set [5,[70,30,0]];
  80.     _params_rand set [1,[0,70,-0.8]];
  81.     _objE setParticleParams _parms;
  82.     _objE setParticleRandom _params_rand;
  83.  
  84.     _parms set [5,[-70,30,0]];
  85.     _params_rand set [1,[0,70,-0.8]];
  86.     _objW setParticleParams _parms;
  87.     _objW setParticleRandom _params_rand;
  88.  
  89.     {
  90.         _x setDropInterval 0.01;
  91.     } forEach [_objN,_objS,_objE,_objW];
  92. };
  93.  
  94.  
  95.  
  96.  
  97. // test MKY sand EFX v003
  98.  
  99. // examples
  100.  
  101. /*
  102.     1 - create global array
  103.     2 - initialize the script
  104.  
  105.     MKY_arSandEFX = [];
  106.     nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
  107.  
  108.     RESULT - effect runs with default parameters (random strength)
  109. */
  110.  
  111. /*
  112.     1. create global array and populate with some options
  113.     2 - initialize the script
  114.  
  115.     MKY_arSandEFX = [0,"",true,false,true,true,true,1];
  116.     nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
  117.  
  118.     RESULT - effect runs with user defined parameters
  119. */
  120.  
  121. /*
  122.     1 - create a mechanism that, through code, sets global array values
  123.     2 - initialize the script
  124.  
  125.     if ((some value) != 4) then {
  126.         MKY_arSandEFX = [0,"",true,false,true,true,true,1];
  127.         nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
  128.     };
  129.  
  130. */
  131.  
  132. /*
  133.     1 - create a mechanism that, through code, sets array values using mission parameters
  134.     2 - initialize the script
  135.  
  136.     if ((paramsArray select 0) != 4) then {
  137.         MKY_arSandEFX = [0,"",true,false,true,true,true,(paramsArray select 0)];
  138.         nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
  139.     };
  140.  
  141.     Or, if the mission maker wants something else, it might look like this:
  142.  
  143.     if ((paramsArray select 0) != 4) then {
  144.         MKY_arSandEFX = []; // set as default
  145.         switch (paramsArray select 0) do {
  146.             case 0: {MKY_arSandEFX = [0,.8,true,true];};
  147.             case 1: {MKY_arSandEFX = [0,"",true,false,true,true,true,1];};
  148.             case 2: {MKY_arSandEFX = [0,.3,true,false,true,true,false,2];};
  149.             case 3: {MKY_arSandEFX = [[0.23,0.021,100],"",true,false,true,true,true,3];};
  150.         };
  151.         nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
  152.     };
  153. */
  154.  
  155. // the example below will work in single player and will create a "light" effect.
  156. // if the mission is loaded as multiplayer coop, the option would be available at mission start.
  157. // whatever value was chosen would be used.
  158.  
  159.     // define the global sand parameter array
  160.     //[fog,overcast,use ppEfx,allow rain,force wind,vary fog,use wind audio,EFX strength]
  161. //  MKY_arSandEFX = [0,"",true,false,true,true,true,3];
  162.     // init the EFX scripts
  163. //  nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
  164.  
  165. //sleep 0.5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement