Task Framework Groups

From Arma Projects
Jump to: navigation, search

The ability to create opposition at the objective is the core of this framework feature. In this part of the configuration, a mission maker can dynamically spawn Units, Vehicles and Objects. It also allows a range of group level functionality and links into the Intel Framework to create task based intel.

Configuration of Group Types

The first part of the dynamic nature of spawning groups is the "Types" that are available. These are configured in CfgMissionSides and the names are used here to call those group types. There is a lot of functionality in CfgMissionSides and it is highly recommended to read that first before configuring a group in the task system.

class My_Task_1 {
	//... Append to task
	class Groups {
		class Group1 {....};
		class Group2 {....};
		class Group3 {....};
	};
};

Common Group Parameters

  • Probability of Existing - A simple configuration to randomise the possibility of creating the group.
probability = <number:decimal>;
Code Note
Probability is Mandatory
If you do not declare probabilty in each of the groups, then there is 0% chance of them being created..


  • Position - The position the group will be spawned at. As above in Position, this can use the "position" or "positionOffset" from the dynamic task position
position = <array:co-ordinates / string:(marker/dynamicPosition)>;
Using a combination of distance and direction, a mission maker can spawn a group around the anchor position.
distance = <array:(min/max)/number:distance>
direction = <array:(min/max)/number:direction>
faction = <string:FactionID>
  • Create an object with a specific angle. Useful for static objects and vehicles
angle = <array:(min/max)/number:degree>

Creating a Vehicle

To create a vehicle, there are two lines that are required, the vehicle types and whether to create the crew. The syntax is simple:

  • Create an array of vehicle names from either the in-game classname or use a preconfigered type from CfgMissionSides
vehicleTypes[] = <array:vehicleTypes>;
  • Create a boolean of 0:false or 1:true to create the crew of the vehicle
createCrew = <number:boolean>

Example of creating a vehicle:

class Vehicle_1 {
	probability = 1; // 100% Chance

	// Task Offset Position
	position = "positionOffset";

	// Create vehicle away from position
	distance[] = {50,100};
	direction[] = {0,120};

	// Vehicle Faction Type from CfgMissionSide
	faction = "FactionTypeOPF";

	// CfgMissionSide Vehicle Group OR Vehicle Classname
	vehicleTypes[] = {"Truck_Support"};

	// Create the crew
	createCrew = 1;
};

Creating a Group of Units

To create a group of units or squad, there are two lines that are required, the faction/side and the unit classnames.

  • Set the side (0:East, 1:West, 2:Independent, 3:Civilian) or use a pre configured name of a faction from CfgMissionSides
faction[] = <string:faction/number:side>;
  • Create an array of unit classnames from either the in-game classname or use a preconfigured type from CfgMissionSides
groupTypes[] = <array:groupTypes>;

Example of creating a group:

class EnemySquad1 {
	probability = 0.9; // 90% Chance of being created

	// Task Offset Position
	position = "positionOffset";

	// Create away from position
	distance[] = {20,50};
	direction[] = {0,360};

	// Vehicle Faction Type from CfgMissionSide or Side ID
	faction = "FactionTypeOPF";

	// CfgMissionSide Group OR Classnames
	groupTypes[] = {"Squad8","Squad4"};
};

Creating an Object

To create an object (ie Cache), there one line that are required, the object types. The syntax is simple:

  • Create an array of object classnames or use a preconfigured type from CfgMission
objectTypes[] = <array:objectTypes>;

Example of creating an object:

class Cache_1 {
	probability = 1; // 100% Chance

	// Task Offset Position
	position = "positionOffset";

	// Create away from position
	distance[] = {50,100};
	direction[] = {0,120};

	// Object Classname
	objectTypes[] = {"Box_FIA_Ammo_F"};
};

Group Functions

Create a Patrolling Group

To make a group patrol an area, two lines are needed. This will set the group to patrol over an area of a specified radius. It is always evaluated first so you can set a random chance of patrol and default to defend. (see example below)

  • isPatrolling is a probability that will return true or false. ie. 0.8 = 80% or 1 = 100%
isPatrolling = <number:decimal>
  • radius is the patrol range around the position and is in meters. it can be a random between two ranges or a fixed range.
radius = <array:(min/max)/number:distance>

Create a Defending Group

To make a group defend an area, there are a couple of options. Either stand around or occupy nearby buildings. Again like patrolling, this can be random but is evaluated after isPatrolling

  • isDefending is a probability that will return true or false. ie. 0.8 = 80% or 1 = 100%
