HytaleDocs
NPCDecisionMaking

CombatActions

Asset path: Server/NPC/DecisionMaking/CombatActions/*.json

This object has different properties depending on the value of the Type property.

All possible options are listed below:

Ability

A combat action which executes an attack or ability by triggering an Interaction.

AbilityCombatAction with the following properties:

KeyTypeDescription
TypeConstant value: Ability

This field controls the type, it must be set to the constant value "Ability" to function as this type.

ParentString

When set this asset will inherit properties from the named asset.

When inheriting from another AbilityCombatAction most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

Description(Nullable) String

A friendly description of this option's outcome.

ConditionsArray of the type: Either String or Condition

Reference to a Condition asset

The list of conditions for evaluating this option's utility.

WeightCoefficientNumber defaults to: 1.0

An additional weighted ranking that can be used to greatly increase the utility of this option.

TargetAny one of the following String:
Target
NameDescription
"Self"

Action targets self.

"Hostile"

Action targets any hostile target.

"Friendly"

Action targets any friendly target.

The target type this action applies to.

PostExecuteDistanceRange(Nullable) Array of Number

An optional range the NPC will try to maintain from the target after executing the combat action.

AbilityEither String or RootInteraction

Reference to a RootInteraction asset

The interaction (ability) to use.

AbilityType(Nullable) Any one of the following String (defaults to Primary):
AbilityType
NameDescription
"Primary"

Use primary attack.

"Secondary"

Use secondary attack.

The ability type.

ChargeFor(Nullable) Either Number defaults to: 0.0 or String that matches the pattern: ^(-?Infinity|NaN)$

How long to charge the ability for before using it.

AttackDistanceRangeArray of Number

The range at which the NPC needs to be from the target to execute the attack.

WeaponSlotInteger defaults to: 0

The weapon (hotbar) slot to switch to for this attack.

OffhandSlotInteger defaults to: -1

The off-hand slot to switch to for this attack. -1 set to no off-hand equipped.

FailureTimeout(Nullable) Either Number defaults to: 10.0 or String that matches the pattern: ^(-?Infinity|NaN)$

How long to try and run the action before giving up if it can't be completed in time.

SubState(Nullable) String that matches the pattern: [^\s] and is at least 1 characters long

An optional substate to switch to when selecting this combat action to modify motion or other available actions.

InteractionVars(Nullable) Map of the following:
Map
KeyType
any StringEither String or RootInteraction

Reference to a RootInteraction asset

Interaction vars to modify the values in the interaction itself.

DamageFriendliesBoolean defaults to: false

Whether or not this ability should be able to damage friendly targets.

RequireAimingBoolean defaults to: true

Whether or not this ability needs to be aimed at the target.

Positioning(Nullable) Any one of the following String (defaults to Any):
Positioning
NameDescription
"Any"

Don't care about positioning.

"Front"

Try to be in front of the target.

"Behind"

Try to be behind the target.

"Flank"

Try to be on the target's flank.

Where the NPC should try to position itself relative to the target's facing direction.

PositionFirstBoolean defaults to: false

Whether the NPC should try to reach the correct positioning before executing the ability.

ChargeDistanceNumber defaults to: 0.0

If this is a charge attack, the distance the charge will cover.

Tags(Nullable) Map of the following:
Map
KeyType
any StringArray of String

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

SelectBasicAttackTarget

A combat action which simply selects a target and sets up distances for use with substates that only contain basic attacks.

BasicAttackTargetCombatAction with the following properties:

KeyTypeDescription
TypeConstant value: SelectBasicAttackTarget

This field controls the type, it must be set to the constant value "SelectBasicAttackTarget" to function as this type.

ParentString

When set this asset will inherit properties from the named asset.

When inheriting from another BasicAttackTargetCombatAction most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

Description(Nullable) String

A friendly description of this option's outcome.

ConditionsArray of the type: Either String or Condition

Reference to a Condition asset

The list of conditions for evaluating this option's utility.

WeightCoefficientNumber defaults to: 1.0

An additional weighted ranking that can be used to greatly increase the utility of this option.

WeaponSlotInteger defaults to: 0

The weapon (hotbar) slot to switch to for basic attacks.

OffhandSlotInteger defaults to: 0

The off-hand slot to switch to for basic attacks. -1 set to no off-hand equipped.

Tags(Nullable) Map of the following:
Map
KeyType
any StringArray of String

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

State

A combat action which switches the NPCs state. Using substate only will switch between combat substates, whereas including the main state can be used to transition out of combat.

StateCombatAction with the following properties:

KeyTypeDescription
TypeConstant value: State

This field controls the type, it must be set to the constant value "State" to function as this type.

ParentString

When set this asset will inherit properties from the named asset.

When inheriting from another StateCombatAction most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

Description(Nullable) String

A friendly description of this option's outcome.

ConditionsArray of the type: Either String or Condition

Reference to a Condition asset

The list of conditions for evaluating this option's utility.

WeightCoefficientNumber defaults to: 1.0

An additional weighted ranking that can be used to greatly increase the utility of this option.

TargetAny one of the following String:
Target
NameDescription
"Self"

Action targets self.

"Hostile"

Action targets any hostile target.

"Friendly"

Action targets any friendly target.

The target type this action applies to.

PostExecuteDistanceRange(Nullable) Array of Number

An optional range the NPC will try to maintain from the target after executing the combat action.

StateString that matches the pattern: [^\s] and is at least 1 characters long

The main state name.

SubState(Nullable) String

The substate name.

Tags(Nullable) Map of the following:
Map
KeyType
any StringArray of String

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

On this page