INSODIMENSIONStudios
TargetingGuides

Extending Tasks with Blueprint

Create custom targeting tasks by inheriting from Agentic task classes

Extending Tasks with Blueprint

Create custom targeting tasks by inheriting from Agentic task classes and adding your own logic in Blueprint.

When to Extend

Extend tasks when you need:

  • Dynamic radius based on weapon range, character stats, or abilities
  • Custom filtering logic specific to your game
  • Game-specific sorting that considers your own data

Available Base Classes

ClassPurpose
AgenticSelectionTask_AOEArea selection with dynamic radius support
AgenticSelectionTask_TraceLine/sweep trace selection
AgenticFilterTask_TargetableFilter by IAgenticTargetable interface
AgenticFilterTask_ValidationDistanceDistance filter for validation phase
AgenticFilterTask_ViewAngleView angle filtering
AgenticSortTask_DistanceSort by distance
AgenticSortTask_ScreenCenterSort by screen center proximity
AgenticWeightedSortTaskWeighted multi-criteria sorting

Example: Dynamic Radius from Weapon

This example creates an AOE selection task that gets its radius from the character's equipped weapon at runtime.

Step 1: Create Blueprint Class

  1. Content Browser → Right-click → Blueprint Class
  2. In "Pick Parent Class", search for AgenticSelectionTask_AOE
  3. Select it and click Select

Creating a Blueprint Agentic Task

  1. Name it BP_SelectionTask_AOE_WeaponRange

Step 2: Enable Dynamic Radius (AOE Example)

Steps 2-3 are specific to AgenticSelectionTask_AOE. Other task types have their own overridable functions - check the Overridable Functions list in your Blueprint for available extension points.

  1. Open your new Blueprint
  2. In Class Defaults, find the Agentic | Dynamic section
  3. Enable Use Dynamic Radius (check the box)

Step 3: Override GetDynamicRadius (AOE Example)

  1. In the Functions panel, find Overridable Functions
  2. Click OverrideGet Dynamic Radius
  3. Implement the function to return your weapon's range:

Dynamic Radius Blueprint Example

Blueprint Logic:

  1. Get Targeting Subsystem (from self)
  2. Get Targeting Source Context (pass Targeting Handle)
  3. Break the struct to get Source Actor
  4. Cast to your character/interface and get weapon range
  5. Return the radius value (in Unreal units, e.g., 1500 = 15m)

Step 4: Register Task Tag (Optional)

Steps 4-5 are optional for basic usage. You can directly select your BP task in presets without registration. However, registration is recommended for AI tools and external editors that work with DataTables.

Add a tag for your task in the DT_TargetingTags DataTable:

  1. Open /AgenticTargeting/Data/Targeting/DT_TargetingTags
  2. Add a new row with:
    • Row Name: TargetingTaskDynamicAOE (or your preferred name)
    • Tag: Agentic.Targeting.Task.DynamicAOE
    • Dev Comment: Description of what your task does

Registering Task Tag

  1. Export CSV (optional but recommended): Right-click DataTable → Export as CSV → overwrite DT_TargetingTags.csv. This keeps the CSV in sync for AI tools or external editors.

Step 5: Register Task Class (Optional)

Map your tag to the Blueprint class in DT_TargetingTasks DataTable:

  1. Open /AgenticTargeting/Data/Targeting/DT_TargetingTasks
  2. Add a new row with:
    • Row Name: DynamicAOE
    • Task Tag: Agentic.Targeting.Task.DynamicAOE
    • Task Class: Select your BP_SelectionTask_AOE_WeaponRange
    • Description: What the task does

Registering Task Class

  1. Export JSON (optional but recommended): Right-click DataTable → Export as JSON → overwrite DT_TargetingTasks.json. This keeps the JSON in sync for AI tools or external editors.

Step 6: Use Your Custom Task

Reference your Blueprint task in a preset:

  1. Create or edit a Targeting Preset Data Asset
  2. In the Tasks array, select your custom task from the dropdown

Selecting Task in Preset

  1. Update DataTable (optional but recommended): Right-click your preset → Update DataTable. This syncs all changes back to DT_TargetingPresets, including the new task references and all task parameters. Essential for AI workflows and external tools.

Update DataTable

The DataTable now contains all task params including bUseDynamicRadius: true:

DataTable Synced

  1. The radius will now be determined at runtime from your weapon

Getting Source Actor from Handle

In any overridden function that receives FTargetingRequestHandle, you can get the source actor:

Targeting Handle → Get Targeting Subsystem → Get Targeting Source Context → Break → Source Actor

The FTargetingSourceContext contains:

  • Source Actor - The character/pawn doing the targeting
  • Source Location - World position
  • Instigator Actor - Who triggered the request (often same as Source)

Tips

  • Return <= 0 from GetDynamicRadius to fall back to the configured Radius property
  • The bSkipIfResultsExist flag (default true) skips selection if results already exist - useful for re-sorting
  • You can also override GetSourceLocation and GetSourceOffset in selection tasks

Included Example

The plugin includes a ready-to-use example:

Location: /AgenticTargeting/Data/Targeting/BP_SelectionTask_AOE_DynamicRadius

This Blueprint demonstrates the pattern of getting radius from the source actor's extent.