Jump to content

Recommended Posts

How do I set AI to only perform actions on target I am currently attacking ?

What I am looking for is simple sequence for Rogue/Paladin multi class where my character would use crippling strike if target has no sneak attack afflictions and if target has any of the sneak attack afflictions my character would go for flames of devotion , problem I am having is that my character keeps using crippling strike on all enemies that are close or at least to those  he is being engaged to and that is not very efficient , is there any way to make AI stick to target that is currently being attacked and only to that target ?

 

Link to comment
Share on other sites

25 minutes ago, 3x0du5 said:

How do I set AI to only perform actions on target I am currently attacking ?

What I am looking for is simple sequence for Rogue/Paladin multi class where my character would use crippling strike if target has no sneak attack afflictions and if target has any of the sneak attack afflictions my character would go for flames of devotion , problem I am having is that my character keeps using crippling strike on all enemies that are close or at least to those  he is being engaged to and that is not very efficient , is there any way to make AI stick to target that is currently being attacked and only to that target ?

 

Are you using More AI Conditions mod? Because then you could set a conditional of “has Sworn Enemy” and “has an affliction” as conditions for a first rule to use FoD, and then “has Sworn Enemy but no affliction” as a second rule to use Crippling Strike.  Then a third rule to put Sworn Enemy on somebody to be the next kill target.

That will probably get you pretty close to what you want. Maybe not 100% because the AI really does have issues sometimes sticking to a target.  It’d be nice if the game had an enemy marker API so you could manually tag enemies with explicit marks that you could then use in AI rules to direct actions.

Damn, that sounds like an awesome mod, now that I think of it.  I think it’s even feasible within the existing mod system. I will have to have a look at how More AI Conditions does its magic, because it would be super easy to create some instant-cast infinite-use abilities that did nothing but put a status effect with no game effect on an enemy (or remove the effect if present), and then add AI condition rules which worked on the presence of those status effects to determine targets. Could even attach visual effects to the status effect (maybe there’s even a hovering skull effect which could be used for the kill target!)

In the meantime, try More AI Conditions, with the rule order I suggest, and see how that works out for you. 

Link to comment
Share on other sites

I think the best you can do is to set a cooldown on the Crippling Strike behavior equal to its total duration (including modifiers) and setup your targeting priorities so that they're all aligned (e.g. "Best Current Threat"). Obviously if the target removes the affliction or your character for some reason acquires a new target then there will be a delay in applying the affliction, but the concept of a current target is not really one this game uses.

Link to comment
Share on other sites

Shouldn't this work?
AI_crippling_fod.png?dl=1

If you have engagement (e.g. through Persistant Distraction later on) you would change "threatening anyone" with "engaging anyone" I guess. That way you could make extra sure the AI doesn't switch enemies that often. You could also add another condition with target's health. Usually the target you attacked first has the lower health - it might be a way to keep the Holy Slayer focused on a single enemy...?  

Edited by Boeroer

Deadfire Community Patch: Nexus Mods

Link to comment
Share on other sites

Once the character is out of Zeal, wouldn't he revert back to spamming Crippling Strike on everyone without an affliction in melee again? As far as I know, "Prioritize By" is used to choose among eligible targets, and anyone that already has an affliction would be ineligible per the conditionals.

Link to comment
Share on other sites

For that case you could make a "1B" condition that checks "NOT >= 2 Zeal" (mean if you have 1 Zeal or less) and then use auto-attack instead of FoD I guess?

I haven't tested the above setup but just made a quick screenshot about something that I think would basically work (since that seems to be the faster and more efficient way of communicating the AI setting). Am not 100% sure that it leads to the desired outcome though.

The edge cases (like Zeal or Guile is low) would need to be handeled seperately (like with a 1B and 2B condition and so on). 

Edited by Boeroer

Deadfire Community Patch: Nexus Mods

Link to comment
Share on other sites

5 hours ago, ocelotter said:

I think the best you can do is to set a cooldown on the Crippling Strike behavior equal to its total duration (including modifiers) and setup your targeting priorities so that they're all aligned (e.g. "Best Current Threat"). Obviously if the target removes the affliction or your character for some reason acquires a new target then there will be a delay in applying the affliction, but the concept of a current target is not really one this game uses.

what does "best current threat" stand for exactly ?

Link to comment
Share on other sites

18 hours ago, 3x0du5 said:

what does "best current threat" stand for exactly ?

Here's the (decompiled) source:

    [PreferenceScript("Find Best Current Threat", "Preferences\\Targeting")]
    public static void FindBestEngager()
    {
      // ISSUE: reference to a compiler-generated field
      if (Preferences.\u003C\u003Ef__mg\u0024cache1B == null)
      {
        // ISSUE: reference to a compiler-generated field
        Preferences.\u003C\u003Ef__mg\u0024cache1B = new Preferences.GetTraitDelegate(Preferences.GetThreateningScore);
      }
      // ISSUE: reference to a compiler-generated field
      Preferences.FindTargetWhereTraitIs(FindType.Highest, Preferences.\u003C\u003Ef__mg\u0024cache1B);
    }

    private static float? GetThreateningScore(Faction target)
    {
      if (!Preferences.AttackingAIController.IsThreatenedBy(target.AIController))
        return new float?(0.0f);
      if (Object.op_Equality((Object) Preferences.AttackingAIController.CurrentTarget, (Object) ((Component) target).get_gameObject()))
        return new float?(2f);
      return new float?(1f);
    }

So I think "Best Current Threat" is your current target if it's engaging or attacking you back, otherwise it's a (random?) character that is engaging or attacking you. Which is slightly funny, because it indicates that there is indeed code to determine a character's current target in the source, they just don't give that as a targeting option for whatever reason.

Edited by ocelotter
Link to comment
Share on other sites

There should be. I also have no idea why that isn't a pickable condition. I think you can work around it (like I said the target with the lowest health is most likely the one you attacked before) but it would be easier to have that option.

Deadfire Community Patch: Nexus Mods

Link to comment
Share on other sites

Well for time being i managed to get result i wanted pretty much by moving crippling strike way down in priority order and having my holy slayer spam flames of devotion on afflicted targets first with prioritize by nearest enemy it works surprisingly well for now because my character has persisten distraction talent i havent noticed him switching between targets he is engaged with maybe it happens from time to time not often enough for me to notice , i think “nearest enemy” might be “target you are currently attacking” or at least it functions like that often, downside i never use sworn rival anymore haha next time i will go with enhanced AI mod and just set the ai up with sworn rival 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...