Jump to content
Sign in to follow this  
chronicsilence

Creating spark effects

Recommended Posts

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

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 by austin_medic

Share this post


Link to post
Share on other sites
Guest

chronicsilence,

 

Any success doing the spark effect?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×