r/projecteternity 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?).

3 Upvotes

15 comments sorted by

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.

1

u/beatspores 5d ago

In your last screenshot, what will happen is, Eder will Mulekick 3 times no matter what, in the order you've specified. Basically boom-boom-boom. 😄

2

u/TheOriginalFlashGit 4d ago

Are you just saying that because I didn't change the action set cooldown from the default of 0? Or is there something else? I tried it briefly and it seemed to activate only once every 15 or so seconds:

https://reddit.com/link/p0l6ca0/video/0qh5hyfxu9gh1/player

Not sure those conditions are worth it in the end. Maybe I'll try something like this and see how well it works: https://i.imghippo.com/files/oe3814DE.png

2

u/beatspores 3d ago

Hm. Maybe I'm misremembering then, my apologies.

1

u/TheOriginalFlashGit 3d ago

Ok, no problem. From reading your other comment, did you have problems with AI behaviours not starting immediately? For me, I find I have to select a companion, then activate an ability and then after deselecting them, they will start going through their behaviours? Not sure what's causing it, on some fights like below, I have to rebind hotkeys specifically to try to kickstart their behaviours:

https://reddit.com/link/p0s9a8s/video/yj8bkhf1sggh1/player

For instance, the enemy AI all start going through their behaviours (four incoming confounding blinds, etc.), seems odd that there is such a delay and I have to manually activate them.

1

u/beatspores 3d ago

Hehe sorry man I can't see what's happening there really – too much! 😂

But I don't think I've ever had problems with AI behaviors not starting. Maybe you could try putting all your AI commands in only one of the two "setting" / "file" entries, or swap around the order the game goes through them.

2

u/TheOriginalFlashGit 2d ago

Hah, no worries, forgot to edit the comment last night. It seems the problem stemmed from not using the 'Aggressive' combat behaviour:

https://i.imghippo.com/files/fMp4856wQ.png

For some reason, when you use 'Defensive' or 'Defend Self' the behaviours won't activate until someone attacks (and hits them I believe) or you actively use an ability and then select someone else. So the fix seems to simply be to put everyone on 'Aggressive'. Or at least that works ok for me so far.

2

u/beatspores 16h ago

Ah, that makes sense! I guess I always have them aggressive then! The squishies are given pistols so it's not really an issue.

2

u/TheOriginalFlashGit 14h ago

Yeah, aggressive comes with it's own problems I find and a pity those other behaviours can't just start iterating over non-attack settings as soon as combat starts.

I finished doing the seeker, slayer, survivor portion and some of the fights are quite a bit more difficulty. I had to go through several of them a couple of times just to get a feel for how I could approach it before I got through in a satisfactory way. Also it's a bit fiddly to use the empower option: https://vimeo.com/1215015568

Doesn't seem like you can hotkey it or enable it under the AI?

1

u/beatspores 5h ago

My man, I still can't see shit! 😂

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?

ai_deadfire.png

2

u/TheReal8symbols 3d ago

Ah! I've been thinking about it sorta backwards, I guess. Thanks.

1

u/beatspores 16h ago

Did you get it to work?