Fallout 2 mod Trouble with Custom Companion AI

Goat_Boy

Still Mildly Glowing
Hi, had a question for anybody who has experience making custom companions - particularly with their AI

I made various custom companions and added their entries in party.txt. I have also made their custom AI and Combat Floats by modifying ai.txt, aibdymsg.txt, aigenmsg.txt (in the Data folder) and combatai.msg (in the Data/Text/English/Game folder).

I have also set their protos to use these new AI packets by using Proto Manager (added their entries in AI.def).

I have an issue where (in game) every time I set their combat settings with Combat Control they revert to as soon as I leave the dialogue.
I'm not sure what causing their AI to reset every time, don't think there is anything in their script to cause that. I'm at a loss, did some research the last couple of days to find a solution to no avail.

Anybody knows what the cause may be?
 
Oh, this sounds so familiar. I know I've heard of this before... Possibly even experienced it myself.

First off, are the protos that you are using new ones? Or recycled?

Also, is everything in the correct order? Like, however things are listed on the character screen, is that how it is listed in the party.txt file?
 
Oh, this sounds so familiar. I know I've heard of this before... Possibly even experienced it myself.

First off, are the protos that you are using new ones? Or recycled?

Hey MIB88, thanks for replying!

Most of the protos I'm using are new ones, though copy pasted from vanilla protos if that counts as recycled. I made sure all of them are set to a new AI packet.

I believe everything is in the correct order too, every packet is ordered numerically and follow the order they should be in for each entry: Bersek, Agressive, Defensive, Coward, Custom.

By testing I noticed some companions work correctly and some don't. I'll upload the relevant files if that's of any help.
 

Attachments

@Goat_Boy

it was discussed not too long ago by me and Lexx

read on from here:
https://nma-fallout.com/threads/fallout-et-tu-release-v1-8.218045/page-89#post-4505559

Basically You need to make all behaviour AI packets regardless of which you'll end up using and do everything in specific order
[PARTY <member name> BERSERK]
[PARTY <member name> AGGRESSIVE]
[PARTY <member name> DEFENSIVE]
[PARTY <member name> COWARD]
[PARTY <member name> CUSTOM]

and set the custom packet as the one assigned to the proto. Lexx says that in theory this should be enaugh. although I'm still in the process of veryfing that.
( i've made ai packets for Fo:Sonora companions, and started the nessecary new game for the changes to take effect. but i haven't reached any party members yet.)


EDIT:
So I looked over Your ai.txt
it seemes fine, there are now two additional steps. all new party member protos must have the "custom" ai packet set in proto manager, and additionally you need to start a new game ( yes from the temple of trials) for the changes to take effect. At leas that's what Lexx says.

I haven't progressed much in Fo:Sonora in my new playthrough to witness the changes, as my first party member is still a bit further in the playthrough. currently I'm too busy with
gambling exploits for caps ingame, and ofcourse real life takes the vast majority of every day.

anyways Lexx is the man to ask, he did this properly for Katja, Ian, Tycho, Dogmeat, and recently Vasquez from restored cut content too.
 
Last edited:
I'm actually not really the man to ask :D I don't know why those issues happen. There is not much to party member ai packages. You need to fill out the party.txt and ai.txt correctly, and also fill out the necessary stuff in the party.h header file, including recompiling all affected scripts. I'm pretty sure it doesn't even matter how you name the ai packages, since the party member name is never defined anywhere else.

If there are some issues, in worst case I'd make an exact copy of an existing party member and then see if that fixes issues. Sometimes the problem can be a missing letter somewhere, or wrong order of datasets, etc.

You can also try to assign an existing party member ai package (Sulik, Cassidy, etc) to your new critter and see if this fixes issues. If yes, then the problem is definitively with your new packages.

Here is more to ai packages, just for completion.

PS: I suggest to add cheats and debug shortcuts to test this stuff. Starting a new game and playing until point x just to see if it works now is a very inefficient way of testing.
 
I'm actually not really the man to ask :D I don't know why those issues happen. There is not much to party member ai packages. You need to fill out the party.txt and ai.txt correctly, and also fill out the necessary stuff in the party.h header file, including recompiling all affected scripts. I'm pretty sure it doesn't even matter how you name the ai packages, since the party member name is never defined anywhere else.

If there are some issues, in worst case I'd make an exact copy of an existing party member and then see if that fixes issues. Sometimes the problem can be a missing letter somewhere, or wrong order of datasets, etc.

You can also try to assign an existing party member ai package (Sulik, Cassidy, etc) to your new critter and see if this fixes issues. If yes, then the problem is definitively with your new packages.

Here is more to ai packages, just for completion.

PS: I suggest to add cheats and debug shortcuts to test this stuff. Starting a new game and playing until point x just to see if it works now is a very inefficient way of testing.


Actually @Lexx I think the "new game" for new AI packets is actually nessecary because we add a new AI packet, but most importantly the game can't munch the AI packet change for a critter proto on an already visited map, so if one would reach the point with said party member, who has the new ai packet already turned to, one could easily do updates on the live ai packet on the fly, and it would get accepted, cause it's just the matter of the protos not updating due to them beeing in saves, however i think ai.txt doesn't get saved in the savegame, soit might be editable during a playthrough just like scripts.

