Arkon2 0 Posted June 26, 2007 Hi, I need to count all the dead bodies in a trigger but to include the bodies from all the sides (West/East/Ind/Civs). I want them all to be placed into one array for further reference in a script... if possible. To much of a head banger for me, any offers? Thanks Share this post Link to post Share on other sites
mrtbk 0 Posted June 26, 2007 if you create a script file with this code <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dead = _this select 1; _overall_dead = overall_dead + _dead; well it something like this i beleive then for you trigger set it for anybody present condition: true; act: {_x addeventhandler ["killed", {[_this select 0, _this select 1] exec "yourscript.sqs"}]} foreach thislist; i think this should work basically i think you need to count them as they are killed Share this post Link to post Share on other sites
Arkon2 0 Posted June 27, 2007 Hi mrtbk, Thanks for your help.... Ok, getting an error with this line: _overall_dead = overall_dead + _dead; Type any, expected Number, Array, String I see you are using:_this select 0, _this select 1 in the eventhandler statement but just _this select 1 in the script: Anyways, it looks as though this is along the right lines... Arkon Share this post Link to post Share on other sites
quiet_man 8 Posted June 27, 2007 Hi mrtbk,Thanks for your help.... Ok, getting an error with this line: _overall_dead = overall_dead + _dead; Type any, expected Number, Array, String I see you are using:_this select 0, _this select 1 in the eventhandler statement but just _this select 1 in the script: Anyways, it looks as though this is along the right lines... Arkon _overall_dead = overall_dead + [_dead]; have you initialized _overall_dead? QuietMan Share this post Link to post Share on other sites
mrtbk 0 Posted June 27, 2007 Sorry the line is meant to be _overall_dead = _overall_dead + _dead; i missed a _ out hope this fixes it Share this post Link to post Share on other sites
Arkon2 0 Posted June 27, 2007 Hi, Thanks mrtbk, That killed the error! I have stuck _overall_dead in the ini file but not sure how or what to set it to. At the moment hint format shows_overall_dead as "array". _dead does show the last person who died (had to change "_dead = _this select 1" to "_dead = _this select 0") An explanation: The reason I need all these dead dudes in an array is so that one person can go around burying em one at a time. I knows this is rather sad but its what i need Thanks Arkon Share this post Link to post Share on other sites
Ubi 0 Posted June 27, 2007 Interesting! Is it possible to count the dead and have the totals appear as text as people are killed? I want to count the civilians killed in an mp mission and send the ever increasing body count to the players. Any suggestions?? Share this post Link to post Share on other sites
mrtbk 0 Posted June 27, 2007 yes it should be possible same basic code but you need a if statement will look something like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _dead = _this select 1; ?(side _dead==civilian): _civilian_dead = _civilian_dead + 1; this code is not guaranteed to be right this will only be a counter you will also need some code to give a radio message saying civilians death count: _civilian_dead sry i cannot give you the code for the radio message Share this post Link to post Share on other sites