chronicsilence 13 Posted November 22, 2014 Hey folks, I'm working on a little script where I would like to create spark effects on a vehicle. I'm trying to simulate the vehicle being hit by an EMP (disabling the engine and all electronics). I've been looking into particle effects, but they're rather daunting for someone who hasn't done them before. I found this little example for creating a fire effect: _source01 = "#particlesource" createVehicleLocal (position _x); _source01 setParticleClass "ObjectDestructionFire1Smallx"; _source01 attachto [_x,[0,0,0]]; But I can't really figure out how to make it sparks instead of fire, and there doesn't really seem to be a list of pre-defined effects anywhere to choose from. The other thing is I need to make sure that the effect doesn't damage the vehicle (that fire one blew it up after a couple seconds). Thanks! Share this post Link to post Share on other sites
austin_medic 109 Posted November 22, 2014 (edited) Well I'm scratching my head at the moment. I've been sitting here trying to figure out how the hell these particle effects that are located inside data_f function at all. Using a particle editor it seems they all use the universal particle, but somehow they magically change it from a little plume of smoke to something else. Somebody else care to explain? EDIT: Found a config entry on "sparks", going to sit around and play with it and see if I can convert it into a usable particle effect in a script class FireSparksSmall3: Default { interval = 0.00025; circleRadius = 0; circleVelocity[] = {0,0,0}; particleShape = "\A3\data_f\ParticleEffects\Universal\Universal"; particleFSNtieth = 16; particleFSIndex = 13; particleFSFrameCount = 2; particleFSLoop = 0; angleVar = 360; animationName = ""; particleType = "Billboard"; timerPeriod = 1; lifeTime = 0.15; moveVelocity[] = {"30 * explosionDirX","3","30 * explosionDirZ"}; rotationVelocity = 1; weight = 1.275; volume = 1; rubbing = 0.08; size[] = {0.2,0.2,0.2,0.2,0.2,0.12,0.12,0.12,0.12,0}; color[] = { { 1,0.6,0.6,-10 }, { 1,0.6,0.6,-8 }, { 1,0.6,0.6,-6 }, { 1,0.6,0.6,-4.5 }}; animationSpeed[] = {1000}; randomDirectionPeriod = 0.6; randomDirectionIntensity = 0; onTimerScript = ""; beforeDestroyScript = ""; blockAIVisibility = 0; lifeTimeVar = 0.4; positionVar[] = {0,0,0}; MoveVelocityVar[] = {8,8,8}; rotationVelocityVar = 2; sizeVar = 0.04; colorVar[] = {0,0.15,0.15,0}; randomDirectionPeriodVar = 0; randomDirectionIntensityVar = 0; }; EDIT EDIT: After playing around with shape values it would seem thats how the particle emitters "bend" the universal plume of smoke into different shapes to appear like its a spark EDIT EDIT EDIT: Here is all I could get from it, it does the sparks like it should, but it only changes them into sparks after a few seconds, which is weird. To alleviate that I sunk it into the ground about 15 meters so all that comes out of the ground is the sparks and not little red puffs of smoke. They also don't emit any light, and appear to be bluish at night. XXXOBJECTXXX = "#particlesource" createVehicle (getpos player); XXXPARTICLEEFFECTSOURCEXXX setParticleRandom [0, [0, 0, 0], [1, 1, 0], 0, 0, [0, 0, 0, 0], 0, 0]; XXXPARTICLEEFFECTSOURCEXXX setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d", 16, 13, 2], "", "Billboard", 1, 10, [0, 0, -15], [0, 0, 3.5], 1, 1.275, 1, 0.08, [0.2, 0.2, 0.2, 0.2, 0.2, 0.12, 0.12], [[1, 0.6, 0.6, -10], [1, 0.6, 0.6, -10], [1, 0.6, 0.6, -10]], [0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08], 0.6, 0, "", "", XXXOBJECTXXX]; XXXPARTICLEEFFECTSOURCEXXX setDropInterval 0.025; Alright, after sitting around on the wiki for particle effects scratching my head at the nerdy terminololgy used, finally figured out how the universal particle effect works. Theres a picture below thats from the wiki, and the shape name 0 and shape name 1 parameters are used with it. The shape names are used to set different textures for the particle to use instead of its standard smoke puff. Using a number in shape name 0 from 1 to 16 sets up what texture we want to use, and using the numbers from column 0 to 15 sets up what frame of animation our texture is going to use. so inside the particleParams command, you see this: ["\A3\data_f\ParticleEffects\Universal\Universal.p3d", 16, 13, 1] the bolded part is the shape name numbers you need to change to achieve a different effect. https://community.bistudio.com/wikidata/images/f/f8/a3_universal_ca.jpg (341 kB) Edited November 22, 2014 by austin_medic Share this post Link to post Share on other sites
Guest Posted April 24, 2017 chronicsilence, Any success doing the spark effect? Share this post Link to post Share on other sites
Ganvai84 5 Posted October 28 In case anybody is still looking for this. This is a Sparks Effect where Sparks are falling of from a Powerline Pole. lightning_1 = [pole_1] spawn { _v = _this select 0; _sparkleSounds = ["Sound_SparklesWreck1","Sound_SparklesWreck2"]; while {!(isNull _v)} do { //creating the sparks effect emitter private _sparks = "#particlesource" createVehicleLocal getPos _v; // Setting this for a little glistering effect at the effects position (similar to flares in lights) _sparks setParticleClass "AvionicsSparks"; // Setting the parameters. Look in Wiki for detailed values _sparks setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal",16,0,6,1], "", "billboard", 1, 1.5, [0, 0, 9], // relative position -> Last Number gives the height where the effect should spawn [3, 3, -2], // distribution speed of the effect -> determines direction sparks fly. Minus Value on the last position makes them go down instead up 8, 6, 0.001, 0.1, [0.05, 0.01], [[1, 1, 1 ,1],[1, 1, 1 ,1],[1, 1, 1 ,1]], [0.5], 5, 5, "", "", _sparks, 0, true, //Sparks bounce on the ground 0.3, // Chance that sparks bounce of [[99999,99999,99999,99999],[99999,99999,99999,99999],[99999,99999,99999,99999]], //should add glow effect, didn't see it so no idea [20,30,10] ]; //Sets randomisation of Sparks _sparks setParticleRandom [0.6, [0.3, 0.3, 0], [0.7, 0.7, 0.7], 1, 0, [0, 0, 0, 0], 0, 1]; // Plays sound at the effects position _sparksSound1 = createSoundSource [selectRandom _sparkleSounds, getPos _v, [], 0]; // If you want a continuous FX, delete all following lines and write your own SFX management // Sleep to match VFX and SFX sleep 1.4; deleteVehicle _sparks; sleep 0.1; deleteVehicle _sparksSound1; // Random break so its not continuously throwing sparks sleep (1 + random 5); }; }; If you want this to work in multiplayer, throw this into a script.sqf and remoteExec this on every client. It's my first try on using particle effects so if anybody can improve on this, I would be very happy. Greetings, Jan Share this post Link to post Share on other sites