-
Notifications
You must be signed in to change notification settings - Fork 5
Casualties Cap
File location | f\casualtiesCap\f_CasualtiesCapCheck.sqf |
Enabled by default? | no |
Enable/Disable in | init.sqf |
Runs on | Server |
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.
Open the file init.sqf and look for the code segment entitled:
// F3 - Casualties Cap
Three different pre-configured options are provided (but you can also create your own, full instructions below):
To trigger ending #1 when all BLUFOR units in groups with playable leaders are dead, edit the following line, removing the //
at the start:
// [BLUFOR,100,1] execVM "f\casualtiesCap\f_CasualtiesCapCheck.sqf";
f\casualtiesCap\f_CasualtiesCapCheck.sqf
Takes the following arguments:
# | name | type | description |
---|---|---|---|
0 | groups or side | Side | Side to check. |
Array | Array of groupnames as strings. (e.g. ["MyGrp1","MyGrp2"] ) |
||
1 | percentage | Number | What percentage of units must be dead before the ending is triggered |
2 | ending | Number | Which ending will be executed. |
Code | Code to be executed. | ||
3 | onlyPlayers (optional) | Boolean | If only groups with a playable leader slot will be included (default is true ) |
4 | faction (optional) | Array | Which faction(s) to filter for if the first variable is a side (e.g. ["blu_f"] ) |
If you want to trigger ending 2
after 30
% of OPFOR/CSAT are dead, use the following line:
[OPFOR,30,2] execVM "f\casualtiesCap\f_CasualtiesCapCheck.sqf";
If you want to monitor individual groups, use the following line to trigger ending 1
once at least90
% of the groups MyGrp1
and MyGrp2
are dead.
[["MyGrp1","MyGrp2"],90,1] execVM "f\casualtiesCap\f_CasualtiesCapCheck.sqf";
If you want to trigger a custom code instead of a pre-defined ending you can replace the number indicating the ending with any block of code.
For example, if you wanted to display a hint saying AAF has taken too many casualties
instead of triggering an ending you would use:
[INDEPENDENT,100,{hint 'AAF has taken too many casualties!'}] execVM "f\casualtiesCap\f_CasualtiesCapCheck.sqf";
Note: The code will be run on all clients and the server. Note: The custom code you want to execute in place of a pre-defined ending must be enclosed within curly braces: {}
If you are monitoring all groups on a particular side, e.g. BLUFOR
, you can also filter by specific faction. You do this by adding the optional fourth and fifth parameters to the activation line.
For example, if you want ending 2
to be triggered when all groups with playable leaders on the side BLUFOR
and in the faction BLU_F
take 50%
casualties the line would be:
[BLUFOR,50,2,true,["blu_f"]] execVM "f\casualtiesCap\f_CasualtiesCapCheck.sqf";
- 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.
- Assign Gear
- Assign Gear AI
- Authorized Crew Check
- Briefing
- Casualties Cap
- Disable Thermals
- Dynamic View Distance
- E & E Check
- FCS
- Fire Team Member Markers
- Group Markers
- Group Join
- Map Click Teleport
- Medical System
- Mission Conditions
- Multiplayer Ending Controller
- Nametags
- Premount
- Radio
- Remove Body
- Safe Start
- Group ID
- Color Teams
- AI Skill
- Spectator
- Zeus Support