SCRIPTING API / AI and navigation / AI
AI
Behavior trees, blackboard and perception. ScriptTask, ScriptCondition and Attack nodes (without a native attack handler) wait for the entity's script: read the task name with GetActiveTask and finish it with CompleteTask, or derive from BehaviorTreeAgent.
Kindclass
NamespaceKroys.EngineScripting
Members14
Source
AI.csDECLARATION
Declaration
Namespace Kroys.EngineScripting.
Declaration
public static class AI
REFERENCE
Members
Methods
#public static string GetActiveTask(Entity entity)Name of the task the entity's behavior tree waits on; empty when none.
#public static bool CompleteTask(Entity entity, bool success)Completes the active task; the tree continues on its next tick.
#public static void ReportNoise(Vector3 position, float radius, Entity instigator = default)A noise AI Perception hears within min(radius, hearing range).
#public static bool SetBlackboard(Entity entity, string key, bool value)Writes a blackboard value of the entity's AI Controller (bool, float, Vector3, string or entity); behavior-tree conditions read it. False when the entity has no AI Controller.
#public static bool SetBlackboard(Entity entity, string key, float value)Writes a blackboard value of the entity's AI Controller (bool, float, Vector3, string or entity); behavior-tree conditions read it. False when the entity has no AI Controller.
#public static bool SetBlackboard(Entity entity, string key, Vector3 value)Writes a blackboard value of the entity's AI Controller (bool, float, Vector3, string or entity); behavior-tree conditions read it. False when the entity has no AI Controller.
#public static bool SetBlackboard(Entity entity, string key, string value)Writes a blackboard value of the entity's AI Controller (bool, float, Vector3, string or entity); behavior-tree conditions read it. False when the entity has no AI Controller.
#public static bool SetBlackboard(Entity entity, string key, Entity value)Writes a blackboard value of the entity's AI Controller (bool, float, Vector3, string or entity); behavior-tree conditions read it. False when the entity has no AI Controller.
#public static bool GetBlackboardBool(Entity entity, string key)Reads a bool blackboard value (false when missing).
#public static float GetBlackboardFloat(Entity entity, string key)Reads a float blackboard value (0 when missing).
#public static Vector3 GetBlackboardVector(Entity entity, string key)Reads a Vector3 blackboard value (zero when missing).
#public static string GetBlackboardString(Entity entity, string key)Reads a string blackboard value (empty when missing).
#public static Entity GetBlackboardEntity(Entity entity, string key)Reads an entity blackboard value (invalid when missing).
#public static AITaskStatus RunTasks(Entity entity, Func<string, AITaskStatus> handler)Runs the entity's active script task through
handler (name, delta) once; call it from Update or FixedUpdate. Returns the task status, or Running when no task waits.Signatures
public static string GetActiveTask(Entity entity) public static bool CompleteTask(Entity entity, bool success) public static void ReportNoise(Vector3 position, float radius, Entity instigator = default) public static bool SetBlackboard(Entity entity, string key, bool value) public static bool SetBlackboard(Entity entity, string key, float value) public static bool SetBlackboard(Entity entity, string key, Vector3 value) public static bool SetBlackboard(Entity entity, string key, string value) public static bool SetBlackboard(Entity entity, string key, Entity value) public static bool GetBlackboardBool(Entity entity, string key) public static float GetBlackboardFloat(Entity entity, string key) public static Vector3 GetBlackboardVector(Entity entity, string key) public static string GetBlackboardString(Entity entity, string key) public static Entity GetBlackboardEntity(Entity entity, string key) public static AITaskStatus RunTasks(Entity entity, Func<string, AITaskStatus> handler)
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.