Overrides the AI's current ability and attack distance so the ability can be used when called (given within distance).
Important: The AI's attack animation index (from an AI's Animation Profile's Attack List) is required. If the attack animation index does not exist within the AI's Attack List, there will be an error.
EmeraldAPI.Combat.TriggerAbility(EmeraldSystem EmeraldComponent, EmeraldAbilityObject AbilityObject, int AttackDistance, int AttackAnimationIndex)
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.TriggerAbility(EmeraldComponent, DesiredAbilityObject, DesiredAttackDistance, AttackAnimationIndex);
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.KillAI(EmeraldComponent);
Reset AI
Resets the AI so it can be reused (can also be used for custom mechanics such as reviving).
Note: This is automatically called when an AI is killed and then re-enabled.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.ResetAI(EmeraldComponent);
Get Distance From Target
Returns the current distance between the AI and their current combat target (Returns -1 if the Combat Target is null).
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.GetDistanceFromTarget(EmeraldComponent);
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.GetCombatTarget(EmeraldComponent);
Set Combat Target
Assigns a specified combat target for your AI to attack within the AI's Detection Radius. Note: Targets outside of an AI's Detection Radius will be ignored. If you want no distance limitations, use OverrideCombatTarget(Transform Target).
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.SetCombatTarget(EmeraldComponent, YourTargetTransform);
Override Combat Target
Assigns a specified combat target for your AI to attack ignoring any distance limitations. If the target is not within attacking range, the AI will move to the target's position and attack based on its attack distance, even if it is outside of its detection radius.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.OverrideCombatTarget(EmeraldComponent, YourTargetTransform);
Flee From Target
Makes an AI flee from the specified target by switching their behavior to Coward. The AI will remain with the Coward until it is reset manually.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.FleeFromTarget(EmeraldComponent, YourTargetTransform);
Search For Closest Target
Searches for a new target within the AI's Detection Radius closest to the AI.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.SearchForClosestTarget(EmeraldComponent);
Search For Random Target
Searches for a new random target within the AI's Detection Radius.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.SearchForRandomTarget(EmeraldComponent);
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Combat.GetLastAttacker(EmeraldComponent);