edited July 2019 in ORK Support
I cannot get the move AI right, the enemy can chase the player but sometimes or always (I am not sure) the enemy changes back to move to waypoint for a 0.1s - 0.3s and then change back to chase the player again. This changing occurs when the enemy detects the player in range and when the player move too far (as settings). I already put a threshold in every distance to make sure the smooth detection. Any idea what was wrong?

Also what is the Target Check Position use for?
For the Detection Mode in Move AI can it uses layer, so the enemy will not be able to detect behind the wall or something?
Also for the Range AI at the Battle System - Battle Settings, I found out it always reach out no matter how block the way is. Can I use this feature for such a maze battle field (not aggressive behind the wall)

I am also wondering if I can use behavior designer from opsive. I managed to combine AstarPathfinding Project for pathfinder solution and work it out with ork too. all I need is to connect the ORK to BD. In this case, I am trying to get the data from ORK with a little script to get combatant status alive or dead, how can I do this?

my simple script for custom conditional task from BD is like this

***
using UnityEngine;
using ORKFramework;
using BehaviorDesigner.Runtime.Tasks;


public class BehaviourDesignerToOrkFrameworkAI : Conditional {

public Vector3 position;
public Combatant a;
private bool isDead;

// Use this for initialization
public override void OnAwake () {
Combatant a = gameObject.GetComponent();
}

// Update is called once per frame
public override TaskStatus OnUpdate()
{
isDead = a.Dead;
if (isDead)
{
return TaskStatus.Success;
}
else
{
return TaskStatus.Failure;
}
//return base.OnUpdate();
}

}
***

but it gives me error, it says the combatant requires something that I don't understant. Can you also help me with this? just in case using BD is better for a custom move AI. Move AI feature is good, but I need to detect more than just player.

Thank you. Please any help?
Post edited by ledx on
  • The Target Position Check settings handle how often the target's position is checked and updates the move AI. You can add several checks, e.g. if the target is far away, you don't need to update the position as often - this is mostly for performance improvement and you can set it to an interval of 0 and a minimum distance of 0 for testing.

    Detection can use raycasts, which define the checked layers via the Layer Mask setting.

    The range settings in Battle System > Battle Settings are just for general checks if a combatant can e.g. use the move AI or battle AI, based on the distance to the player. You can completely disable using these ranges if you don't need them, but there's no raycasting for determining that (and not needed). It's mainly there to keep far away enemies from using move/battle AI to improve performance.
    If you want to use line of sight, use this in the use ranges of your actions (abilities, items, default use range, etc.) - the Battle Range Templates have settings for that.

    As for your code, use this to get the combatant:
    this.a = ComponentHelper.GetCombatant(this.gameObject);
    And this to check if the combatant is dead:
    if(this.a.Status.IsDead)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.