Task Framework

From Arma Projects
Jump to: navigation, search
BIS Task System showing the parent > child hierarchy

Overview

The task framework is an incredibly extensible core function of your mission. It supports the spawning of every mission object, enemy, compositions, tasks, interactions, Intel and everything else. It allows for almost any scenario to be built, tasks will be monitored for completion and everything is synchronised for a seamless single player and multiplayer experience.

Tasks can be as static and prescriptive or as dynamic as the mission maker wants. The configuration outlined here provides the functionality to create scenarios very quickly, re-playable and require as little coding as possible.

Parent Tasks

A parent task is a task that has tasks grouped under it. This allows mission makers to link an operational objective to sub-tasks that contribute to it.

Child Tasks

A child task is often a sub-task of a parent however does not necessarily need to have one. If not, it will appear as a parent task but operate as a child.

Building the Task Configuration

The next set of sections outlines the process of building each part of the task configuration. Merge each component together to form a fully configured task.

Mission Task Configuration

The configuration of tasks in the framework is stored under CfgMissionTasks. This is a configuration in the description.ext that sets up the objectives and tasks for a mission. It also supports the spawning of AI units, vehicles and objects that will contribute to the experience of players have with the mission.

Lesson 1. Start Learning to create a Mission Task Configuration

Parent Task Configuration

The unique nature of a parent enables it to spawn and track child tasks linked and stack them to create a story. It is optional to actually define the tasks but this is another way to manage your mission flow. The addition of the class "ChildTasks" is what separates this task configuration as a parent.

Lesson 2. Learn how to create Parent Tasks

Setting a Position

Every task should have a position and this part of the task configuration allows a mission maker to specify either a specific location or create a dynamic position that can change every time the task is created.

Lesson 3. Learn how to set a task position

Creating a Description

To create a task showing in a players map screen and hud overlay, a description of the task is needed. This tells the story and outlines the objectives of the task for players to follow. The task desciption has the ability to dynamically change text based on declared arguments that are processed at the time the task is created. It can also easily be configured as a hierarchical task with the declaration of a parent ID.

Lesson 4. Learn how to create a task note

Creating Map Markers

Markers are a useful story telling technique for your mission.

Lesson 5. Learn how to add Map Markers

Creating 3DEN Compositions

For every task, included in the object spawner, is the ability to load 3DEN object compositions into the mission dynamically. These will be automatically cleaned up during the task clean up phase. There is no limit per task on how many compositions can be spawned and the parameters support dynamic placement around a central reference position. If no position is given, the 3DEN composition recorded position is used as this allows precise replication of compositions where they were recorded.

Lesson 6. Learn how to create 3DEN Compositions

Creating Groups, Vehicles and Objects

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.

Lesson 7. Learn how to create task groups

Creating Deployable Objects

Create a new range of tasks with deployable objectives

Lesson 8. Learn how to create deployable objects

Setting the Task Objective

As with every task, there is an objective to complete. This section of the config allows a mission maker to set the conditions that are monitored to check if a task has been completed. There are many pre-configured variables that are available and when the condition returns true, the objective will be updated. Once complete, the framework can initiate a subsequent task(s) so a mission can be daisy chained into a story or larger operation.

Lesson 9. Learn how to create objective monitors

Task Functions

These are the main functions that are available to script with in this part of the framework.

Task Functions

Function Description
MPSF_fnc_createTask Create a new or preconfigured task
MPSF_fnc_updateTaskStatus Update a created task's status
tbc description

Spawner Functions

Function Description
tbc description

Full Task Configuration Example

class CfgMissionTasks {
	// Parent Task
	class Operation_Phase1_AssaultNight {
		scope = 2;
		typeID = 0;
		class TaskDetails {
			parent = "";
			title = "Operation Hard Eye Selen";
			description[] = {
				"<font>Ref: %2</font> | <font>Date: %3 | Phase 1 of 2</font>"
				,"<font size='16' color='#FFC600'>Brief:</font> <font>%1 has been a region of heavy conflict for the last decade.</font>"
				,"<font size='16' color='#FFC600'>Action:</font> <font>%4 Forces will re-assert control over northern and western regional areas of %1.</font>"
				,"<font size='16' color='#FFC600'>Enemy:</font> <font>Little is known about what the %5 insurgency have with respect to their resources</font>"
				,"<font size='16' color='#FFC600'>Note:</font> <font>Redacted --COMMAND ONLY--</font>"
			};
			iconType = "Defend";
			chevronTitle = "Operation Phase 1";
			textArguments[] = {"worldName","randomCode","datetime","factionBLUlong","factionOPFlong","factionOPFshort","nearestTown"};
		};
		class Environment {
			time = "Dawn";
			fog = 1;
			force = 1;
		};
		class Markers {};
		class ChildTasks {
			class Phase1_SecureArea_Crossroads {};
			class Phase1_SecureArea_Commstower {};
			class Phase1_SecureArea_Barracks {};
		};
		class Objective {
			class Succeeded {
				condition = "_childTasksComplete";
			};
		};
	};
	class Phase1_SecureArea_Crossroads {
		scope = 1;
		typeID = 2;
		position = "op_p1_crossroads";
		positionOffset = "op_p1_crossroads_offset";
		class TaskDetails {
			parent = "Operation_Phase1_AssaultNight";
			title = "Secure Crossroads";
			description[] = {
				"<font>Ref: %1</font> | <font>Date: %2<br/>AO: %3 %4 near %5</font>"
				,"<font size='16' color='#FFC600'>Brief:</font> <font>There is a key strategic chokepoint for %7 supply lines and retreat created by the terrain and buildings.</font>"
				,"<font size='16' color='#FFC600'>Action:</font> <font>%6 forces will move to and occupy the area, ensuring that any enemy forces are engaged and cleared.</font>"
				,"<font size='16' color='#FFC600'>Enemy:</font> <font>The enemy has clearly identified the area as a strategic location.</font>"
				,"<font size='16' color='#FFC600'>Note:</font> <font>There are civilians in the area and it is possible that some may support %7.</font>"
			};
			iconType = "A";
			iconPosition = "positionOffset";
			chevronTitle = "%1";
			textArguments[] = {"randomCode","datetime","worldRegion","worldName","nearestTown","factionBLUshort","factionOPFshort"};
		};

		class Markers {
			//
		};

		class Groups {
			class target_0 {
				probability = 1;
				faction = "FactionTypeOPF";
				groupTypes[] = {"Group8"};
				isPatrolling = 1;
				position = "positionOffset";
				radius[] = {60,80};
			};
		};

		class Objective {
			class Succeeded {
				condition = "_unitsKilled";
			};
		};
	};
	class Phase1_SecureArea_Commstower {
		scope = 2;
		typeID = 2;
		position = "op_p1_commstower";
		positionOffset = "op_p1_commstower_offset";
		class TaskDetails {
			parent = "Operation_Phase1_AssaultNight";
			title = "Secure Comms Hub";
			description[] = {
				"<font>Ref: %1</font> | <font>Date: %2<br/>AO: %3 %4 near %5</font>"
				,"<font size='16' color='#FFC600'>Brief:</font> <font>%7 forces have taken the nearby communications tower in an effort to control civilian communications.</font>"
				,"<font size='16' color='#FFC600'>Action:</font> <font>%6 forces will capture this objective with the intent to secure and not destroy the equipment.</font>"
				,"<font size='16' color='#FFC600'>Enemy:</font> <font>This is a KEY COMMS HUB for the enemy and is likely to be well defended.</font>"
				,"<font size='16' color='#FFC600'>Note:</font> <font>There are civilians in the area and it is possible that some may support %7.</font>"
			};
			iconType = "B";
			iconPosition = "position";
			chevronTitle = "%1";
			textArguments[] = {"randomCode","datetime","worldRegion","worldName","nearestTown","factionBLUshort","factionOPFshort"};
		};
		class Markers {};
		class Compositions {
			class georgetown_towers {
				typeIDs[] = {"comms_tower_georgetown"};
				downloadIntel = 1;
			};
		};
		class Groups {
			class target_0 {
				probability = 1;
				faction = "FactionTypeOPF";
				groupTypes[] = {"Squad4"};
				isDefending = 1;
				occupyBuildings = 1;
				position = "position";
				radius[] = {30,30};
			};
			class target_1 {
				probability = 1;
				faction = "FactionTypeOPF";
				groupTypes[] = {"Squad4"};
				isPatrolling = 1;
				position = "positionOffset";
				radius[] = {80,80};
			};
			class target_2 {
				probability = 1;
				faction = "FactionTypeOPF";
				groupTypes[] = {"Squad4"};
				isDefending = 1;
				occupyBuildings = 1;
				position = "positionOffset";
				radius[] = {80,80};
			};
		};
		class Objective {
			class Succeeded {
				condition = "_unitsKilled && _intelDownloaded";
			};
		};
	};
	class Phase1_SecureArea_Barracks {
		scope = 1;
		typeID = 2;
		position = "op_p1_baracks";
		positionOffset = "op_p1_barracks_offset";
		class TaskDetails {
			parent = "Operation_Phase1_AssaultNight";
			title = "Secure Police HQ";
			description[] = {
				"<font>Ref: %1</font> | <font>Date: %2<br/>AO: %3 %4 near %5</font>"
				,"<font size='16' color='#FFC600'>Brief:</font> <font>%7 forces have taken over and occupied the local district police HQ.</font>"
				,"<font size='16' color='#FFC600'>Action:</font> <font>%6 forces will surround and engage all hostiles at the objective.</font>"
				,"<font size='16' color='#FFC600'>Enemy:</font> <font>It is highly possible that this location is the command post for %7 operations in the area.</font>"
				,"<font size='16' color='#FFC600'>Note:</font> <font>There are civilians in the area that may support %8.</font>"
			};
			iconType = "C";
			iconPosition = "positionOffset";
			chevronTitle = "%1";
			textArguments[] = {"randomCode","datetime","worldRegion","worldName","nearestTown","factionBLUshort","factionOPFshort"};
		};
		class Markers {};
		class Groups {
			class target_0 {
				probability = 1;
				faction = "FactionTypeOPF";
				groupTypes[] = {"Disguised8"};
				isDefending = 1;
				occupyBuildings = 1;
				position = "position";
				radius[] = {50,50};
			};
			class target_1 {
				probability = 1;
				faction = "FactionTypeOPF";
				groupTypes[] = {"Disguised4"};
				isDefending = 1;
				occupyBuildings = 1;
				position = "positionOffset";
				radius[] = {30,30};
			};
		};
		class Deployable {
			class deploy_1 {
				position = "";
				direction = 0;
				container = "";
				Object = "";
			};
		};
		class Objective {
			class Succeeded {
				condition = "_unitsKilled && _intelPickedup";
			};
		};
	};
};