meade95 0 Posted April 13, 2011 Is there a simple script / trigger that would allow one to know how many BLUFOR KIA there have been at the end of an OP (or even before the end, that you could see how many BLUFOR KIA there have been?) Share this post Link to post Share on other sites
demonized 16 Posted April 13, 2011 in init.sqf or in a unit or object init line place: westKIAnr = 0; eastKIAnr = 0; resistanceKIAnr = 0; civilianKIAnr = 0; here is the script bit. // track KIA units // save as kia.sqf // place this in all units initline wich you want to include in the kia count: // _null = [this] execVM "kia.sqf"; _kiaUnit = _this select 0; if (!alive _unit) then { if ((side _kiaUnit) == west) then {westKIAnr = westKIAnr + 1}; if ((side _kiaUnit) == east) then {eastKIAnr = eastKIAnr + 1}; if ((side _kiaUnit) == resistance) then {resistanceKIAnr = resistanceKIAnr + 1}; if ((side _kiaUnit) == civilian) then {civilianKIAnr = civilianKIAnr + 1}; } else { _idx = _kiaUnit addEventHandler ["killed", {[_kiaUnit] execVM "kia.sqf"}] }; now you can at end or something show how many kia of any side with: hint format["west lost %1 units",westKIAnr]; or you can do: hint format["east lost %1 units",eastKIAnr]; etc... you can also include this in a debrief (you need to look into how to make a briefing/debriefing), and westKIAnr is amount of units lost for west side. Share this post Link to post Share on other sites
darkxess 37 Posted April 14, 2011 Demonized mate, im trying this and doesnt seem to work! ive put: _null = [this] execVM "kia.sqf"; in my players init box, made the init.sqf with this inside: westKIAnr = 0; eastKIAnr = 0; resistanceKIAnr = 0; civilianKIAnr = 0; And the script called "kia.sqf" is like this: // track KIA units // save as kia.sqf // place this in all units initline wich you want to include in the kia count: // _null = [this] execVM "kia.sqf"; _kiaUnit = _this select 0; if (!alive _unit) then { if ((side _kiaUnit) == west) then {westKIAnr = westKIAnr + 1}; if ((side _kiaUnit) == east) then {eastKIAnr = eastKIAnr + 1}; if ((side _kiaUnit) == resistance) then {resistanceKIAnr = resistanceKIAnr + 1}; if ((side _kiaUnit) == civilian) then {civilianKIAnr = civilianKIAnr + 1}; } else { _idx = _kiaUnit addEventHandler ["killed", {[_kiaUnit] execVM "kia.sqf"}] }; hint format["east lost %1 units",eastKIAnr]; I get the hint right away as joining the game saying about 0 kia, thats all! lol... kill a enemy unit and nothing! can you help me a little? Thanks mate. Share this post Link to post Share on other sites
demonized 16 Posted April 14, 2011 i meant to place it in any enemys init . line, (those you want counted in the kia count) ;) ---------- Post added at 18:21 ---------- Previous post was at 18:21 ---------- or you can look into killed eventhandlers, but still you need to add the eventhandler to all units you want in the count. Share this post Link to post Share on other sites
darkxess 37 Posted April 14, 2011 Ok, ive done it that way... still nothing! lol, how would I see the KIA results? "when shooting a target, it would hint saying something?" at the moment ive followed everything you said but still no result :S Share this post Link to post Share on other sites
demonized 16 Posted April 14, 2011 whenever you want to know the kia count of west units do this: hint format["west lost %1 units",westKIAnr]; same way with the other sides. for example in the end trigger if you have any, or simply put it in a radio trigger repeated on act, and then you can see how many of that side is dead. Share this post Link to post Share on other sites