OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Odyseus on 24 Jul 2012, 19:40:13

Title: Script check for dead bodies and crows flying over it
Post by: Odyseus on 24 Jul 2012, 19:40:13
Hello guys! My name is Odyseus and I m new to this forum and scripting. Therefore i was hopping with yyall help. I need a script that will check for any dead bodies, then it will count a specific time, if body still there then it will set crows over it.  Any ideas? is it even possible?
Title: Re: Script check for dead bodies and crows flying over it
Post by: Wolfrug on 05 Aug 2012, 10:53:22
Heya!

This is probably possible using BIS_fnc_crows (http://community.bistudio.com/wiki/BIS_fnc_crows), albeit slightly convoluted. Hmm. This is how I'd suggest you do it:

First, add the Functions Module to your mission (F7-Modules). The crows function needs the Functions module to work.

After that, add an eventhandler to any unit you want to spawn crows around upon death (in their init fields f.e:)

Code: [Select]
this addeventhandler ["killed", {sleep 120; _n=[(_this select 0),20,8,20] call bis_fnc_crows;}];
This will spawn 8 crows 20 meters around and 20 meters in the air around the dead person 120 seconds after they've died. I think. Untested, but it ought to work. Give it a try!

Wolfrug out.

Title: Re: Script check for dead bodies and crows flying over it
Post by: h- on 06 Aug 2012, 15:49:57
Aand just in to point out that we have gathered some of the useful BIS functions in our ED too (http://www.ofpec.com/COMREF/index.php?action=read&id=231), including the mentioned BIS_fnc_crows (http://www.ofpec.com/COMREF/index.php?action=read&id=231#crows).  :angel: