Comrades in Arms Discussion Board
delete dead bodies with effects - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8)
+--- Thread: delete dead bodies with effects (/showthread.php?tid=3441)



delete dead bodies with effects - RueLight - 08-22-2016

Hiho,

i'm working on a very special mission and need some special help Smile

I want a script which delete dead guys instantly (<1sec) and create a "smoke puff" at same time. It should look like "a soul is leaving the body" or something like this. It must also work in big heights and the smoke should disappear in few secs.
The script does not work for everybody, just for the units i want (check over the name or execute on every unit via Init line).

Who can help me with it?

greets
rue


RE: delete dead bodies with effects - Alwarren - 08-22-2016

Easiest way to do this would probably be to use an event handler. In the init field of the guy that should evaporate add something like

this addEventHandler ["killed", { _this spawn { sleep 0.5; deleteVehicle (_this select 0); }];

to get the body to vanish immediately. For the puff of smoke, you could add a particle system emitter and delete it as well after a few seconds. Can't write the code for that from the top of my head without experimenting in game, but the basic functionality is described here.


RE: delete dead bodies with effects - RueLight - 08-22-2016

this addEventHandler ["killed", { _this spawn { sleep 0.5; deleteVehicle (_this select 0); }];  -> not working, cant save the init line
 
I'm a bad scripter too. If i have luck i can understand the half of it. already know the link and tryed different commands, also tryed examples by other people but most of it failed...

is there a way that you can create the script?


RE: delete dead bodies with effects - Alwarren - 08-22-2016

It's missing a closing } at the end:
this addEventHandler ["killed", { _this spawn { sleep 0.5; deleteVehicle (_this select 0); }}];