isDefending = <number:decimal>
  • Same as isDefending, this is a probability to occupy nearby buildings.
occupyBuildings = <number:decimal>
  • radius in this part is the area to defend and search for nearby buildings to occupy.
radius = <array:(min/max)/number:distance>

Move Objects in Buildings

Useful for hiding weapons caches in nearby buildings, this is exactly the same as occupying building positions.

  • Same as above, this is a probability to occupy nearby buildings. ie. 0.8 = 80% or 1 = 100%
occupyBuildings = <number:decimal>
  • radius in this part is the area to search for nearby building positions to move the object to.
radius = <array:(min/max)/number:distance>

Create a Crowd or Random Movement

Creating a crowd is simple now as this command will make the members of the group randomly walk around an area. When a civilian group is spawned, this can be used to mimic a town population or if an enemy group is spawned, they will aimlessly walk around until they become aware of hostiles to which they will then regroup and engage.

  • isCrowd is a probability that will return true or false. ie. 0.8 = 80% or 1 = 100%
isCrowd = <number:decimal>
  • radius is the area size around the position and is in meters. it can be a random between two ranges or a fixed range.
radius = <array:(min/max)/number:distance>

Create an Attacking Group

WIP

isAttacking = <number:decimal>

Create a Captive Group

WIP

captive = <number:decimal>


Task Objective Options

When spawning groups, the conditions of the objective of the task can include a number of options to assess the condition of the spawned groups. ie. If all spawned units are killed. There are some additional options to make specific targets from spawned groups to use in the objective OR allow the dropping of task intel that can be picked up or received through NPC conversations.

Creating Targets

To create a target that can be used in the objective condition, it is simply one line of code. It is recommended to read the objective section as a reference.

  • isTarget is a probability that will return true or false. ie. 0.8 = 80% or 1 = 100%
isTarget= <number:boolean>

Creating Intel

To allow the dropping of INTEL from a group, one line of code is needed and when enabled, the last man standing of that squad will drop intel when killed. The types of intel are configured in CfgMission.

  • dropIntel is a probability that will return true or false. ie. 0.8 = 80% or 1 = 100%
dropIntel = <number:decimal>
  • conversations adds a conversation selected randomly from the ids in the array. these are configured in CfgMissionConversations.
conversations[] = <array:conversationIDs>


Examples of Configuration

Mixing it together example

Here is an example of an OPFOR squad that has the following configuration:

  • A 90% chance of being created
  • requires at least three players connected at the time of task creation
  • Is spawned between 20 and 50 metres in any direction from the task offset position
  • Is either an 8 man or 4 man squad from CfgMissionSides
  • Has a 50% chance of patrolling between 50 to 150m around the task offset position
    • else has 100% chance of defending and occupying buildings within 150m from the task offset position
class EN_Group_1 {
	probability = 0.9; // Has 90% chance of being created
	minPlayers = 3;

	// Set the random position
	position = "positionOffset";
	distance[] = {20,50};
	direction[] = {0,360};

	// Random Squad Types
	faction = "FactionTypeOPF";
	groupTypes[] = {"Squad8","Squad4"};

	// Has a 50% Chance of Patrolling ELSE Defending.
	isPatrolling = 0.5;
	isDefending = 1;
	occupyBuildings = 1;
	radius[] = {50,150};
};

Example of Each type of Group

class My_Task_1 {
	//... Append to task
	class Groups {
		class EnemySquad1 {
			probability = 0.9;
			position = "positionOffset";
			distance[] = {20,150};
			direction[] = {0,360};
			faction = "FactionTypeOPF";
			groupTypes[] = {"Squad4_AA","Squad4_AR","Squad4_AT","Squad4_M"};
			isPatrolling = 0.9;
			isDefending = 1;
			occupyBuildings = 1;
			radius[] = {50,150};
		};
		class EnemyVehicle1 {
			probability = 0.85;
			position = "positionOffset";
			distance[] = {50,100};
			direction[] = {0,360};
			faction = "FactionTypeOPF";
			vehicleTypes[] = {"CarTurret","Car"};
			createCrew = 1;
			isPatrolling = 0.6;
			radius[] = {150,250};
		};
		class ObjectCache1 {
			probability = 1;
			isTarget = 1;
			objectTypes[] = {"Box_FIA_Ammo_F","Box_FIA_Support_F","Box_FIA_Wps_F"};
			position = "positionOffset";
			occupyBuildings = 1;
			radius[] = {150,150};
		};
	};
};