-
Notifications
You must be signed in to change notification settings - Fork 1
Surrender
Mike-MF edited this page Jan 22, 2023
·
4 revisions
This page will explain the usage of the Surrender function.
/*
* Author: Mike
* Random chance of an enemy surrendering when being suppressed.
* Fires everytime a bullet passes close to an enemy.
* Call from init.sqf
*
* Arguments:
* 0: Group <GROUP>
* 1: Chance <NUMBER> (default: 5)
* 2: Distance <NUMBER> (default: 400)
* 3: Rally Chance <NUMBER> (default: 0)
*
* Return Value:
* None
*
* Example:
* [My_Group, 50] call MFUNC(surrender)
*/
This function will give the AI a chance for surrendering when being suppressed. Even lower chances such as 10% will still often result in AI surrendering due to overwhelming fire.
The recommended value for regular AI would be around 1-5%.
Additionally you can add a distance check from the person suppressing (defaulted at 400m) and a chance of a unit to Rally and get back into the fight. (defaulted at 0) it will use a random time, minimum of 10 seconds and a maximum of 2 minutes.
Call from init.sqf
Example:
[My_Group, 1] call MFUNC(surrender);
Extended Examples:
{
[_x, 1] call MFUNC(surrender);
} forEach [My_Group_One, My_Group_Two, My_Group_Three];
Extra Parameters
// Sides are: west, east, resistance & civilian
private _indepGroups = allGroups select {side _x isEqualTo resistance};
{
[_x, 5, 300, 60] call MFUNC(surrender);
} forEach _indepGroups;
Pages
- Home
- Your First Mission
- Creating A Mission
- Contract Missions
- Difficulty Guidelines
-
Functions Library
- Base Spectator
- Bomber
- Car Alarm
- Chemical Detector
- Collect Intel
- Connect Battery To Defusable
- Contamination Gas
- Count Alive
- Dialogue
- Disable AI
- Download Intel
- Earthquake
- Enable AI
- Force Shooting
- Ground Fog
- Hunt
- Lock Doors
- Mark Buildings
- Monitor Units
- Mortar Strike
- Ping
- Players
- Reaction
- Reinforcements
- Reinforcement Waves
- Respirator Effects
- Set Sleeping
- Sound Source
- Surrender
- Switch Action
- Teleport
- Toggle Lights
- Trigger Area
- Helicopters
- Resources
- Quality Checklist
- Useful Commands
- ArmaQDL