Wondering about a recommended procedure for determining how a combatant will select to attack based on a target's range. I notice that I can select as many base attack options for a combatant as I wish, but how do I go about setting up the mouse cursor to automatically toggle between them based on the distance from a selected combatant to whatever target the mouse is currently hovering over, taking into account also the selected combatant's equipment and equipment variables?

  • Is this for player controlled combatants or AI combatants?
    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!
  • The target could be either. If the player is targeting, then it would be AI and vice versa.
  • edited April 2018
    No, I meant using it - i.e. used by the player or by the AI?

    Anyway, when it's used by the player, you can set that up in the control maps used by your player combatant. The control map goes through the set up actions in the order they're listed, until it finds one that can be used. For your scenario, you'd set them up from lowest to highest use range.
    Enable Only Cursor Over Target, Only In Range and Use Cursor Over Target in the action settings of the control keys. This setup should use the action with the lowest use range that's possible.

    For AI controlled combatants, you need to set up range checks in your combatant's battle AI with Check Distance or In Use Range nodes.
    Post edited by gamingislove on
    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!
  • Thanks, that's helpful, but it brings up the question of whether I'll need to set up two basic attacks for human(oid) combatants, one for players and one for AI. Also, just to clarify that I'm not missing something here, when I mentioned targeting I was assuming it was the same as 'using.' Is there some hidden crux to the active ability system that I've failed to consider, because I have quite a few formula chains already set up for my combat subroutines that will depend on an ability's ability to correctly discern user from target and select the appropriate variables?
  • Who an ability can target is determined by its target settings, e.g. single enemies, use range of 5, etc.
    Naturally, the ability can discern user from target, unless you allow the ability to target all combatants, so everyone would be a valid option, but still, the user would be the user, even if the user is also a target.

    The battle AI can use an ability out of range and use the move AI to move into use range, so if you don't want that, I'd do range checks in the battle AI to use the action that's within range.
    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.