The file consists of a description of combat parameters for the player and all NPC classes in the game. Descriptions are separated from one another with an empty line. Each description consists of the (unique) name of the class and settings. Below is a list of parameters in alphabetical order, which is how they are always written in the file. "string" means that the value should be text; "N" indicates a numeric value; and "mixed" can be either.
There seems to be a mismatch between some of the string values used and what the engine actually looks for. Potentially incorrect values are indicated with a (*).
This option must be specified first. For example, [Enclave Patrol], [Fighting Mantis] or [Arroyo Villager]. The player is the class named Player AI. Every party member must have the following classes:
[PARTY NAME BERSERK] [PARTY NAME AGGRESSIVE] [PARTY NAME DEFENSIVE] [PARTY NAME COWARD] [PARTY NAME CUSTOM]
Here NAME is the name of a member of the team, such as: DOC, LENNY, GORIS, etc.
NOTE: The combat ai-mode types for party members must always be in the above shown order, and the character must always start out in the CUSTOM-mode, otherwise the game will not be able to correctly detect the set ai-mode.
The chance of aggressive behavior by the NPC in combat. Measured as a percentage. Valid values are: 0-100.
Conditions for burst-fire. Existing values, the internal numeric representation, and the text used for setting custom behavior in-game:
no_pref* -1 "Not Applicable." always 0 "Always!" sometimes 1 "Sometimes, don't worry about hitting me" be_sure 2 "Be sure you won't hit me" be_careful 3 "Be careful not to hit me" be_absolutely_sure 4 "Be absolutely sure you won't hit me"
'no_pref' is used by Cyberdog and Goris, and has a line in custom.msg, but is not checked for by the engine.
For party members, these options must be defined in the party.txt file.
whomever_attacking_me 0 "Whomever is attacking me" strongest 1 "The strongest" weakest 2 "The weakest" whomever 3 "Whomever you want" closest 4 "Whomever is closest"
For party members, these options must be defined in the party.txt file.
Preferred weapon types. This option does not exist for all NPCs. Available values:
no_pref 0 "None" melee 1 "Melee" melee_over_ranged 2 "Melee then ranged" ranged_over_melee 3 "Ranged then melee" ranged 4 "Ranged" unarmed 5 "Unarmed" unarmed_over_thrown ? (Spore Plant) random ? never* ? (Deathclaw)
For party members, these options must be defined in the party.txt file.
Defines the block of messages that critters say in response to being hit. The blocks are from master.dat/data/AIBDYMSG.TXT, which in turn refers to lines in combatai.msg . Existing values (examples of critters that use them in parens):
None Primitive Wimpy Person (Whimpy, Coward ...) Punk (SF) Berserk Person (Kamakazi. ..) Tough Person (Bounty Hunter, Caravan Driver ...) Boxer Normal Person Robot Junkie (Crazy Addict) Elron (Habologisty) Ghoul Kaga Raider (Khan) Raider (Non-Khan) Gangster (Mobsters) Shi Super Mutant (Master Army) Goris Miron Marcus Lenny Cassidy Robo Brain (Hum / Cyb) Sulik
Sets the probability of using an aimed attack, which is calculated as 1/N. Cannot be zero.
Preference for drug use. PIDs of items, or -1 if there is no preference. If you want to specify multiple types of drugs, they are listed separated by commas (e.g., 284,81,103). Strangely, most critters use 81 (Iguana-on-a-stick, whole).
NPC drug use in combat. Existing values:
clean 0 "I'm clean" stims_when_hurt_little 1 "Stimpacks when hurt a bit" stims_when_hurt_lots 2 "Stimpacks when hurt a lot" sometimes 3 "Any drug some of the time" anytime 4 "Any drug any time" always ?
For party members, these options must be defined in the party.txt file.
Perhaps the font color used for combat floats. It is 58 for all critter types.
Determines NPC behavior during a battle. Existing values:
-1* none custom coward defensive aggressive berserk
The distance between the NPC and its enemy, managing battle tactics. Existing values:
stay_close 0 "Stay close to me" charge 1 "Charge!" snipe 2 "Snipe the enemy" on_your_own 3 "On your own" stay 4 "Stay where you are" random* ? (listed only for Mobsters and Tough Khan)
For party members, these options must be defined in the party.txt file.
Perhaps, the font used for combat floats. Value in the US version of the game is 101. In other versions 102, 103, and 104 are used.
Defines the block of combat taunts that the critter periodically shouts during a battle (attack, retreat, miss). The blocks are in master.dat/data/AIGENMSG.TXT, and refer to lines in combatai.msg . Existing values:
Badger Berserk Person Bounty Hunter Boxer Cassidy Chip Crazed Robot Cyberdog Dragon (The) Elron Guards Gangster Ghoul Goris Guard (Normal) Guard (Tough) Junkie Kaga (1) Lenny Lo Pan Marcus Myron None Normal Person OZ - 7 OZ - 9 Primitive Raider Raider Captain Raider Mercs Rat God Robot Ryan Shi Guards Sulik Super Mutant (Master Army) The Brain Tough Person Wimpy Person
NPC messages when hit in the eyes, groin, head, left arm, left leg, right arm, right leg and torso, respectively. For details, see the description of attack_end.
Indicates the condition in which the NPC starts running away. Multiple conditions are separated by commas.
blind 40 crippled 3c crippled_arms 30 crippled_legs 0c
'crippled' is equivalent to 'crippled_arms, crippled_legs'
For party members, these options must be defined in the party.txt file.
Condition when the NPC will run away. Existing values (second column is minimum amount of damage taken, as a percentage of max HP):
coward 0% 0 "Abject coward" finger_hurts 25% 1 "Your finger hurts" bleeding 40% 2 "You're bleeding a bit" not_feeling_good 60% 3 "Not feeling good" tourniquet 75% 4 "You need a tourniquet" never 100% 5 "Never!" none 0% 6 "None"
For party members, these options must be defined in the party.txt file.
Combat floats used when running away. For details, see the description of attack_end.
Similar to called_freq. Sets the probability of using a secondary (i.e., burst) attack mode, which is calculated as 1/N. Cannot be zero. Only used when area_attack_mode is 'sometimes' or 'no_pref'.
2019-12-15 - Updated information about party members.
2019-12-14 - Ported from https://falloutmods.fandom.com/wiki/AI.TXT_File_Format by ghost
2007 - Translated by Kanhef
1999-12-27 - Written by Serge of Team-X (ai_txt_format.htm)