Jump to content
Sign in to follow this  
mr_centipede

Custom Debriefing Page

Recommended Posts

?imw=5000&imh=5000&ima=fit&impolicy=Lett

 

Hello all.

 

Once upon a time I requested a debriefing page where you can see how many friendlies was killed (not just in your group), and how many enemy was killed (not just killed by you, the player), and someone said you can already scripted in. But all these years I haven't seen anyone that does this, or there was no interest in such info.

 

Anyway this is what I came up with. Maybe some people will find it useful, and here is my small contribution to the community.

 

First the description.ext

Spoiler

 


class CfgDebriefingSections
{
	class Casualty
	{
		title = "Casualties";
		variable = "Casualty";
	};
};

 

Then, init.sqf 

Spoiler

/*------VARIABLES FOR CUSTOM DEBRIEFING/STATISTIC SCREEN---------------------------------------------------------------*/
missionNamespace setVariable ["Casualty", ""];

missionNamespace setVariable ["WestCasualty", 0];
missionNamespace setVariable ["WestTrackedCasualty", 0];
missionNamespace setVariable ["WestCarCasualty", 0];

missionNamespace setVariable ["EastCasualty", 0];
missionNamespace setVariable ["EastTrackedCasualty", 0];
missionNamespace setVariable ["EastCarCasualty", 0];

missionNamespace setVariable ["CivCasualty", 0];
missionNamespace setVariable ["CivTrackedCasualty", 0];
missionNamespace setVariable ["CivCarCasualty", 0];

{_x addEventHandler ["killed", {_this execVM "unitKilled.sqf"}]} forEach allUnits;
{_x addEventHandler ["killed", {_this execVM "unitKilled.sqf"}]} forEach vehicles;

 

 

next is unitKilled.sqf the EH script

Spoiler

_unitKilled = _this select 0;
_killer = _this select 1;

_westCasualty = missionNamespace getVariable "WestCasualty";
_westTrackedCasualty = missionNamespace getVariable "WestTrackedCasualty";
_westCarCasualty = missionNamespace getVariable "WestCarCasualty";

_eastCasualty = missionNamespace getVariable "EastCasualty";
_eastTrackedCasualty = missionNamespace getVariable "EastTrackedCasualty";
_eastCarCasualty = missionNamespace getVariable "EastCarCasualty";

_civCasualty = missionNamespace getVariable "CivCasualty";
_civTrackedCasualty = missionNamespace getVariable "CivTrackedCasualty";
_civCarCasualty = missionNamespace getVariable "CivCarCasualty";

if (side group _unitKilled == west) exitWith {
	if(_unitKilled isKindOf "Man") exitWith {
		_westCasualty = _westCasualty + 1;
		missionNamespace setVariable ["WestCasualty", _westCasualty];
	};
	if(_unitKilled isKindOf "Tank") exitWith {
		_westTrackedCasualty = _westTrackedCasualty + 1;
		missionNamespace setVariable ["WestTrackedCasualty", _westTrackedCasualty];
	};
	if(_unitKilled isKindOf "CAR") exitWith {
		_westCarCasualty = _westCarCasualty + 1;
		missionNamespace setVariable ["WestCarCasualty", _westCarCasualty];
	};
};

if (side group _unitKilled == east) exitWith {
	if(_unitKilled isKindOf "Man") exitWith {
		_eastCasualty = _eastCasualty + 1;
		missionNamespace setVariable ["EastCasualty", _eastCasualty];
	};
	if(_unitKilled isKindOf "Tank") exitWith {
		_eastTrackedCasualty = _eastTrackedCasualty + 1;
		missionNamespace setVariable ["EastTrackedCasualty", _eastTrackedCasualty];
	};
		if(_unitKilled isKindOf "CAR") exitWith {
		_eastCarCasualty = _eastCarCasualty + 1;
		missionNamespace setVariable ["EastCarCasualty", _eastCarCasualty];
	};
};

if (side group _unitKilled == civilian ) exitWith {
	if(_unitKilled isKindOf "Man") exitWith {
		_civCasualty = _civCasualty + 1;
		missionNamespace setVariable ["CivCasualty", _civCasualty];
	};
	if(_unitKilled isKindOf "Tank") exitWith {
		_civTrackedCasualty = _civTrackedCasualty + 1;
		missionNamespace setVariable ["CivTrackedCasualty", _civTrackedCasualty];
	};
		if(_unitKilled isKindOf "CAR") exitWith {
		_civCarCasualty = _civCarCasualty + 1;
		missionNamespace setVariable ["CivCarCasualty", _civCarCasualty];
	};
};

 

 

Lastly the script to compile all this information and present it into the debriefing screen.

countCasualty.sqf 

Spoiler

/*--------NEED TO CALL THIS FUNCTION AFTER MISSION END. RECOMENDED TO CALL AT MISSION END TRIGGER----*/
_casualtyRep = missionNamespace getVariable "Casualty";

_westCasualty = missionNamespace getVariable "WestCasualty";
_westTrackedCasualty = missionNamespace getVariable "WestTrackedCasualty";
_westCarCasualty = missionNamespace getVariable "WestCarCasualty";

_eastCasualty = missionNamespace getVariable "EastCasualty";
_eastTrackedCasualty = missionNamespace getVariable "EastTrackedCasualty";
_eastCarCasualty = missionNamespace getVariable "EastCarCasualty";

_civCasualty = missionNamespace getVariable "CivCasualty";
_civTrackedCasualty = missionNamespace getVariable "CivTrackedCasualty";
_civCarCasualty = missionNamespace getVariable "CivCarCasualty";

if (side player == west) then {
	_casualtyRep = format [
	"CASUALTY REPORT.<br/><br/>
	FRIENDLY CASUALTY: <br/>
	%1 men KIA, <br/>
	%2 tracked vehicle destroyed, <br/>
	%3 wheeled vehicle destroyed.<br/><br/>
	ENEMY CASUALTY: <br/>
	%4 men KIA, <br/>
	%5 tracked vehicle destroyed, <br/>
	%6 wheeled vehicle destroyed.<br/><br/>
	CIVILIAN KILLED: <br/>
	%7 men killed.", 
	_westCasualty, _westTrackedCasualty, _westCarCasualty, _eastCasualty, _eastTrackedCasualty, _eastCarCasualty, _civCasualty
	];
}else{
	_casualtyRep = format [
	"CASUALTY REPORT.<br/><br/>
	FRIENDLY CASUALTY: <br/>
	%4 men KIA, <br/>
	%5 tracked vehicle destroyed, <br/>
	%6 wheeled vehicle destroyed.<br/><br/>
	ENEMY CASUALTY: <br/>
	%1 men KIA, <br/>
	%2 tracked vehicle destroyed, <br/>
	%3 wheeled vehicle destroyed.<br/><br/>
	CIVILIAN KILLED: <br/>
	%7 men killed.", 
	_westCasualty, _westTrackedCasualty, _westCarCasualty, _eastCasualty, _eastTrackedCasualty, _eastCarCasualty, _civCasualty
	];
};

missionNamespace setVariable ["Casualty", _casualtyRep];

 

 

 

The countCasualty.sqf I put in at trigger that will end the mission. In activation field I put this: [] execVM "countCasualty.sqf";

Then that trigger is synced to END MISSION module.

 

That is all, I hope someone will find this useful. Thank you for your time 🙂

  • Like 3
  • Thanks 3

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  

×