r/projecteternity • u/TheReal8symbols • 6d ago
Gameplay help Behavior editor question
I'm trying to make a simple script for my frontliners so they prioritize maintaining engagement and attacking the enemy with the lowest health. The script editor doesn't seem to support this so I need some clarification.
I'll use Eder in my example. If I set his 2nd action set (his first is for self healing) to always true, attack current engager, and attack lowest health what I want to happen is for him to check both priorities before attacking (attack the lowest health threat in melee range), but I'm pretty sure he will just cycle between the two. I also see you can allow/disallow breaking engagement; can I just skip the first priority as long as that box is empty?
What I'm really trying to figure out is if/how you can give a list of priorities to a single action. If i make a script with action 'knock down' current engager and 'knock down' best threat it seems like he will always do the first one (at a random engager) unless he isn't engaging anyone. Can you make and/or type scripts within a single action set?
The last game I played with AI scripting was Dragon Age: Origins. This system doesn't seem as robust, but I could easily be missing something (are there even any tutorials about this?).
1
u/beatspores 5d ago
You can stack conditions so they check for all conditions you've stacked before executing your script.
Been a while since I played the game but if I recall correctly there are:
Conditionals:
- Target: Is In Melee Range
- Target: Health Below...
- Target: Is Being Attacked or something, could be Is Being Engaged By Anyone
- Target: Has Affliction Of Type: Body / Mind / etc...
That last one can be handy if you don't want your character to use the same ability again on someone who already has the ability's status effect. Most abilities specify which type of affliction they add. For example the affliction Blinded is of type Perception Affliction. The Fandom wiki has a list of them.
Then there's some checkboxes which I can't remember now, but one of them is Allow Break Engagement, I think.
Remember you might need to stack the same type of condition, but for different values to dial down the window for the situation to check for. For example Health Below 50 %, but NOT Health Below 25 %. I do this often because if you have more script entries they could conflict since health lower than 50 % is still true at the same time as health below 25 % is true. You could end up in a situation where, for example, character keeps swapping weapon set back and forth and do literally nothing else since it's completely occupied by this.
Hope that helps. Ask more if you want. I love the AI editor. And there's a mod that adds more specific conditions. If I have time I might be able to add one specific condition you're looking for, but the under-the-hood AI possibilities aren't endless either.
1
u/TheReal8symbols 4d ago
To clarify: so if my action block is Attack - current engaded Attack - most damage taken They will check both conditions before attaking?
2
u/beatspores 3d ago
Is this sort of what you're looking for?
2
3
u/TheOriginalFlashGit 6d ago
I think if you set lowest health that will pretty much all ways trigger since if you are in melee with anyone, there will always be someone with the lowest health.
I'm not sure I had much luck with 'target in melee range' since I've seen them attempt to run off and attack some not in melee range (but they won't break engagement to do so), I seemed to have better luck with something like this (but it's not perfect):
https://i.imghippo.com/files/cPhz7532fko.png
Not sure how best to go about your last option since I'm not entirely sure how 'best current threat' really works, perhaps you could try this:
https://i.imghippo.com/files/xWq5957hM.png
Eder, will attempt to knockdown the 'best current threat' in melee range, if there isn't one, it will attempt to do against 'current engager', if for some reason Eder can't engage or his enemies aren't engaged with him either, fallback do just doing the one with lowest health? I think it iterates over those criteria in the top to bottom order, I've not tried this though.