The target selection settings define how targets can be selected.
This documentation covers 2 parts of the target selection – the target selection templates (used by abilities/items to define which targets are available) and the target settings (define how the player can select targets, e.g. via target menu, input keys or mouse/touch controls).
Target Selection Templates #
Target selection templates are set up in Templates > Target Selection Templates.
Abilities and items use target selection templates to define the available targets, e.g. if a single ally or an enemy group is targeted. They’re used either via the default target selections (see below) or using a defined template. They can also set up custom target selection settings.
Target Settings #
Define the general target selection.
The target can be the user itself, an ally or enemy – or just any combatant. It can target a single combatant, the whole group or be used as an AoE (area of effect) spell by targeting None.
You can also include or exclude (or require) the targets to be dead, and allow toggling between allies/enemies and single/group targeting.
E.g. a magic spell could be set up to target a single enemy, but the player can toggle it to target all enemies via an input key.
Custom Targeting #
Custom targeting allows you to sort and filter targets for auto targeting and system-based targeting (e.g. for AI controlled combatants).
See the scripting documentation on custom targeting for more details.
Use Range Settings #
The Use Range defines how far away a target can be from the user. Grid battles can also use complex grid shapes for this.
You can use Battle Range Templates to create reusable range settings in Templates > Battle Range Templates.
Use ranges can also define conditional use ranges, i.e. use different ranges based on defined conditions.
Affect Range Settings #
Combatants that are nearby a target can be affected using the Affect Range. Grid battles can also use complex grid shapes for this.
You can use Battle Range Templates to create reusable range settings in Templates > Battle Range Templates.
Affect ranges can also define conditional affect ranges, i.e. use different ranges based on defined conditions or distance between user and target.
Conditions #
If a target is available can also depend on certain conditions, e.g. a status condition or physical orientation (e.g. only available when at the back of a target).
You can also set up auto target conditions – this can be used by battle menus to automatically select the first combatant fitting the requirements (this still requires the player to accept the selection) or by control maps to automatically select and use a target.
Control Map Targeting #
Using an action via control maps defines specific use/target settings, e.g. to automatically target a combatant that’s below the mouse cursor, use group/individual/auto targeting or no targets at all.
The control map targeting settings allow you to overrule the control map’s settings with a custom setup, tailored to an ability/item’s needs.
Auto Damage Multipliers #
Optionally use automatic damage multipliers when calculating the outcome for a single target or multiple targets. Especially allowing to toggle the target range between single and multi targets will make use of this feature.
E.g. the magic spell from the example above will only do 60% of damage when toggled to target all enemies.
Target Settings #
The target settings are set up in Battles > Target Settings.
There are 2 ways of target selection:
- Action Based
The target is selected after selecting an action (e.g. via battle menu, control maps or shortcut slots).
This is handled by the Target Selection settings (see below), e.g. using a target menu or input keys. - Selected Targets
A combatant has marked/selected targets and automatically uses actions on them.
This is handled by the Group/Individual Targets (see below).
You don’t need to use a target selection, though – e.g. you can also set up your abilities and items to automatically target combatants (Auto Target Conditions) or use a None target range to use raycast targeting or Damager Dealer/Zone components for damaging whatever was hit by a sword, projectile, etc.
Target Selection #
Defines the base target selections, i.e. target menu, target change keys and mouse/touch target selection (via raycasting).
Target Menu #
Defines if a target selection menu is used.
The used UI box is defined by the battle menu that’s currently used by a combatant.
You can also automatically selected a target if only a single target is available for selection.
Default Target Selections #
Defines the default target selection templates that are used for different combinations of enemy/ally/all and single/group/none targeting.
E.g. define the template that’ll be used for single enemy and enemy group target selection.
Item types and ability types can override the default target selections for all items/abilities using the type.
The default target selections are used by abilities/items in their target selection settings – e.g. using the Enemy Single target selection type will use the Enemy Single default target selection template. Abilities and items can also use a defined template or set up custom target selection settings.
Target Change Keys #
Define input keys that can be used to switch between available targets.
These keys are used during the target selection (e.g. when the target menu would be displayed, even when not using a target menu).
Directional Selection #
Use directional keys (up, down, left, right, or horizontal and vertical axes) to select targets based on screen-space directions from the current target (e.g. pressing up selects the nearest target above the current one, in screen space).
If no target is selected, the selection is done based on the screen center.
Target Highlight #
The target selection can highlight the currently selected combatant(s) in different ways.
- Prefab
Use a prefab as a cursor on the combatant.
You can use combatant highlight and target selection cursor prefab components on the prefab to visualize additional information. See this documentation for details. - Fade Color
Change the color of the combatant’s game object.
Supports different color fading options, e.g. blinking or a single flash. - Fade HUD Color
Change the color of the combatant’s HUDs (when they’re set up to allow using it).
Supports different color fading options, e.g. blinking or a single flash. - Schematic
Play schematics when highlighting and stopping the highlight of a combatant.
Mouse/Touch Control #
Allow selecting targets by clicking or touching on their game objects.
This’ll use a raycast from the clicked screen position into the scene. The raycast uses defined layers and maximum distance – i.e. make sure your layer setup is correct, e.g. having combatants on their own layer and only checking that layer (and others that should block target selection).
Default Target Raycast Settings #
When using a None target range, i.e. neither targeting a single combatant or a group of combatants, you can optionally use target raycasts to select a position in the world as targets.
These settings define the default target raycast that’s used, but each target settings template or ability/item can optionally use a custom setup.
Target raycasts offer the following kinds of target selection:
- Game Object
Available target positions are defined by game objects in the scene.
The game objects are searched within use range of the action. - Grid
Available target positions are created by raycasts based on a square or hexagonal grid around the user.
The positions are created within use range of the action. - Position
Raycasts into the scene to find a target position.
Group/Individual Targets #
Group/individual targets allow combatants to have selected/marked targets and automatically use actions on them instead of prompting a target selection.
There are 2 different access ranges for those targets:
- Group Targets
Group targets are available to all combatants of a group. - Individual Targets
Individual targets are only available to the combatant who selected them.
You can add as many different setups for group and individual targets as you want. Each one can be set up to use different targets (e.g. allies or enemies) and be limited to be used by certain abilities or items.
E.g. a combatant can have 1 enemy and 1 ally selected, using attacks on the enemy and supportive actions on the ally.
Group/individual targets can e.g. be used by battle menus, control maps and shortcut HUDs.
Battle AIs can use them as found targets using a Use Combatant node. They can also change the group/individual targets using a Change Selected Target node.
Range #
Limit targets to be within a defined range or the battle range.
Targets #
Define which targets can be selected, e.g. enemies, allies or both, or alive/dead combatants, etc.
Target selection can also be limited to targets currently visible by the camera.
Useable In #
The target selection can be limited to only be available in defined battle systems.
Input Settings #
Like the regular target selection for an action, you can use input keys, directional selection and mouse/touch controls to select targets.
Raycast Targeting #
Optionally select targets via constant raycasting each frame.
Combatants hit by the raycast will be selected as the target.
Line Of Sight #
Optionally check if any other objects are between user and available targets.
This uses a raycast on a defined layer mask – make sure your layer setup in Unity is correct.
Taret Cursor #
Optionally show a cursor prefab on the selected combatant’s game object.
Auto Attack #
Optionally use auto attacks on the selected target.
This is only used if the battle system and combatant are set up to use auto attacks.
Auto attacks are periodically used attacks that don’t impact a combatant’s turn or timebar.
Ability Use #
Optionally limit using abilities on targets to defined abilities and ability types.
Item Use #
Optionally limit using items on targets to defined items and item types.
Target Conditions #
A target can depend on valid conditions, e.g. combatant status or variable conditions.
If the conditions aren’t met, the combatant can’t be targeted.
Target Dialogues #
Optional use target information or confirmation dialogues.
Target Information Dialogue #
Displays status changes that will happen to the user and targets of an ability or item. This is displayed during the target selection and is only an information display and can’t be interacted with.
Uses the Target Information Layout to define which information is displayed (and how).
You can set up multiple dialogues, e.g. displaying different content on parts of the screen.
Target Confirmation Dialogue #
Displays a target confirmation dialogue showing status changes that will happen to the user and targets of an ability or item. This is displayed after selecting a target for an action to confirm if the action should be used on the target. You can still cancel out of the dialogue and return to the target selection.
Uses the Target Information Layout to define which information is displayed (and how).
Target Information Layout #
Defines how status change information on the user and targets of an ability or item will be displayed. This is used by the Target Information Dialogue and Target Confirmation Dialogue and can optionally be overridden there.
The layout offers a variety of text codes to include content information about the status changes. You can also use a HUD as templates to create a more complex layout, e.g. including value bars with the changes highlighted.
The individual text codes for the changes are replaced with their own defined text, e.g. hit chance, critical chance, status value changes and status effect changes. The texts for the changes also use text codes to include their own content information, e.g. name of a status value and change value.