Oh and could You elaborate more on that party.h editing in this matter Fo:Sonora doesn't seem to use party.h file ( at least it's not in the mapper with the sources for it)
 
Can you post one of the scripts, please?

Of course, I'll upload the script for a companion that works properly and for one who doesn't.

I haven't added any script lines that modifies the AI package as the vanilla companions don't seem to do that.
 

Attachments

Oh and could You elaborate more on that party.h editing in this matter Fo:Sonora doesn't seem to use party.h file ( at least it's not in the mapper with the sources for it)

I can't speak for Sonora, since it uses 100% custom scripts as far as I can remember. Guess if you want to add new party members there, you'll have to do whatever they did with party members.
 
@Goat_Boy

it was discussed not too long ago by me and Lexx

Dziękuję bardzo for the tips!

Lexx kindly explained that to me via the NMA discord, I mistakenly didn't use set them up in that order initially but I set them up correctly after his advice. That seemed to fix the issue with one companion but others are still faulty for some reason.

Also, yes with Proto Manager I set all of their AI packets to the correct one: [PARTY <member name> CUSTOM]
 
I can't speak for Sonora, since it uses 100% custom scripts as far as I can remember. Guess if you want to add new party members there, you'll have to do whatever they did with party members.

If it's less tedious than the vanilla FO2 method I might just switch to that :lol:
 
I can't speak for Sonora, since it uses 100% custom scripts as far as I can remember. Guess if you want to add new party members there, you'll have to do whatever they did with party members.

Nah.. no new party members.. just ading party AI packets as by default all party members were using generic AI packets like Raider, Paladin, etc. and same issue as with Goat_Boy's mod no way to set custom control to remember

Dziękuję bardzo for the tips!

Lexx kindly explained that to me via the NMA discord, I mistakenly didn't use set them up in that order initially but I set them up correctly after his advice. That seemed to fix the issue with one companion but others are still faulty for some reason.

Also, yes with Proto Manager I set all of their AI packets to the correct one: [PARTY <member name> CUSTOM]


at least I suspect what's wrong with Rhea.. engine is hell bent on an npc that uses no-pref in burst attacks and unarmed to stay that way all acros ai packets ( at least i think so) like dogmeat robodog k9 and goris.

Rhea though has something different set i defensive ai packet.. that may stir things up.
 
at least I suspect what's wrong with Rhea.. engine is hell bent on an npc that uses no-pref in burst attacks and unarmed to stay that way all acros ai packets ( at least i think so) like dogmeat robodog k9 and goris.

Rhea though has something different set i defensive ai packet.. that may stir things up.

Regarding Rhea, I wanted to make her a pure unarmed fighter so I copy pasted Goris's entries for her. I'm checking if anything is off with her entries.

I'm honestly at a loss, not sure what is going on with this AI situation :sad:
 
In worst case, remove all changes and do them again one by one.
 
Figured out what the issue was.

This mod made changes to two maps where I placed the two "faulty" AI companions, for some reason in the mapper I set their AI to a vanilla packet (Patron). I changed their packet to the Custom ones I made and they work fine.
The companions that work where spawned via a script instead of being placed into the map via Bis Mapper.

EDIT: It comes without saying, thank you everyone for your help!
 
Last edited:
yeah.. i just come to say that the first Fo:Sonora companion that i tested also failed to work at first. So I took Goat boy's aproch and set the ai packet in the mapper for all companions. This seemed to fali at first as well, but it turned out, that his initial party joining was on rules of an ally, not a companion, i had to
escort that one out to a certain place, for the combat control options to register correctly. so initially the combat control custom options are still, only when that npc is later cast out by his employers and actually joins our team, the custom controll options work correctly
 
i may have spoken to soon, it doesn't work yet.. I'm going to the bottom of this until bugs are ironed out..

EDIT:

@Lexx @Goat_Boy

Would you mind giving me a crash course on aibdymsg.txt and aigenmsg.txt
i.e. what exactly is in them and to what should I configure each individual position per packet?

It would seem Nevada Band totally ommited those files as they are not present anywhere in the mod. ai.txt is set to none/none on both positions for all packets.

this produces a whole hellhole of it's own, as critters change ai packets to any other since they all share the same body type of "none" and this "none" isn't defined anywhere besides ai.txt so the game is randomly assigning existing ai packets. After setting disposition to custom the packet just changes each time i open the custom control menu. i thought it works because it first shifted to what was set in the custom ai packet made for that npc, but each time i open that menu the values are different, and shift seemes to randomly shuffle between few existing ai packets.

It would seem I'm forced to create aibdymsg.txt and aigenmsg.txt from scratch.

not too hard of a task since orignally ai.txt for Fo:Sonora has like 54 or so entries
76 total with all party npc dispositions, it's doable, it's not like 186 packets from vanilla fo2.

I just need to know what are each of the lines for, and what are the options to set them.

thanks in advance.
 
Last edited:
Back
Top