..
2026-05-15 18:50:28 -05:00

Task Objects

This folder documents the active createHashMapObject task instances and entity controllers. Their source lives under functions/objects/, and each class is initialized directly from XEH_preInit.sqf.

Current task objects:

  • TaskInstanceBaseClass
  • EntityControllerBaseClass
  • TargetEntityController
  • ShooterEntityController
  • AttackTaskBaseClass
  • HostageTaskBaseClass
  • HostageEntityController
  • HVTEntityController
  • CargoEntityController
  • ProtectedEntityController
  • IEDEntityController
  • DefenseEnemyController
  • DefuseTaskBaseClass
  • DestroyTaskBaseClass
  • DeliveryTaskBaseClass
  • HVTTaskBaseClass
  • DefendTaskBaseClass

Source entry points:

Purpose:

  • keep per-task instance state in task objects
  • keep per-entity behavior in controller objects
  • separate state ownership from long procedural function flows
  • keep shared lifecycle and reward initialization in TaskInstanceBaseClass
  • so concrete task objects only define task-specific state
  • keep heartbeat-style AI/object behavior in separate entity controllers instead of mixing it into task outcome loops

Important design choice:

  • these objects use explicit markSucceeded, markFailed, and cleanup methods instead of relying on #delete
  • task loops that use sleep or waitUntil with sleep must be started from scheduled code, typically via spawn

That is intentional. createHashMapObject destructor timing is reference-based, so #delete is not a good primitive for mission-critical task completion or reward flow.