Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fpx_fnc_sandStorm = {
- _eff = ppEffectCreate ["colorCorrections", 1501];
- _eff ppEffectEnable true;
- _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]];
- _eff ppEffectCommit 10;
- fpx_sandEmitter = "Land_Bucket_F" createVehicleLocal (position player);
- fpx_sandEmitter attachTo [vehicle player,[0,0,0]];
- fpx_sandEmitter hideObject true;
- fpx_sandEmitter allowDamage false;
- fpx_sandEmitter enableSimulation false;
- _parent = "#particlesource" createVehicleLocal (getPosASL player);
- _parent attachTo [fpx_sandEmitter,[0,0,0]];
- // create the children emitters that will follow the parent emitter
- _objN = "#particlesource" createVehicleLocal (getPosASL player);
- _objS = "#particlesource" createVehicleLocal (getPosASL player);
- _objE = "#particlesource" createVehicleLocal (getPosASL player);
- _objW = "#particlesource" createVehicleLocal (getPosASL player);
- ["vehicle", {
- detach fpx_sandEmitter;
- fpx_sandEmitter attachTo [vehicle player, [0,0,0]];
- }] call CBA_fnc_addPlayerEventHandler;
- _parms = [
- ["\A3\data_f\ParticleEffects\Universal\Universal", 16,12,13,0],
- "",
- "Billboard",
- 1, //Time Period
- 30, //LifeTime
- [0,0,0], //Position
- wind, //Velocity
- 0, //rotationVel
- 10, //Weight
- 7.84, //Volume - higher number causes more float (in relation to weight)
- 0.0001, //Rubbing
- [5,15,10,15,20], //Scale
- [[.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
- [1000], //AnimSpeed
- 0, //randDirPeriod
- 0.0, //randDirIntesity
- "",
- "",
- _parent
- ];
- // define a master random array for the EFX
- _params_rand = [0, // random time period
- [0,0,-0.8], // [+right, +forward, +upward] random position based on position emitter is attached to
- [0,0,0], // random velocity value
- 0, // random rotation value
- 0.215, // random scale value (ie. .25 or 25% of the declared value in param array)
- [0.02,0,0.02,0.106], // randomized color
- 0, // random direction period value
- 0 // random direction period intensity value
- ];
- // for each child emitter, set class/circle and attach
- {
- _x setParticleClass "HousePartDust";
- _x setParticleCircle [0.0,[0,0,0]];
- _x attachTo [_parent,[0,0,0]];
- } forEach [_objN,_objS,_objE,_objW];
- // master arrays are modified for each childs specific parameters, then applied to the child
- _parms set [5,[0,100,0]];
- _params_rand set [1,[70,0,-0.8]];
- _objN setParticleParams _parms;
- _objN setParticleRandom _params_rand;
- _parms set [4,20]; // lifetime
- _parms set [5,[0,-40,0]];
- _params_rand set [1,[70,0,-0.8]];
- _objS setParticleParams _parms;
- _objS setParticleRandom _params_rand;
- _parms set [5,[70,30,0]];
- _params_rand set [1,[0,70,-0.8]];
- _objE setParticleParams _parms;
- _objE setParticleRandom _params_rand;
- _parms set [5,[-70,30,0]];
- _params_rand set [1,[0,70,-0.8]];
- _objW setParticleParams _parms;
- _objW setParticleRandom _params_rand;
- {
- _x setDropInterval 0.01;
- } forEach [_objN,_objS,_objE,_objW];
- };
- // test MKY sand EFX v003
- // examples
- /*
- 1 - create global array
- 2 - initialize the script
- MKY_arSandEFX = [];
- nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
- RESULT - effect runs with default parameters (random strength)
- */
- /*
- 1. create global array and populate with some options
- 2 - initialize the script
- MKY_arSandEFX = [0,"",true,false,true,true,true,1];
- nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
- RESULT - effect runs with user defined parameters
- */
- /*
- 1 - create a mechanism that, through code, sets global array values
- 2 - initialize the script
- if ((some value) != 4) then {
- MKY_arSandEFX = [0,"",true,false,true,true,true,1];
- nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
- };
- */
- /*
- 1 - create a mechanism that, through code, sets array values using mission parameters
- 2 - initialize the script
- if ((paramsArray select 0) != 4) then {
- MKY_arSandEFX = [0,"",true,false,true,true,true,(paramsArray select 0)];
- nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
- };
- Or, if the mission maker wants something else, it might look like this:
- if ((paramsArray select 0) != 4) then {
- MKY_arSandEFX = []; // set as default
- switch (paramsArray select 0) do {
- case 0: {MKY_arSandEFX = [0,.8,true,true];};
- case 1: {MKY_arSandEFX = [0,"",true,false,true,true,true,1];};
- case 2: {MKY_arSandEFX = [0,.3,true,false,true,true,false,2];};
- case 3: {MKY_arSandEFX = [[0.23,0.021,100],"",true,false,true,true,true,3];};
- };
- nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
- };
- */
- // the example below will work in single player and will create a "light" effect.
- // if the mission is loaded as multiplayer coop, the option would be available at mission start.
- // whatever value was chosen would be used.
- // define the global sand parameter array
- //[fog,overcast,use ppEfx,allow rain,force wind,vary fog,use wind audio,EFX strength]
- // MKY_arSandEFX = [0,"",true,false,true,true,true,3];
- // init the EFX scripts
- // nul = [] execVM "MKY\MKY_Sand_Snow_Init.sqf";
- //sleep 0.5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement