Template_Summoned_Ally
Server/NPC/Roles/_Core/Templates/Template_Summoned_Ally.json, 36.4 KB
Fields
| Field | Type |
|---|---|
Type | string |
StartState | string |
Parameters | object |
IsMemory | boolean |
BreathesInWater | object |
Appearance | object |
DisableDamageGroups | object |
DisableDamageFlock | boolean |
HotbarItems | object |
HotbarSize | number |
OffHandItems | object |
DefaultOffHandSlot | object |
OffHandSlots | number |
DefaultNPCAttitude | string |
DefaultPlayerAttitude | string |
FlockSpawnTypes | object |
FlockAllowedNPC | object |
ApplySeparation | object |
SeparationDistance | number |
SeparationWeight | number |
SeparationDistanceTarget | number |
SeparationNearRadiusTarget | number |
SeparationFarRadiusTarget | number |
BusyStates | array[2] |
KnockbackScale | number |
DeathParticles | object |
DropDeathItemsInstantly | object |
DeathAnimationTime | object |
MotionControllerList | array[1] |
StateTransitions | array[2] |
MaxHealth | object |
InteractionVars | object |
Instructions | array[2] |
NameTranslationKey | object |
Source
{
"Type": "Abstract",
"StartState": "Idle",
"Parameters": {
"Appearance": {
"Value": "Trork_Hunter",
"Description": "Model to be used."
},
"ApplySeparation": {
"Value": true,
"Description": "When set to false, NPCs wont try to avoid each other or player, it can lead to them stacking together, but can help to avoid jerky-like movemenet in enclosed space."
},
"ViewRange": {
"Value": 15,
"Description": "The range from which the target will be seen. If zero, sight will be disabled."
},
"ViewSector": {
"Value": 180,
"Description": "The view sector within which the target needs to be to be seen."
},
"HearingRange": {
"Value": 8,
"Description": "The range from which the target will be heard. If zero, hearing will be disabled."
},
"AbsoluteDetectionRange": {
"Value": 2,
"Description": "The range at which a target is guaranteed to be detected. If zero, abosulte detection will be disabled."
},
"AlertedRange": {
"Value": 30,
"Description": "A range within which the player can be seen/sensed when the NPC is alerted to their presence"
},
"MaxSpeed": {
"Value": 10,
"Description": "Maximum walking speed"
},
"MaxClimbHeight": {
"Value": 3,
"Description": "Max climb height"
},
"MaxDropHeight": {
"Value": 5,
"Description": "Max drop height"
},
"RunThreshold": {
"Value": 0.3,
"Description": "Relative speed at which run animation should be used. A value of 1 disables run animations"
},
"Weapons": {
"Value": [ "Weapon_Sword_Iron" ],
"Description": "NPC Weapons (and other main hand items)."
},
"DefaultHotbarSlot": {
"Value": 0,
"Description": "Default hotbar slot to equip (i.e. weapon)."
},
"OffHand": {
"Value": [ "Furniture_Crude_Torch" ],
"Description": "Off-hand items.",
"TypeHint": "String"
},
"DefaultOffHandSlot": {
"Value": -1,
"Description": "Default off-hand item slot. -1 for nothing."
},
"UseCombatActionEvaluator": {
"Value": false,
"Description": "Whether to use the Combat Action Evaluator via an accompanying CombatConfig. This completely replaces all other combat behavior but still uses movement properties such as strafe durations and move speeds."
},
"Attack": {
"Value": "Root_NPC_Attack_Melee",
"Description": "The attack to use."
},
"AttackDistance": {
"Value": 2,
"Description": "The distance at which an NPC will execute attacks"
},
"DesiredAttackDistanceRange": {
"Value": [ 1.5, 1.5 ],
"Description": "The distance within which the NPC wants to be from its target while attacking. The max value should be lower than AttackDistance."
},
"AttackPauseRange": {
"Value": [ 1.5, 2 ],
"Description": "The range for absolute minimum time before an NPC can execute a second attack (or block)."
},
"CombatRelativeTurnSpeed": {
"Value": 1.5,
"Description": "Modifier that decides turn speed difference in combat."
},
"CombatBehaviorDistance": {
"Value": 5,
"Description": "The distance within which to switch from smart chasing to combat-oriented movement behavior."
},
"CombatDirectWeight": {
"Value": 10,
"Description": "Weight for the direct combat movement behavior (i.e. just going straight at the target, maintaining a close distance and attacking. Set to 0 to disable."
},
"CombatAlwaysMovingWeight": {
"Value": 0,
"Description": "Weight for the combat movement behavior where the NPC will always charge at you while attacking. Set to 0 to disable."
},
"CombatStrafeWeight": {
"Value": 10,
"Description": "Weight for the combat strafing movement behavior. Set to 0 to disable."
},
"CombatStrafingDurationRange": {
"Value": [ 1, 1 ],
"Description": "How long to strafe for when in the combat strafing movement behavior. Only applies if CombatStrafeWeight is greater than 0."
},
"CombatStrafingFrequencyRange": {
"Value": [ 2, 2 ],
"Description": "How frequently to strafe when in the combat strafing movement behavior. Only applies if CombatStrafeWeight is greater than 0."
},
"CombatAttackPreDelay": {
"Value": [ 0.2, 0.2 ],
"Description": "The time delay range before the NPC performs an attack, provided it's in attack range."
},
"CombatAttackPostDelay": {
"Value": [ 0.2, 0.2 ],
"Description": "The time delay range after the NPC performs an attack, provided it's in attack range."
},
"CombatBackOffAfterAttack": {
"Value": true,
"Description": "Whether to back off after performing an attack."
},
"CombatBackOffDistanceRange": {
"Value": [ 4, 4 ],
"Description": "How far to back off after performing an attack. Max should be lower than the CombatBehaviorDistance."
},
"CombatBackOffDurationRange": {
"Value": [ 2, 3 ],
"Description": "How long to back off for after performing an attack."
},
"BlockAbility": {
"Value": "Shield_Block",
"Description": "The interaction to use for blocking when backing away. Set to empty to disable blocking."
},
"BlockProbability": {
"Value": 50,
"Description": "The probability this NPC will block when backing away if a BlockAbility is set."
},
"CombatFleeIfTooCloseDistance": {
"Value": 0,
"Description": "In combat, if the target gets within this distance for a certain amount of time, the NPC will attempt to flee to a safe distance instead of simply backing away. Set to 0 to disable behavior."
},
"AdditionalCombatBehaviorMacroElement": {
"Value": "Component_Instruction_Null",
"Description": "An optional macro element for supplying more bespoke combat movement behavior. Weight for the behavior must be internally defined in the macro element."
},
"TargetSwitchTimer": {
"Value": [ 2, 2 ],
"Description": "Minimum time the NPC will be locked onto a single target before switching"
},
"TargetRange": {
"Value": 4,
"Description": "The distance the target needs to be within to maintain priority over other targets while in combat"
},
"ChaseRelativeSpeed": {
"Value": 0.67,
"Description": "Relative chasing speed when pursuing a target."
},
"CombatMovingRelativeSpeed": {
"Value": 0.6,
"Description": "Relative speed to use during combat specific movement (e.g. to achieve slower strafing)."
},
"CombatBackwardsRelativeSpeed": {
"Value": 0.3,
"Description": "Relative speed to use during combat when backing away from target."
},
"AimingHitProbability": {
"Value": 0.9,
"Description": "Hit probability when aiming. Mostly affects ranged attacks."
},
"AimingSpread": {
"Value": 0,
"Description": "Spread when aiming. Mostly affects ranged attacks."
},
"FlockArray": {
"Value": [ ],
"TypeHint": "String",
"Description": "Array containing NPCs for this flock type."
},
"DisableDamageGroups": {
"Value": [ "Self" ],
"Description": "Groups not to take damage from."
},
"MaxHealth": {
"Value": 100,
"Description": "Max health for the NPC."
},
"BreathesInWater": {
"Value": false,
"Description": "Whether this NPC can breathe underwater."
},
"NameTranslationKey": {
"Value": "server.npcRoles.Template.name",
"Description": "Translation key for NPC name display"
},
"DespawnTimer": {
"Value": 300,
"Description": "How long the NPC will remain before it despawns in seconds."
},
"SummonerLeashRange": {
"Value": 30,
"Description": "How far away from the summoner the NPC is allowed to be while in combat before trying to return to the summoner's position."
},
"DeathParticles": {
"Value": "Effect_Death_Medium",
"Description": "The particle system that spawns when the NPC's corpse disappears."
},
"DropDeathItemsInstantly": {
"Value": false,
"Description": "Whether the NPC's drop list should be executed when the NPC dies. If set to false, items drop when the corpse disappears."
},
"DeathAnimationTime": {
"Value": 1.5,
"Description": "The time it takes for this NPC's corpse to disappear."
}
},
"IsMemory": false,
"BreathesInWater": { "Compute": "BreathesInWater" },
"Appearance": { "Compute": "Appearance" },
"DisableDamageGroups": { "Compute": "DisableDamageGroups" },
"DisableDamageFlock": true,
"HotbarItems": { "Compute": "Weapons" },
"HotbarSize": 3,
"OffHandItems": { "Compute": "OffHand" },
"DefaultOffHandSlot": { "Compute": "DefaultOffHandSlot" },
"OffHandSlots": 2,
"DefaultNPCAttitude": "Ignore",
"DefaultPlayerAttitude": "Ignore",
"FlockSpawnTypes": { "Compute": "FlockArray" },
"FlockAllowedNPC": { "Compute": "FlockArray" },
"ApplySeparation": { "Compute": "ApplySeparation" },
"SeparationDistance": 2,
"SeparationWeight": 1,
"SeparationDistanceTarget": 0.5,
"SeparationNearRadiusTarget": 2,
"SeparationFarRadiusTarget": 7,
"BusyStates": [ "Idle", "Combat" ],
"KnockbackScale": 0.5,
"DeathParticles": { "Compute": "DeathParticles" },
"DropDeathItemsInstantly": { "Compute": "DropDeathItemsInstantly" },
"DeathAnimationTime": { "Compute": "DeathAnimationTime" },
"MotionControllerList": [
{
"Type": "Walk",
"MaxWalkSpeed": { "Compute": "MaxSpeed" },
"Gravity": 10,
"RunThreshold": { "Compute": "RunThreshold" },
"MaxFallSpeed": 15,
"MaxRotationSpeed": 360,
"Acceleration": 10,
"MaxClimbHeight": { "Compute": "MaxClimbHeight" },
"MaxDropHeight": { "Compute": "MaxDropHeight" }
}
],
"StateTransitions": [
{
"$Comment": "Always clear target and reset instructions when going back to idle.",
"States": [
{
"To": [ "Idle" ],
"From": [ ]
}
],
"Actions": [
{
"Type": "ReleaseTarget"
},
{
"Type": "ResetInstructions"
}
]
},
{
"$Comment": "Always equip main weapon when going back to Idle or switching to combat.",
"States": [
{
"To": [ "Idle", "Combat" ],
"From": [ ]
}
],
"Actions": [
{
"Type": "Inventory",
"Operation": "EquipHotbar",
"UseTarget": false,
"Slot": { "Compute": "DefaultHotbarSlot" }
}
]
}
],
"MaxHealth": { "Compute": "MaxHealth" },
"InteractionVars": {
"Melee_Damage": {
"Interactions": [
{
"$Comment": "When NPC overrides the InteractionVars, this info is not applicable anymore",
"Parent": "NPC_Attack_Melee_Damage",
"DamageCalculator": {
"Type": "Absolute",
"BaseDamage": {
"Physical": 10
},
"RandomPercentageModifier": 0.1
}
}
]
}
},
"Instructions": [
{
"Continue": true,
"Instructions": [
{
"Continue": true,
"Sensor": {
"Type": "Any",
"Once": true
},
"Actions": [
{
"Type": "TimerStart",
"Name": "DespawnTimer",
"StartValueRange": { "Compute": "makeRange(DespawnTimer)" },
"RestartValueRange": { "Compute": "makeRange(DespawnTimer)" }
}
]
},
{
"Continue": true,
"Sensor": {
"Type": "Self",
"Filters": [
{
"Type": "Flock",
"FlockStatus": "NotMember"
}
]
},
"Instructions": [
{
"Sensor": {
"Type": "Player",
"Range": 20
},
"Actions": [
{
"Type": "JoinFlock",
"ForceJoin": true
}
]
}
]
},
{
"Sensor": {
"Type": "Or",
"Sensors": [
{
"Type": "Timer",
"Name": "DespawnTimer",
"State": "Stopped"
},
{
"Type": "Self",
"Filters": [
{
"Type": "Flock",
"FlockPlayerStatus": "NotMember"
}
]
}
]
},
"Actions": [
{
"Type": "Despawn"
}
]
},
{
"Continue": true,
"Sensor": {
"Type": "Or",
"Sensors": [
{
"Type": "InflictedDamage",
"Target": "FlockLeader"
},
{
"Type": "FlockCombatDamage",
"LeaderOnly": true
}
]
},
"Actions": [
{
"Type": "OverrideAttitude",
"Attitude": "Hostile",
"Duration": 360
}
]
},
{
"$Comment": "Respond to damage taken by or dealt by the summoner as long as not already engaged with a target.",
"Sensor": {
"Type": "And",
"Sensors": [
{
"Type": "Not",
"Sensor": {
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" }
}
},
{
"Type": "Or",
"Sensors": [
{
"Type": "InflictedDamage",
"Target": "FlockLeader"
},
{
"Type": "FlockCombatDamage",
"LeaderOnly": true
}
]
}
]
},
"Actions": [
{
"Type": "SetMarkedTarget"
},
{
"Type": "State",
"State": "Combat"
}
]
}
]
},
{
"Instructions": [
{
"Sensor": {
"Type": "State",
"State": "Idle"
},
"Instructions": [
{
"Reference": "Component_Instruction_Damage_Check",
"Modify": {
"_ExportStates": [ "Combat.Override", "Idle" ],
"AlertedRange": { "Compute": "AlertedRange" }
}
},
{
"$Comment": "Follow the leader.",
"Enabled": { "Compute": "!isEmptyStringArray(FlockArray)" },
"Sensor": {
"Type": "And",
"Sensors": [
{
"Type": "FlockLeader"
},
{
"Type": "Self",
"Filters": [
{
"Type": "Flock",
"FlockStatus": "Follower"
}
]
}
]
},
"HeadMotion": {
"Type": "Watch"
},
"BodyMotion": {
"Type": "Seek",
"SlowDownDistance": 7,
"StopDistance": 4
}
}
]
},
{
"Enabled": { "Compute": "UseCombatActionEvaluator" },
"$Comment": "Combat action evaluator logic. Replaces other combat state if enabled.",
"Sensor": {
"Type": "State",
"State": "Combat"
},
"Instructions": [
{
"TreeMode": true,
"Instructions": [
{
"Continue": true,
"Sensor": {
"Type": "FlockLeader"
},
"Actions": [
{
"Type": "SetMarkedTarget",
"TargetSlot": "LeaderSlot"
}
]
},
{
"Sensor": {
"Type": "Not",
"Sensor": {
"Type": "Target",
"TargetSlot": "LeaderSlot",
"Range": { "Compute": "SummonerLeashRange" }
}
},
"Actions": [
{
"Type": "State",
"State": "Idle"
}
]
}
]
},
{
"Continue": true,
"Sensor": {
"Type": "State",
"State": ".Override"
},
"Instructions": [
{
"Continue": true,
"Sensor": {
"Type": "Target",
"Range": { "Compute": "AlertedRange" }
},
"Actions": [
{
"Type": "OverrideAttitude",
"Attitude": "Hostile",
"Duration": 360
}
]
},
{
"Actions": [
{
"Type": "State",
"State": "Combat"
}
]
}
]
},
{
"Sensor": {
"Type": "Or",
"Sensors": [
{
"Reference": "Component_Sensor_Standard_Detection",
"Modify": {
"ViewRange": { "Compute": "ViewRange" },
"ViewSector": { "Compute": "ViewSector" },
"HearingRange": { "Compute": "HearingRange" },
"AbsoluteDetectionRange": { "Compute": "AbsoluteDetectionRange" },
"Attitudes": [ "Hostile" ]
}
},
{
"Type": "HasHostileTargetMemory"
}
]
},
"Instructions": [
{
"$Comment": "Store the CAE target in the regular marked target slot so it works with the leash and chase components.",
"Continue": true,
"Sensor": {
"Type": "Or",
"Sensors": [
{
"Type": "CombatActionEvaluator",
"TargetInRange": true
},
{
"Type": "CombatActionEvaluator",
"TargetInRange": false
}
]
},
"Actions": [
{
"Type": "SetMarkedTarget"
}
]
},
{
"Continue": true,
"Sensor": {
"Type": "Damage",
"Combat": true
},
"Actions": [
{
"Type": "AddToHostileTargetMemory"
}
]
},
{
"TreeMode": true,
"Sensor": {
"Type": "Or",
"Sensors": [
{
"Type": "State",
"State": ".Melee",
"IgnoreMissingSetState": true
},
{
"Type": "State",
"State": ".Ranged",
"IgnoreMissingSetState": true
},
{
"Type": "State",
"State": ".Default"
}
]
},
"Instructions": [
{
"Sensor": {
"Type": "CombatActionEvaluator",
"TargetInRange": true
},
"HeadMotion": {
"Type": "Aim",
"HitProbability": { "Compute": "AimingHitProbability" },
"Deflection": true,
"Spread": { "Compute": "AimingSpread" }
},
"BodyMotion": {
"Type": "MaintainDistance",
"DesiredDistanceRange": { "Compute": "DesiredAttackDistanceRange" },
"MoveThreshold": 0.2,
"RelativeForwardsSpeed": { "Compute": "CombatMovingRelativeSpeed" },
"RelativeBackwardsSpeed": { "Compute": "CombatBackwardsRelativeSpeed" }
},
"Actions": [
{
"Type": "CombatAbility"
}
]
}
]
},
{
"TreeMode": true,
"Sensor": {
"Type": "State",
"State": ".Strafe",
"IgnoreMissingSetState": true
},
"Instructions": [
{
"Sensor": {
"Type": "CombatActionEvaluator",
"TargetInRange": true
},
"HeadMotion": {
"Type": "Aim",
"HitProbability": { "Compute": "AimingHitProbability" },
"Deflection": true,
"Spread": { "Compute": "AimingSpread" }
},
"BodyMotion": {
"Type": "MaintainDistance",
"DesiredDistanceRange": { "Compute": "DesiredAttackDistanceRange" },
"MoveThreshold": 0.2,
"StrafingDurationRange": { "Compute": "CombatStrafingDurationRange" },
"StrafingFrequencyRange": { "Compute": "CombatStrafingFrequencyRange" },
"RelativeForwardsSpeed": { "Compute": "CombatMovingRelativeSpeed" },
"RelativeBackwardsSpeed": { "Compute": "CombatBackwardsRelativeSpeed" }
},
"Actions": [
{
"Type": "CombatAbility"
}
]
}
]
},
{
"Reference": "Component_Instruction_Intelligent_Chase",
"Modify": {
"_ExportStates": [ "Idle", "Idle", "Idle" ],
"ViewRange": { "Compute": "AlertedRange" },
"HearingRange": { "Compute": "HearingRange" },
"RelativeSpeed": { "Compute": "ChaseRelativeSpeed" }
}
}
]
},
{
"Actions": [
{
"Type": "State",
"State": "Idle"
}
]
}
]
},
{
"Enabled": { "Compute": "!UseCombatActionEvaluator" },
"Sensor": {
"Type": "State",
"State": "Combat"
},
"Instructions": [
{
"TreeMode": true,
"Instructions": [
{
"Continue": true,
"Sensor": {
"Type": "FlockLeader"
},
"Actions": [
{
"Type": "SetMarkedTarget",
"TargetSlot": "LeaderSlot"
}
]
},
{
"Sensor": {
"Type": "Not",
"Sensor": {
"Type": "Target",
"TargetSlot": "LeaderSlot",
"Range": { "Compute": "SummonerLeashRange" }
}
},
"Actions": [
{
"Type": "State",
"State": "Idle"
}
]
}
]
},
{
"Continue": true,
"Sensor": {
"Type": "State",
"State": ".Override"
},
"Instructions": [
{
"Continue": true,
"Sensor": {
"Type": "Target",
"Range": { "Compute": "AlertedRange" }
},
"Actions": [
{
"Type": "OverrideAttitude",
"Attitude": "Hostile",
"Duration": 360
}
]
},
{
"Actions": [
{
"Type": "State",
"State": "Combat"
}
]
}
]
},
{
"Sensor": {
"Type": "State",
"State": ".Chase"
},
"Instructions": [
{
"Sensor": {
"Type": "Target",
"Range": { "Compute": "AttackDistance" },
"Filters": [
{
"Type": "LineOfSight"
}
]
},
"Actions": [
{
"Type": "State",
"State": ".Default"
}
]
},
{
"Reference": "Component_Instruction_Intelligent_Chase",
"Modify": {
"_ExportStates": [ "Idle", "Idle", "Idle" ],
"ViewRange": { "Compute": "AlertedRange" },
"HearingRange": { "Compute": "HearingRange" },
"RelativeSpeed": { "Compute": "ChaseRelativeSpeed" }
}
}
]
},
{
"Reference": "Component_Instruction_Combat_Retreat",
"Modify": {
"CombatFleeIfTooCloseDistance": { "Compute": "CombatFleeIfTooCloseDistance" },
"AttackDistance": { "Compute": "AttackDistance" }
}
},
{
"Reference": "Component_Instruction_Combat_Target_Swap",
"Modify": {
"TargetSwitchTimer": { "Compute": "TargetSwitchTimer" },
"TargetRange": { "Compute": "TargetRange" }
}
},
{
"Continue": true,
"Sensor": {
"Type": "Target",
"Range": { "Compute": "AttackDistance" },
"Filters": [
{
"Type": "LineOfSight"
}
]
},
"ActionsBlocking": true,
"Actions": [
{
"$Comment": "TODO: Brief delay before attack so NPC can stop moving. Do we need it?",
"Type": "Timeout",
"Delay": { "Compute": "CombatAttackPreDelay" }
},
{
"Type": "Attack",
"Attack": { "Compute": "Attack" },
"AttackPauseRange": { "Compute": "AttackPauseRange" }
},
{
"$Comment": "Brief delay to prevent the NPC potentially strafing/backing away and missing the shot.",
"Type": "Timeout",
"Delay": { "Compute": "CombatAttackPostDelay" }
},
{
"Type": "TimerStart",
"Name": "Combat_Back_Off",
"StartValueRange": { "Compute": "CombatBackOffDurationRange" },
"RestartValueRange": { "Compute": "CombatBackOffDurationRange" }
},
{
"Type": "TimerRestart",
"Name": "Combat_Back_Off"
}
],
"HeadMotion": {
"Type": "Aim",
"RelativeTurnSpeed": { "Compute": "CombatRelativeTurnSpeed" },
"HitProbability": { "Compute": "AimingHitProbability" },
"Deflection": true,
"Spread": { "Compute": "AimingSpread" }
}
},
{
"Continue": true,
"Sensor": {
"Type": "And",
"Sensors": [
{
"Type": "Not",
"Sensor": {
"Type": "Target",
"Range": { "Compute": "AttackDistance" }
}
},
{
"Type": "Or",
"Sensors": [
{
"Type": "Nav",
"NavStates": [ "Defer" ],
"ThrottleDuration": 3
},
{
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" },
"Filters": [
{
"Type": "Not",
"Filter": {
"Type": "HeightDifference",
"HeightDifference": [ -2, 2 ]
}
}
]
}
]
}
]
},
"ActionsBlocking": true,
"Actions": [
{
"Type": "Timeout",
"Delay": [ 5, 5 ]
},
{
"Type": "State",
"State": "Idle"
}
]
},
{
"Reference": "Component_Instruction_Combat_Back_Off",
"Modify": {
"TimerName": "Combat_Back_Off",
"CombatBackOffAfterAttack": { "Compute": "CombatBackOffAfterAttack" },
"CombatBackOffDistanceRange": { "Compute": "CombatBackOffDistanceRange" },
"CombatBackOffDurationRange": { "Compute": "CombatBackOffDurationRange" },
"BlockAbility": { "Compute": "BlockAbility" },
"BlockProbability": { "Compute": "BlockProbability" },
"CombatStrafingDurationRange": { "Compute": "CombatStrafingDurationRange" },
"CombatStrafingFrequencyRange": { "Compute": "CombatStrafingFrequencyRange" },
"CombatBehaviorDistance": { "Compute": "CombatBehaviorDistance" },
"CombatMovingRelativeSpeed": { "Compute": "CombatMovingRelativeSpeed" }
}
},
{
"Sensor": {
"Type": "And",
"Sensors": [
{
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" }
},
{
"Type": "Eval",
"Expression": "blocked"
},
{
"Type": "Not",
"Sensor": {
"Type": "IsBackingAway"
}
}
]
},
"ActionsBlocking": true,
"Actions": [
{
"Type": "Timeout",
"Delay": [ 0.5, 0.5 ]
},
{
"Type": "State",
"State": ".Chase"
}
]
},
{
"$Comment": "Execute combat-oriented movement.",
"Type": "Random",
"ExecuteFor": [ 5, 5 ],
"Sensor": {
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" }
},
"Instructions": [
{
"$Comment": "Strafe around the target while fighting. - this strafes to a very short distance, changing it to maintain > attack distance will lead to npc never attacking",
"Enabled": { "Compute": "CombatStrafeWeight > 0" },
"Weight": { "Compute": "CombatStrafeWeight" },
"Sensor": {
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" }
},
"HeadMotion": {
"Type": "Watch"
},
"BodyMotion": {
"Type": "MaintainDistance",
"DesiredDistanceRange": { "Compute": "DesiredAttackDistanceRange" },
"StrafingDurationRange": { "Compute": "CombatStrafingDurationRange" },
"StrafingFrequencyRange": { "Compute": "CombatStrafingFrequencyRange" },
"RelativeForwardsSpeed": { "Compute": "CombatMovingRelativeSpeed" },
"RelativeBackwardsSpeed": { "Compute": "CombatBackwardsRelativeSpeed" }
}
},
{
"$Comment": "Attack the target without strafing.",
"Enabled": { "Compute": "CombatDirectWeight > 0" },
"Weight": { "Compute": "CombatDirectWeight" },
"Sensor": {
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" }
},
"BodyMotion": {
"Type": "MaintainDistance",
"DesiredDistanceRange": { "Compute": "DesiredAttackDistanceRange" },
"StrafingDurationRange": [ 0, 0 ],
"RelativeForwardsSpeed": { "Compute": "ChaseRelativeSpeed" },
"RelativeBackwardsSpeed": { "Compute": "CombatBackwardsRelativeSpeed" }
}
},
{
"$Comment": "Always charge at the target while attacking.",
"Enabled": { "Compute": "CombatAlwaysMovingWeight > 0" },
"Weight": { "Compute": "CombatAlwaysMovingWeight" },
"Sensor": {
"Type": "Target",
"Range": { "Compute": "CombatBehaviorDistance" }
},
"HeadMotion": {
"Type": "Aim",
"RelativeTurnSpeed": { "Compute": "CombatRelativeTurnSpeed" },
"HitProbability": { "Compute": "AimingHitProbability" },
"Deflection": true,
"Spread": { "Compute": "AimingSpread" }
},
"BodyMotion": {
"Type": "Seek",
"RelativeSpeed": { "Compute": "ChaseRelativeSpeed" },
"StopDistance": 2,
"SlowDownDistance": { "Compute": "AttackDistance" }
}
},
{
"Reference": { "Compute": "AdditionalCombatBehaviorMacroElement" },
"Interfaces": [ "Hytale.Instruction.Null", "Hytale.Instruction.CombatBehavior" ],
"Modify": {
"_InterfaceParameters": {
"Hytale.Instruction.CombatBehavior": {
"CombatBehaviorDistance": { "Compute": "CombatBehaviorDistance" },
"ChaseRelativeSpeed": { "Compute": "ChaseRelativeSpeed" }
}
}
}
}
]
},
{
"Actions": [
{
"Type": "State",
"State": ".Chase"
}
]
}
]
}
]
}
],
"NameTranslationKey": { "Compute": "NameTranslationKey" }
}