Jump to content
fess25

How do I spawn a crater \ make the ground appear burned?

Recommended Posts

Hello everyone. I am working on a Vietnam related addon, and I want to make the ground appear black and burned where the napalm had finished burning. To achieve that, I am trying to spawn an oversized sprite of the bomb crater via creation of a #particlesource. I want to spawn a sprite that has a 300 seconds of a lifetime and gradually disappears towards the end. I want the #particlesource to cease its existence after it spawned the first sprite.

 

This is the script I use to spawn a crater

 

params ["_pos"];

_emitter = "Land_HelipadEmpty_F" createVehicleLocal _pos;
_lifetime = 300;

_source = "#particlesource" createVehicleLocal _pos;
_source setParticleCircle [0, [0, 0, 0]];
_source setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0.25, [0, 0, 0, 0], 0, 0];
_source setParticleParams [
	/*Sprite*/				["\A3\data_f\Krater.p3d", 1, 0, 1, 0], "",// [File,Ntieth,Index,Count,Loop(Bool)], "?"
	/*Type*/				"SpaceObject", 
	/*TimmerPer*/			1,
	/*Lifetime*/			_lifetime, 
	/*Position*/			[0,0,0.2],  
	/*MoveVelocity*/		[0,0,0], 
	/*Simulation*/			0,1,0,0, //rotationVel,weight,volume,rubbing
	/*Scale*/				[5],
	/*Color*/				[[0.1, 0.1, 0.1, 1]],
	/*AnimSpeed*/			[1000], 
	/*randDirPeriod*/		0, 
	/*randDirIntesity*/		0,
	/*onTimerScript*/		"",
	/*DestroyScript*/		"",
	/*Follow*/				_emitter,
	/*Angle*/				0,
	/*onSurface*/ 			False,
	/*bounceOnSurface*/		-1,
	/*emissiveColor*/		[[1,1,1,1]]
];

_source setDropInterval 0.1;
sleep 0.15;
_source setDropInterval 0;
deleteVehicle _source;
deleteVehicle _emitter;

 

Unfortunately, I am having an issue where the sprite disappears after only several seconds instead of intended 300. Sometimes the sprite does not appear at all. In many cases sprites appear deformed and out of proportions:

 

https://yadi.sk/i/g7N3VMI0Af6ztg

 

I managed to successfully create a persistant sprite by

createSimpleObject ["a3\data_f\krater.p3d", getPos player]

but this way I can't change the size of the sprite, and I need to increase the size because my napalm bomb has a burning radius of 20 meters, while the size of a created SimpleObject is barely 3 meters wide.

 

Also I don't know the size of "\A3\data_f\Krater.p3d" texture and can't figure out the right Anim Divisor, I tried changing the Anim Divisor to 1, 2, 3, 4, 8, 16, but it did not help.

 

This is the resource I used https://community.bistudio.com/wiki/ParticleArray

 

So the question is, how do I spawn a static sprite of a crater and make it disappear completely after 300 seconds?

Or is there any other way to make the ground look burned?

Share this post


Link to post
Share on other sites
On 30.9.2018 at 6:11 AM, fess25 said:

deleteVehicle _source; deleteVehicle _emitter;

Why do you delete it after 0.15 seconds if you want it to stay for 300 seconds?

Also why do you set the animation speed to 1000? I don't exactly know what animSpeed does.. But 3000 sounds like you're speeding it up, but why?

Share this post


Link to post
Share on other sites
4 hours ago, Dedmen said:

Why do you delete it after 0.15 seconds if you want it to stay for 300 seconds?

Also why do you set the animation speed to 1000? I don't exactly know what animSpeed does.. But 3000 sounds like you're speeding it up, but why?

  • I delete these because I only need the emitter to produce a single particle. There is really no need in the emitter once it emitted the particle. For testing purposes, I tried not to delete it, but it didn't improve the situation at all.
  • I set the anim speed to 1000 because, I quote the text from the link I mentioned above, https://community.bistudio.com/wiki/ParticleArray :
     
    Quote

    You must also set the AnimationPhase value (described in render parameters) to a large number (such as 1000) if you only want to play a single frame


    Changing this value does not fix the disappearance of the sprite...

Share this post


Link to post
Share on other sites

All right, so here is my conclusions on this as well as the way I completed this task.

 

Spawning the crater as particle was a great idea, but it suffered from how poorly the particles are done overall in Arma 3: if the particle does not fit completely on the screen, which inevitably happens at certain camera angles, it stops being rendered. This can be observed with regular smoke, but is most crucial to huge particles like the one I needed in my case.

 

On top of that, whenever I tried to spawn it as a huge particle and it worked, the particle itself was getting blurrier and blurrier in ~3 seconds intervals, as if the detalization level was dropping by a degree each time. On the fourth or fifth step the crater was barely distinguishable and looked like a square puddle of gray goo with 2x2 texture.

 

While all this happening, if I spawned a normal crater via `createSimpleObject ["a3\data_f\krater.p3d", getPos player]`, the particle would INSTANTLY rollback to the highest quality, and then continue dilapidating the same way as before. SO, creating a simple `krater.p3d` resets the resolution of the particle that was created based on the same model back to its full quality.

 

Since the ingenious approach did not work, I decided to go stupid way. I asked my friend, who's been developing addons and working with models since OFP, to make me a 5x times bigger version of the default `krater.p3d`, which he kindly agreed to make. I then spawned it via `createSimpleObject` plus some trickery to make it work from the mission folder, and it worked like a charm.

 

P.S. Frankly expected more help from this forum... but at least this thread will be valuable for people trying to do the same thing I struggled with.

  • Like 1

Share this post


Link to post
Share on other sites
Just now, fess25 said:

Frankly expected more help from this forum...

Sometimes, on "busy" days, topics get pushed off the front page quickly. Also, sometimes seeing that a "known" member like Dedmen has replied can put others off of replying - "he's got this." I can't say either was the case here, but make no mistake, this is a very helpful community.

 

Quote

but at least this thread will be valuable for people trying to do the same thing I struggled with.

And that's one of the reasons why!

  • Thanks 1

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

×