Jump to content
Sign in to follow this  
Yolo Joe

Turning a unit into "dust" when killed?

Recommended Posts

How can I turn a unit in to a small smoke cloud upon death?

Edited by Chillroy

Share this post


Link to post
Share on other sites

You can run an event handler to make sure the unit is dead, delete the unit, then spawn an effect.

Share this post


Link to post
Share on other sites
_killed = (_this select 0);
_posKilled = getPos killed;
deleteVehicle _killed;
"SmallSecondary" createVehicle posKilled;

Share this post


Link to post
Share on other sites
_killed = (_this select 0);
_posKilled = getPos killed;
deleteVehicle _killed;
"SmallSecondary" createVehicle posKilled;

exactly. just add that into an event handler. So if you add this into a unit's init it should work

this addEventHandler ["killed", {
_killed = (_this select 0); 
_posKilled = getPos _killed; 
deleteVehicle _killed; 
"SmallSecondary" createVehicle _posKilled; 
}];

Share this post


Link to post
Share on other sites

No, I do not want an explosion. Simply a small dust cloud would do the trick. Where can I find a list of the effects?

Share this post


Link to post
Share on other sites
No, I do not want an explosion. Simply a small dust cloud would do the trick.

Something like this?

Share this post


Link to post
Share on other sites
Something like this?

Yes Please! Can you share the code for this?

Also, where in the cfgVehicles do I find "SmallSecondary" and the others?

Thanks

Edited by BEAKSBY

Share this post


Link to post
Share on other sites

Yes! Like that! would you mind sharing that code? ;D

Share this post


Link to post
Share on other sites

Alright gents. Here's the download link to the sample mission. 5 targets, each with different size of dust cloud on death. I hope that helps.

:)

Share this post


Link to post
Share on other sites

I'm not interested in PLAYING the scenario :P I want the CODE! :bounce3: :bounce3:

Can you put out a download link to the SQM file? So I can open it in the editor?

Share this post


Link to post
Share on other sites

You should download PBO manager or something. Extremly useful tool. I used that to extract the data necessary. They simply added this code into the units init inside the mission.sqm file

init="this addEventHandler [""killed"", {  _killed = (_this select 0);   _pos = getPos _killed;  _xpos = _pos select 0;  _ypos = _pos select 1;  _zpos = _pos select 2;         sleep 0.3;    for ""_i"" from 0 to 3 do  {        _xvel = 0;        _yvel = 0;     _zvel = 0;             _tnt = 0;          drop [[""A3\Data_F\ParticleEffects\Universal\universal.p3d"", 16, 7, 48], """", ""Billboard"", 0, 1 + random 0.5,          [_xpos, _ypos, _zpos],    [ _xvel, _yvel, _zvel ],    1,    1.2,    1.3,         0,    [1],    [     [0.55, 0.5, 0.45, 0],     [_tnt + 0.55, _tnt + 0.5,  _tnt + 0.45, 0.16],     [_tnt + 0.55, _tnt + 0.5,  _tnt + 0.45, 0.12],     [_tnt + 0.5,  _tnt + 0.45, _tnt + 0.4,  0.08],     [_tnt + 0.45, _tnt + 0.4,  _tnt + 0.35, 0.04],     [_tnt + 0.4,  _tnt + 0.35, _tnt + 0.3,  0.01]    ],       [0],    0.1,    0.1,    """",    """",    """"    ];  };  deleteVehicle _killed;  Hint ""Size 1 dust"";  }];";

Share this post


Link to post
Share on other sites
I'm not interested in PLAYING the scenario :P I want the CODE! :bounce3: :bounce3:

Put this in your init.sqf

	{_x addEventHandler
	["killed",{_this spawn {_unit = _this select 0;_pos = getPos _unit;_xpos = _pos select 0;_ypos = _pos select 1;
	_zpos = _pos select 2;sleep 0.3;for "_i" from 0 to 3 do {_xvel = 0;_yvel = 0;_zvel = 0;_tnt = 0;
	drop[["A3\Data_F\ParticleEffects\Universal\universal.p3d",16,7,48],"","Billboard",0,1 + random 0.5,[_xpos,_ypos,_zpos],	
	[_xvel,_yvel,_zvel],1,1.2,1.3,0,[2],[[0.55,0.5,0.45,0],[_tnt + 0.55,_tnt + 0.5,_tnt + 0.45,0.16],
	[_tnt + 0.55,_tnt + 0.5,_tnt + 0.45, 0.12],[_tnt + 0.5,_tnt + 0.45,_tnt + 0.4,0.08],
	[_tnt + 0.45,_tnt + 0.4,_tnt + 0.35,0.04],[_tnt + 0.4,_tnt + 0.35,_tnt + 0.3,0.01]],[0],0.1,0.1,"","",""];};
	deleteVehicle _unit};}];
} forEach allUnits;

Share this post


Link to post
Share on other sites

@Chillroy

Exactly. That's the code. Size 1 and size 2 dust respectively. And I thought you have a pbo extractor with you. :)

--

On a similar topic about ParticleEffects, here is a demo of spawn clouds and death clouds. Arcadey? Will serve purpose in my project as some sort of visual indicator.

Share this post


Link to post
Share on other sites
exactly. just add that into an event handler. So if you add this into a unit's init it should work

this addEventHandler ["killed", {
_killed = (_this select 0); 
_posKilled = getPos _killed; 
deleteVehicle _killed; 
"SmallSecondary" createVehicle _posKilled; 
}];

Where can I find other particle effects like "SmallSecondary"?

Also, does the explosion damage units near it or is just a particle effect?

BASICALLY, I want an even smaller explosion than "SmallSecondary"...

Edited by BEAKSBY

Share this post


Link to post
Share on other sites

Also, does the explosion damage units near it or is just a particle effect?

Yes it does, and thats why I can't use it. I need to be able to kill them with grenades, but they can't kill their teammates when dying.

Share this post


Link to post
Share on other sites

this addEventHandler ["killed", {
_killed = (_this select 0); 
_posKilled = getPos _killed; 
deleteVehicle _killed; 
"A3\Data_F\ParticleEffects\Universal\universal.p3d" createVehicle _posKilled; 
}];

Try this out. I do not know where the particle effect classnames are listed but they are probably within Data_F and then inside one of the config.bin's. Im honestly not that interested in diving into their config's again as I just got through redefining a piece every single default vehicle in Arma 3 because they were incorrectly defined (except a precious few). If I have time later I will post in here a list.

Just a particle effect is just that. An effect. To actually deal damage it has to be tied to some type of Ammo class (aka created by one)

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  

×