21 KiB
title, description
| title | description |
|---|---|
| Task Usage Guide | The task module stores transient mission task metadata for active server or mission lifecycle workflows. SQF still owns Arma-only runtime state such as objects and participants. |
The server addon at arma/server/addons/task also owns task execution:
creating BIS tasks, registering task entities, tracking participants, binding
task ownership, applying player/org rewards, and clearing task state when a
task completes.
Runtime dependencies:
forge_server_extensionforge_server_commonforge_server_actorforge_server_bankforge_server_orgforge_client_notifications
Data Model
Catalog entries are flexible JSON objects. The service normalizes these fields when a catalog entry is inserted or ownership changes:
taskIdtaskIDacceptedrequesterUidorgIDprerequisiteTaskIds
Ownership context:
{
"requesterUid": "76561198000000000",
"orgId": "default"
}
Commands
| Command | Arguments | Returns |
|---|---|---|
task:reset |
none | true. |
task:catalog:active |
none | Active catalog entry array JSON. |
task:catalog:get |
task_id |
Catalog entry JSON or null. |
task:catalog:upsert |
task_id, entry_json |
Stored catalog entry JSON. |
task:catalog:delete |
task_id |
true. |
task:ownership:bind |
task_id, ownership_json |
Ownership mutation result JSON. |
task:ownership:release |
task_id |
Ownership mutation result JSON. |
task:ownership:accept |
task_id, ownership_json |
Ownership mutation result JSON. |
task:ownership:reward_context |
task_id |
Reward context JSON. |
task:status:set |
task_id, status |
true. |
task:status:get |
task_id |
Status string JSON. |
task:status:clear |
task_id |
true. |
task:defuse:increment |
task_id |
New counter value JSON. |
task:defuse:get |
task_id |
Counter value JSON. |
task:clear |
task_id |
true. |
Upsert a Catalog Entry
private _entry = createHashMapFromArray [
["title", "Destroy Cache"],
["description", "Destroy the enemy supply cache."],
["reward", 1500]
];
private _result = "forge_server" callExtension ["task:catalog:upsert", [
"task-cache-1",
toJSON _entry
]];
Mark a Task Active
"forge_server" callExtension ["task:status:set", [
"task-cache-1",
"active"
]];
private _active = "forge_server" callExtension ["task:catalog:active", []];
Completed statuses succeeded and failed are also stored as completed status
fallbacks. Clearing status removes active and completed state.
Accept a Task
private _ownership = createHashMapFromArray [
["requesterUid", getPlayerUID player],
["orgId", "default"]
];
private _result = "forge_server" callExtension ["task:ownership:accept", [
"task-cache-1",
toJSON _ownership
]];
task:ownership:accept fails if the task is not active or another requester
already accepted it.
Rewards
private _result = "forge_server" callExtension ["task:ownership:reward_context", [
"task-cache-1"
]];
private _context = fromJSON (_result select 0);
The reward context contains requesterUid and orgId.
Server Task Flows
The task addon provides these server-owned task flows:
attackdefenddefusedeliverydestroyhostagehvt
Mission designers can create tasks in four ways:
- Eden modules for editor-authored tasks.
forge_server_task_fnc_startTaskfor script-authored tasks.forge_server_task_fnc_handlerfor pre-registered entities with reputation gating and ownership binding. This path expects the BIS task and catalog entry to already exist if map-task and CAD visibility are required.- Direct task function calls for server-owned or mission-authored flows that
intentionally fall back to the
defaultorg. This path expects the BIS task to already exist if map-task visibility is required.
The dynamic mission manager can also generate attack, defend, defuse, delivery, destroy, hostage, HVT kill, and HVT capture tasks from config. That is system-generated content rather than a hand-authored task creation path.
Communities can disable the built-in generator and create CAD-visible tasks from their own mission or server code. See Custom Mission Generators for the custom generator integration contract.
Generated Mission Configuration
Mission designers should define class CfgMissions in the mission folder, such
as arma/missions/<missionName>/CfgMissions.hpp, and include it from
description.ext. The framework also ships
arma/server/addons/task/CfgMissions.hpp as a fallback schema for missions that
do not provide their own config.
The generator lookup order is:
missionConfigFile >> "CfgMissions"configFile >> "CfgMissions"
Mission config therefore wins. Use mission-local CfgMissions.hpp for task
weights, reward ranges, time limits, object pools, HVT/hostage classes, defuse
device pools, delivery cargo pools, destroy targets, and location reuse
cooldown. Keep the framework copy in sync with the expected schema so fallback
generation still works.
Generated mission types currently exposed by the framework are:
| Type | CAD Value | Base Task Flow |
|---|---|---|
| Attack | attack |
attack |
| Defend | defend |
defend |
| Defuse | defuse |
defuse |
| Delivery | delivery |
delivery |
| Destroy | destroy |
destroy |
| Hostage | hostage |
hostage |
| Kill HVT | hvtkill |
hvt |
| Capture HVT | hvtcapture |
hvt |
The server CBA setting forge_server_task_enableGenerator is the single runtime gate
for generated missions. When disabled, timer-based generation does not run, CAD
hydrates no generated task types, and manual dispatcher requests are rejected
server-side.
The mission setup UI does not enable or disable generated missions. It applies runtime tuning such as faction, caps, intervals, reward ranges, rating ranges, penalties, time limits, and a generator provider preference. Generator enablement remains controlled by the CBA setting above.
When forge_server_task_enableMissionSetup is enabled, the mission manager
waits for setup settings before starting. There is no timeout auto-apply.
Pressing Cancel, X, or Escape applies default values from CBA, mission
parameters, and CfgMissions.
The setup UI stores the provider preference in
forge_server_task_generatorProvider as builtin or custom. CAD/manual
generated task requests use the task provider registry and route to the selected
provider. That provider option stays separate from the built-in generator CBA
gate so disabling Forge's built-in generator does not prevent custom providers
from publishing CAD-visible work.
CAD Compatibility
CAD hydrates assignable tasks from TaskStore.getActiveTaskCatalog. A task must
have a catalog entry and a task status of available, assigned, or active
before CAD can show it.
CAD assignment only reserves a task for a group. The task is accepted and task
logic starts after the assigned group leader acknowledges the assignment. If
the leader declines, the CAD assignment is removed and the task returns to the
open contract board.
CAD-compatible creation paths:
- Eden modules: compatible because they delegate to
forge_server_task_fnc_startTask. forge_server_task_fnc_startTask: compatible because it registers the catalog entry, creates the BIS task, and dispatches through the handler.- Dynamic mission manager tasks: compatible because the mission manager
uses
forge_server_task_fnc_startTask.
Limited or incompatible paths:
forge_server_task_fnc_handler: only compatible if a catalog entry was already registered elsewhere. The handler sets available status and ownership, but it does not create the BIS task shown in the map task tab or upsert the catalog entry.- Direct task function calls: not CAD-compatible by default. They bypass
startTaskand usually do not register the task catalog entry or active status that CAD hydrates from. They also only callBIS_fnc_taskSetStateat completion/failure; they do not create the BIS task first.
BIS Map Task Prerequisite
Only the Eden task modules and forge_server_task_fnc_startTask create the BIS
task automatically through BIS_fnc_taskCreate.
If a mission uses forge_server_task_fnc_handler directly or calls a task flow
function such as forge_server_task_fnc_attack, the mission must create a BIS
task with the same task ID before the Forge task completes. Otherwise the
success/failure BIS_fnc_taskSetState call has no visible map task to update.
That prerequisite can be satisfied with a vanilla Eden task creation module or
a scripted BIS_fnc_taskCreate call. forge_server_task_fnc_startTask is the
preferred Forge path because it handles BIS task creation, Forge catalog
registration, entity registration, and handler dispatch together.
Eden Modules
Eden task modules are the normal designer-facing path. Place the module, configure its attributes, and sync it to the relevant entities or grouping modules.
Available task modules:
FORGE_Module_Attack: sync directly to target units or vehicles.FORGE_Module_Destroy: sync directly to objects, vehicles, or units.FORGE_Module_Defuse: sync toFORGE_Module_Explosivesand optionallyFORGE_Module_Protected.FORGE_Module_Delivery: sync toFORGE_Module_Cargo; the cargo module syncs to cargo objects.FORGE_Module_Hostage: sync toFORGE_Module_HostagesandFORGE_Module_Shooters.FORGE_Module_HVT: sync directly to HVT units.FORGE_Module_Defend: configure the defense marker and wave settings; sync enemy units to use their groups as wave templates.
These modules delegate to forge_server_task_fnc_startTask.
Each task module also includes an optional chain field:
Prerequisite Task IDs: comma-separated task IDs that must succeed first.
Mission Designer Guide
This section is the practical Eden setup guide for mission designers.
General Rules
Use these rules for every Forge task:
- Give every task a unique
TaskID. - Use area markers for zone-style fields such as:
DefenseZoneDeliveryZoneExtZoneCBRNZone
- Prefer
RECTANGLEorELLIPSEmarkers with real size. - Set success and fail limits explicitly instead of relying on defaults.
- If a task uses a timer, the countdown now waits until the assigned group leader acknowledges the task.
- Grouping modules such as
Explosive Entities,Protected Entities,Cargo,Hostages, andShootersshould be synced to real world objects, not other logic modules. - To chain tasks, set
Prerequisite Task IDson the dependent task module. Use comma-separated IDs such asattack_01, delivery_02. The dependent task stays hidden from CAD and cannot be assigned until every listed task succeeds. - Reward class fields accept comma-separated class names without brackets,
such as
ItemGPS, FirstAidKit. Legacy SQF array strings such as["ItemGPS","FirstAidKit"]are still supported.
Attack Task
Use FORGE_Module_Attack when players need to eliminate hostile units or
vehicles.
Setup:
- Place the enemy units or vehicles.
- Place
FORGE_Module_Attack. - Set
TaskID. - Set
LimitSuccessto the number of targets that must be killed. - Set
LimitFailif you want a fail threshold. - Set rewards, rating, and optional
TimeLimit. - Sync the attack module directly to the target units or vehicles.
Notes:
- This module reads its synced entities directly.
TimeLimituses seconds.0means no limit.
Destroy Task
Use FORGE_Module_Destroy when players must destroy objects, vehicles, or
units.
Setup:
- Place the objects, vehicles, or units that must be destroyed.
- Place
FORGE_Module_Destroy. - Set
TaskID. - Set
LimitSuccessto the number of targets that must be destroyed. - Set
LimitFailif the mission should fail after too many losses. - Set rewards, rating, and optional
TimeLimit. - Sync the destroy module directly to the targets.
Notes:
- This module reads its synced entities directly.
TimeLimituses seconds.0means no limit.
Defuse Task
Use FORGE_Module_Defuse when players must defuse one or more explosives while
protecting other entities.
Required module layout:
[Defuse Task] --> [Explosive Entities] --> explosive objects
[Defuse Task] --> [Protected Entities] --> protected objects/vehicles/units
Setup:
- Place the explosive objects that players must defuse.
- Place
FORGE_Module_Explosives. - Sync each explosive object to
FORGE_Module_Explosives. - Place the objects, vehicles, or units that must survive.
- Place
FORGE_Module_Protected. - Sync each protected entity to
FORGE_Module_Protected. - Place
FORGE_Module_Defuse. - Set
TaskID. - Set
LimitSuccessto the number of explosives that must be defused. - Set
LimitFailto the number of protected entities that can be lost before failure. - Set
TimeLimitto the IED countdown in seconds. This is per-IED countdown behavior, not a global mission timer. - Set rewards, rating, and end-state options.
- Sync
FORGE_Module_DefusetoFORGE_Module_Explosives. - Sync
FORGE_Module_DefusetoFORGE_Module_Protected.
Notes:
- The module reads grouped objects from the
Explosive EntitiesandProtected Entitiesmodules, not from direct object syncs. - Logic objects are filtered out already, so only real explosives and protected entities are counted.
- The ACE defuse event is wired to the task system and resolves IEDs back to the correct task.
Delivery Task
Use FORGE_Module_Delivery when players must move cargo into a delivery zone.
Required module layout:
[Delivery Task] --> [Cargo] --> cargo objects
Setup:
- Place the cargo objects.
- Create an area marker for the delivery zone.
- Place
FORGE_Module_Cargo. - Sync each cargo object to
FORGE_Module_Cargo. - Place
FORGE_Module_Delivery. - Set
TaskID. - Set
DeliveryZoneto the marker name. - Set
LimitSuccessto the number of cargo objects that must arrive. - Set
LimitFailto the number of cargo objects that can be damaged past the fail threshold. - Set rewards, rating, and optional
TimeLimit. - Sync
FORGE_Module_DeliverytoFORGE_Module_Cargo.
Notes:
- The runtime checks
inArea DeliveryZone, so the zone must be an area marker.
Hostage Task
Use FORGE_Module_Hostage when players must rescue hostages and move them to
an extraction zone.
Required module layout:
[Hostage Task] --> [Hostage Entities] --> hostage units
[Hostage Task] --> [Shooter Entities] --> hostile shooter units
Setup:
- Place the hostage AI units.
- Place the hostile shooter AI units.
- Create an area marker for the extraction zone.
- If using the CBRN variant, create an area marker for the
CBRNZone. - Place
FORGE_Module_Hostages. - Sync the hostage units to
FORGE_Module_Hostages. - Place
FORGE_Module_Shooters. - Sync the shooter units to
FORGE_Module_Shooters. - Place
FORGE_Module_Hostage. - Set
TaskID. - Set
ExtZoneto the extraction marker name. - Set
LimitSuccessto the number of hostages that must be rescued. - Set
LimitFailto the number of hostages that can be lost before failure. - Set
ExecutionorCBRNas needed for the mission variant. - If
CBRNis enabled, setCBRNZone. - Set rewards, rating, and optional
TimeLimit. - Sync
FORGE_Module_HostagetoFORGE_Module_Hostages. - Sync
FORGE_Module_HostagetoFORGE_Module_Shooters.
Notes:
- Hostages and shooters are filtered to real units only.
- Hostages are protected immediately on task registration to avoid startup race conditions.
- The hostage timer now waits until the assigned group leader acknowledges the task before counting down.
ExtZoneis checked withinArea, so it must be an area marker.
HVT Task
Use FORGE_Module_HVT when players must capture or eliminate a high-value
target.
Setup:
- Place the HVT unit or units.
- If using capture mode, create an area marker for the extraction zone.
- Place
FORGE_Module_HVT. - Set
TaskID. - Set
CaptureHVTas needed:- enabled for capture/extract
- disabled for kill/eliminate
- If using capture mode, set
ExtZoneto the extraction marker name. - Set
LimitSuccessto the number of HVTs that must be captured or eliminated. - Set
LimitFailif the mission should fail after too many HVT deaths in capture mode. - Set rewards, rating, and optional
TimeLimit. - Sync the HVT module directly to the HVT unit or units.
Notes:
- Capture mode uses
ExtZonewithinArea, so use an area marker. - Elimination mode does not require an extraction zone.
- The HVT timer now waits until the assigned group leader acknowledges the task before counting down.
Defend Task
Use FORGE_Module_Defend when players must hold an area against spawned enemy
waves.
Setup:
- Create an area marker for the defense zone.
- Place
FORGE_Module_Defend. - Set
TaskID. - Set
DefenseZoneto the defense marker name. - Set
DefendTimeto how long the area must be held. - Set
WaveCount. - Set
WaveCooldown. - Set
MinBluforto the minimum number of friendlies required in the zone. - Place one or more enemy groups or units to use as wave templates.
- Sync any unit from each enemy group to the defend module.
- Set rewards, rating, and end-state options.
Notes:
- Synced enemy units are treated as templates. Syncing one unit from a group makes the whole group available as a wave composition.
- If no enemy units are synced, the defend task falls back to default CSAT infantry waves.
- The defend task waits for the required number of BLUFOR to enter the zone before the timer, waves, and empty-zone failure checks begin.
DefenseZonemust be an area marker.
Quick Reference
Use direct syncs:
Attack Task-> target units/vehiclesDestroy Task-> target objects/vehicles/unitsHVT Task-> HVT units
Use grouping modules:
Defuse Task->Explosive Entities,Protected EntitiesDelivery Task->CargoHostage Task->Hostage Entities,Shooter Entities
Use area markers:
DefenseZoneDeliveryZoneExtZoneCBRNZone
Scripted Start Task
Use forge_server_task_fnc_startTask when creating tasks from modules,
mission scripts, or generated mission-manager content. It registers task
entities, creates the BIS task, stores the catalog entry, then dispatches
through forge_server_task_fnc_handler.
[
"attack",
"compound_attack_01",
getPosATL leader1,
"Attack: East Compound",
"Eliminate all hostile forces.",
createHashMapFromArray [["targets", [unit1, unit2, unit3]]],
createHashMapFromArray [
["limitFail", 0],
["limitSuccess", 3],
["prerequisiteTaskIds", ["recon_01"]],
["funds", 50000],
["ratingFail", -10],
["ratingSuccess", 20],
["timeLimit", 900]
],
0,
getPlayerUID player,
"script"
] call forge_server_task_fnc_startTask;
Chained Tasks
Use prerequisiteTaskIds when a task should stay hidden until one or more
other tasks succeed. The task is still registered during mission setup, but it
is stored with locked status, filtered out of CAD, blocked from assignment,
and its task logic does not start until every prerequisite task has completed
with succeeded.
[
"delivery",
"supply_delivery_02",
getMarkerPos "delivery_zone_02",
"Deliver Medical Supplies",
"Move the cargo into the marked delivery area.",
createHashMapFromArray [["cargo", [cargoBox1, cargoBox2]]],
createHashMapFromArray [
["deliveryZone", "delivery_zone_02"],
["limitSuccess", 2],
["prerequisiteTaskIds", ["compound_attack_01"]],
["funds", 30000]
]
] call forge_server_task_fnc_startTask;
Notes:
prerequisiteTaskIdsaccepts either a string or an array of task ID strings.- All prerequisite tasks must succeed before the chained task unlocks.
- If a prerequisite fails or never completes, the chained task remains locked.
Handler Calls
Use forge_server_task_fnc_handler directly when the task entities are already
registered and you want reputation gating plus ownership binding. Create the
BIS task and catalog entry separately if this task should appear in the map
task tab or CAD:
[
"delivery",
["delivery_1", 1, 3, "delivery_zone", 250000, -75, 300, false, false, 900],
250,
getPlayerUID player
] call forge_server_task_fnc_handler;
Direct Task Calls
Direct task function calls still work for mission-authored or server-owned
tasks, but they do not provide a requester UID. Ownership falls back to the
default org. Create the BIS task separately if this task should appear in the
map task tab.
Timer Semantics
Task time limits use 0 for no limit:
- attack
timeLimit - destroy
timeLimit - delivery
timeLimit - hostage
timeLimit - HVT
timeLimit
Positive values are measured in seconds. Do not pass -1 as a no-limit value;
the task runtime treats any non-zero task time limit as active.
Defuse IED timers are different. iedTimer must be greater than 0, because
IEDs are expected to have an active countdown. The Eden defuse module defaults
to 300 seconds.
Defuse Counter
"forge_server" callExtension ["task:defuse:increment", ["task-cache-1"]];
private _count = "forge_server" callExtension ["task:defuse:get", ["task-cache-1"]];
Error Handling
private _payload = _result select 0;
if (_payload find "Error:" == 0) exitWith {
systemChat format ["Task error: %1", _payload];
};