Modding:AI Task seektargetingentity

From Vintage Story Wiki
Revision as of 03:42, 20 October 2024 by Bluelightning32 (talk | contribs) (AI_Task_seektargetingentity)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This does the same thing as seekentity with one exception. Only entities that are targeting the guarded entity (owner of the entity) are seeked.

The potential attack target is considered as targeting the guarded entity if the potential target has an AI task active that inherits from AiTaskBaseTargetable, its TargetEntity is set to the guarded entity, and the task has AggressiveTargeting=true (true for everything that inherits from AiTaskBaseTargetable except fleeentity). For example, let's say there is a wolf near the player. The wolf is approaching the player due to an active seekentity task. A hacked locust is guarding the player. The hacked locust sees that the "seekentity" task on the wolf is targeting the player, so it starts approaching the wolf.

After the guard starts seeking a target, it continues seeking the target until it dies, or 30 seconds elapsed and the target is no longer targeting the guarded entity. Returning to the previous example, let's say that after receiving damage the wolf starts fleeing. Let's say the hacked locust somehow got stuck, which is enough to stop the regular "seekentity" task. The hacked locust will keep periodically trying to seek the target for 30 seconds. At that, it realizes that the wolf is no longer targeting the player, so the "seektargetingentity" task stops running.

Properties

All properties are inherited from seekentity. So see the list of properties there.


Content Modding
Basics Content Mods Developing a Content Mod Packaging & Release
Tutorials
Concepts Modding Concepts Modinfo Variants Domains Patching Remapping World Properties
Moddable Assets
Uncategorized
Icon Sign.png

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.

Modding
Modding Introduction Getting Started Theme Pack
Content Modding Content Mods Developing a Content Mod Basic Tutorials Intermediate Tutorials Advanced Tutorials Content Mod Concepts
Code Modding Code Mods Setting up your Development Environment
Property Overview ItemEntityEntity BehaviorsBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsCollectible BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository