Skip to content

Is there a way to customize the party AI?

As of now, under default settings, my party members have a will of their own (healing, attacking, moving, etc).

I was wondering if it was possible to make everything "at will". It would make my battles MUCH easier.

Comments

  • jmerryjmerry Member Posts: 3,822
    edited July 2021
    Yes, there is.

    On the character record screen, hit "Customize" and then "Script". There are a number of standard choices listed there, or you can choose "Advanced AI" and set all of the details manually.

    An overview of the options there:

    Attack Enemies: If this is active, the chosen character will automatically attack enemies, and choose new targets when their current target dies. I typically have this one on for everybody, except perhaps a dedicated backstabber that I would rather have wait for the right opportunity.

    Prefer Melee Weapons: If active, the character will switch to a melee weapon when idle. You can force them to use a ranged weapon and attack, but they'll switch away from it as soon as their current target is down.
    Prefer Ranged Weapons: If active, the character will switch to a ranged weapon when idle if no enemies are near, or switch to a melee weapon if an enemy closes to melee range. Why not use ranged weapons exclusively? Because melee attacks against somebody with a ranged weapon equipped get +4 to hit and +4 to damage, and ranged attacks against an enemy in melee range get -8 to hit.
    You can choose one of these two, but not both. If you choose neither, the character will never automatically switch weapons.

    Use Items: If this is active, the character will automatically use items such as potions.
    Use Special Abilities: If this is active, the character will automatically use innate abilities such as Lay on Hands or berserker rage.
    Use Defensive Spells: If this is active, the character will automatically use defensive spells such as Stoneskin or healing spells.
    Use Offensive Spells: If this is active, the character will automatically use offensive spells such as Breach, Confusion, and Fireball.
    Any number of these four options can be chosen, independently of each other.

    Find Traps: If this is active, the character will search for traps whenever idle with no enemies nearby. As long as they're a thief or monk with the ability to, of course. If you tell a character that has this active to hide, they won't automatically switch back to finding traps until/unless they fail at hiding.
    Hide in Shadows: If this is active, the character will attempt to hide in the shadows whenever idle with no enemies nearby. As long as they're a thief, monk, or ranger with the ability to, of course. If the character is already invisible by other means, they won't attempt to hide and become more invisible.
    Sing Bard Song: If this is active, the character will attempt to sing/dance whenever enemies are nearby. As long as they're a bard or shaman with the ability to, of course.
    Turn Undead: If this is active, the character will attempt to turn undead whenever lots of undead are right next to them. The trigger conditions are so restrictive that this basically never happens. Also, as with the other options, this only applies if they're a cleric or paladin with the ability to turn undead.
    You can choose at most one of these four options. Singing and turning take priority over auto-attacks; you can force the character to attack instead, but a bard with auto-singing active won't attack on their own.

    One caveat; for the recruitable NPCs, all of these options are filtered through combat scripts written for that character. Those scripts only take into account the character's class; if the character does something like dual-classing and gains new abilities that way, they won't know how to use the abilities of the new class. This is more of an issue in BGEE than BG2EE, of course.
    In addition, the blocks allowing a character to use Turn Undead aren't included in the scripts for paladin NPCs. Even if you surrounded him with a dozen worthless skeletons, Ajantis would never activate Turn Undead without an explicit order.

    I've gone beyond just using "Advanced AI" to tinkering with the underlying scripts. Things like making auto-turning actually relevant, or having bards sing even when there aren't enemies in sight. Hopefully, I'll have that converted into a mod people can use at some point.
    ShadowBlazeFenrirWolfganger
  • Albatr055Albatr055 Member Posts: 28
    Wow, thank you for the long and thoughtful post.
Sign In or Register to comment.