Casualties Cap

From F2 EN
Jump to: navigation, search

Description

The Casualties Cap component automatically senses the percentage of casualties taken by a group (or several groups), and triggers an ending when that threshold is reached. This is achieved by working closely with the Multiplayer Ending Controller component.

Required files

All the code associated with this component is found in:

  • init.sqf
  • f\server\f_endOnCasualtiesCap.sqf

How to activate

Open the file init.sqf and look for the code segment entitled:

// F2 - Casualties Cap 

Edit the following line, removing the // at the start:

// [[GroupName],100,1] execVM "f\server\f_endOnCasualtiesCap.sqf";

Now see instructions below on how to configure the component.

How to use

There are 3 different ways to use this component:

1. Monitor a defined list of groups

Assuming you have already activated this component (see above), open the file init.sqf and look for the code segment entitled:

// F2 - Casualties Cap 

Edit the folowing line (remember to remove the // at the start), replacing GroupName with the name of the group you want to monitor. For example, if the group you want to monitor is called MyGrp1, the line would be:

[[MyGrp1],100,1] execVM "f\server\f_endOnCasualtiesCap.sqf";

If you want to monitor more than one group, ensure they are separated by a comma, for example:

[[MyGrp1,MyGrp2],100,1] execVM "f\server\f_endOnCasualtiesCap.sqf";

On the same line, replace 100 with the percentage of casualties the group (or groups) will take in order to trigger the desired ending. For example, if you want the ending to be triggered when the group MyGrp1 takes 30% casualties the line would be:

[[MyGrp1],30,1] execVM "f\server\f_endOnCasualtiesCap.sqf";

On the same line, replace 1 with the desired ending. For example if you want ending #3 to be triggered the line would be:

[[MyGrp1],30,3] execVM "f\server\f_endOnCasualtiesCap.sqf";

Pre-configured lines for CO Folk ARPS Platoons

Pre-placed lines of code containing all the group names for each of the CO Folk ARPS Platoons are also provided. To use one of these lines instead, simply remove the // at the start.


2. Monitor all groups with a playable leader from one side

Assuming you have already activated this component (see above), open the file init.sqf and look for the code segment entitled:

// F2 - Casualties Cap 

Edit the folowing line (remember to remove the // at the start), replacing GroupName with the name of the side you want to monitor. For example, if the side you want to monitor is WEST, the line would be:

[WEST,100,1] execVM "f\server\f_endOnCasualtiesCap.sqf";

NOTE: The side must be in UPPERCASE.

On the same line, replace 100 with the percentage of casualties the side will take (from groups with playable leaders) in order to trigger the desired ending. For example, if you want the ending to be triggered when the groups with playable leaders on the side WEST take 30% casualties the line would be:

[WEST,30,1] execVM "f\server\f_endOnCasualtiesCap.sqf";

On the same line, replace 1 with the desired ending. For example if you want ending #3 to be triggered the line would be:

[WEST,30,3] execVM "f\server\f_endOnCasualtiesCap.sqf";


3. Monitor all groups with a playable leader from one or more faction from one side

Assuming you have already activated this component (see above), open the file init.sqf and look for the code segment entitled:

// F2 - Casualties Cap 

Edit the folowing line (remember to remove the // at the start), replacing it with this code:

[GroupName,100,1,["Faction1Name"]] execVM "f\server\f_endOnCasualtiesCap.sqf";

Replace GroupName with the name of the side which the faction(s) you want to monitor belong to. For example, if the faction(s) you want to monitor come from the side WEST, the line would be:

[WEST,100,1,["Faction1Name"]] execVM "f\server\f_endOnCasualtiesCap.sqf";

NOTE: The side must be in UPPERCASE.

Replace Faction1Name with the name of the faction you want to monitor. For example, if the faction you want to monitor is CDF, the line would be:

[WEST,100,1,["CDF"]] execVM "f\server\f_endOnCasualtiesCap.sqf";

NOTE: The faction must be in UPPERCASE and contained within double-quotes.

If you wanted to monitor more than one faction from the same side, simply add it to the same array. For example, if the factions you wanted to monitor are CDF and BAF, the line would be:

[WEST,100,1,["CDF","BIS_BAF"]] execVM "f\server\f_endOnCasualtiesCap.sqf";

On the same line, replace 100 with the percentage of casualties the faction(s) will take (from groups with playable leaders) in order to trigger the desired ending. For example, if you want the ending to be triggered when the groups with playable leaders from the factions CDF and BAF take 30% casualties the line would be:

[WEST,30,1,["CDF","BIS_BAF"]] execVM "f\server\f_endOnCasualtiesCap.sqf";

On the same line, replace 1 with the desired ending. For example if you want ending #3 to be triggered the line would be:

[WEST,30,3,["CDF","BIS_BAF"]] execVM "f\server\f_endOnCasualtiesCap.sqf";

Tips

  • This component is very useful in Attack & Defend missions, as it can be run for more than one group (or several groups) at the same time, triggering a different ending for each.

Credits

  • Head
  • Xiathorn
  • Headspace
  • Fer