This controls the in-game, mostly hardcoded, reputation changes for a creature object under some kind of (usually hostile) event from an outsider. This is not used if a chest is bashed, or unlocked, or whatever, or door is bashed.
This is also going to try and summarise how factions and reputations work. It's crazy, and you'll go mad. Especially when players are involved (and when are they not?).
Plot creatures who are attacked do not change anything.
2da Contents
The default 2da looks like this, for reference.
2DA V2.0 LABEL PERSONALREP FACTIONREP WITFRIA WITFRIB WITFRIC WITNEUA WITNEUB WITNEUC WITENEA WITENEB WITENEC 0 Attack -100 -5 -100 -100 0 -5 0 0 0 0 0 1 Theft -100 0 -10 0 0 -10 0 0 0 0 0 2 Kill -100 -5 -100 -100 0 -15 0 0 0 0 0 3 Help 0 0 0 0 0 0 0 0 0 0 0
Bioware Information
This page is mostly cribbed from the .PDF file here.
The 4 event types are hardcoded and appear to be:
- Attack - A hostile spell OR a hostile physical attack OR a hostile skill
- Theft - A theft (attempt? or something they notice?)
- Kill - They're dead Jim
- Help - A non-hostile spell
Note that certain things affect whether a witness does in fact serve as a witness for its own faction, including whether the witness is dominated, charmed, is a henchman, or is some other associate, as well as what faction the master belongs to. These considerations are not part of the Faction file format, however, and are not discussed further here.
2da Columns
This lists an equivalent script function using these objects:
- oPerpetrator - the person who caused the action
- oTarget - the creature who is considered the target
- oWitness - one or more witnesses who may feel friendly, neutral or enemy to the target creature
- This tests basically GetIsFriend/Neutral/Enemy(oWitness, oTarget) - ie what the witness thinks of the target
This may clear up some of how this works.
Reputation is from 0-10 (hostile), 11-89 (neutral) and 90-100 (friendly).
Column Name | Description | Attack | Theft | Kill | Help |
---|---|---|---|---|---|
LABEL | Label column | Attack | Theft | Kill | Help |
PERSONALREP | Personal reputation adjustment of how the target feels about the perpetrator of the action named in the LABEL. // Attack/Theft/Kill. Equivalent of -100 personal reputation. SetIsTemporaryEnemy(oPerpetrator, oTarget, FALSE); | -100 | -100 | -100 | 0 |
FACTIONREP | Base faction reputation adjustment in how the target's Faction feels about the perpetrator. This reputation adjustment is modified further by the effect of witnesses, as controlled by the columns described below. Note that a witnesses only affects faction standing if the witness belongs to a Global faction. // Attack or Kill action if(GetGlobalFactionFlag(oTarget)) { AdjustReputation(oPerpetrator, oTarget, -5); } | -5 | 0 | -5 | 0 |
WITFRIA | Friendly witness target faction reputation adjustment. If there is a witness from a global faction that is friendly to the target of the action, then adjust the target's faction adjustment by this amount. // Attack or Kill global change if(GetIsFriend(oWitness, oTarget) && GetGlobalFactionFlag(oTarget) && GetObjectSeen(oWitness, oTarget) && GetObjectSeen(oTarget, oWitness)) { AdjustReputation(oPerpetrator, oTarget, -100); } | -100 | -10 | -100 | 0 |
WITFRIB | Friendly witness personal reputation adjustment. If there is a witness from a faction that is friendly to the target of the action, then adjust the witness's personal reputation standing toward perpetrator by this amount. // Attack or Kill if(GetIsFriend(oWitness, oTarget) && GetObjectSeen(oWitness, oTarget) && GetObjectSeen(oTarget, oWitness)) { // Attack/Theft/Kill. Equivalent of -100 personal reputation. SetIsTemporaryEnemy(oPerpetrator, oWitness, FALSE); } | -100 | 0 | -100 | 0 |
WITFRIC | Friendly witness faction reputation adjustment. If there is a witness from a global faction that is friendly to the target of the action, then adjust the witness's faction standing toward the perpetrator by this amount. | 0 | 0 | 0 | 0 |
WITNEUA | Neutral witness target faction reputation adjustment. If there is a witness from a global faction that is neutral to the target of the action, then adjust the target's faction adjustment by this amount. Do not use this if a friendly global witness was found. // Attack if(GetIsNeutral(oWitness, oTarget) && GetGlobalFactionFlag(oTarget) && NoFriendlyWitnesses() && GetObjectSeen(oWitness, oTarget) && GetObjectSeen(oTarget, oWitness)) { AdjustReputation(oPerpetrator, oTarget, -5); // or -10 for Theft bizarrely higher than attack, -15 for kill } | -5 | -10 | -15 | 0 |
WITNEUB | Neutral witness personal reputation adjustment. If there is a witness from a faction that is neutral to the target of the action, then adjust the witness's personal reputation standing toward perpetrator by this amount. | 0 | 0 | 0 | 0 |
WITNEUC | Neutral witness faction reputation adjustment. If there is a witness from a global faction that is neutral to the target of the action, then adjust the witness's faction standing toward the perpetrator by this amount. | 0 | 0 | 0 | 0 |
WITENEA | Enemy witness target faction reputation adjustment. If there is a witness from a global faction that is an enemy of the target of the action, then adjust the target's faction adjustment by this amount. Do not do this if there is already a friendly or neutral global witness. | 0 | 0 | 0 | 0 |
WITENEB | Enemy witness personal reputation adjustment. If there is a witness from a faction that is hostile to the target of the action, then adjust the witness's personal reputation standing toward perpetrator by this amount. | 0 | 0 | 0 | 0 |
WITENEC | Enemy witness faction reputation adjustment. If there is a witness from a global faction that is hostile to the target of the action, then adjust the witness's faction standing toward the perpetrator by this amount. | 0 | 0 | 0 | 0 |
How it all breaks with Global Factions
Global factions are magic. They're telepathic. They also rapidly go from "one guard attacking me" to "everyone and the king attacking me" because the -5 reputation change on attack happens on every attack.
You attack the guard 20 times you've got the entire faction from 100 to 0 anyway.
So you disable the Global checkbox but this isn't necessarily going to fix everything because of how witnesses affect their personal reputation. You can still get a large amount of attention. The AI comes and responds to friends asking for help and will rapidly become personally hostile themselves.
Bioware decided the main fix was to make everyone nice again at a global level on respawn (at least with the standard factions); see nw_o0_death.nss
Reputations of the same faction
A faction can actually be...hostile to itself. It is usually Friendly. Friendly means there almost is guaranteed to be a friendly witness to a hostile action, and that witnesses personal reputation will tank to attack them too.
Faction Reputation and Personal Reputation
The game has 2 different - and overlapping - reputation systems.
- Faction Global reputation
- Personal reputation
Your faction can still be friendly to another faction but an individual in that faction may be an enemy of the faction. For instance an individual lone guard gets mugged - the entire guard faction (if Global is off) shouldn't suddenly become red.
This gets confusing fast. You can have a individually friendly person (personal reputation at 100) but the faction as a whole are enemies.
You also may attack a hostile guard (who is personally just an enemy) but the Faction change takes place if they're global so...then all the guards everywhere in the world go hostile!
Sadly there is no way to get an individuals personal reputation, but you can get their current reputation and get a "not affected" (perhaps hidden away somewhere) creature to test the factions reputation and compare.
Witnesses and how this messes everything up (but also doesn't)
Witnesses come in 4 basic flavours in regards to the base game repadjust.2da:
- Friendly witness, in a global faction
- Friendly witness, in a non-global faction
- Neutral witness, in a global faction
- Neutral witness, in a non-global faction
The global variants get fun.
Say we have a Guard, who is neutral to a Storekeeper, who is neutral back. The Guard faction is global but the storekeeper is not. A player attacks the guard. This happens:
- Guards personal reputation goes down to Hostile (great!) and their global faction reputation goes down by -5 (so not all guards are hostile yet)
- Storekeeper is there as a neutral witness. Uh-oh, the neutral global faction penalty also applies so that's
AI and how this messes everything up (and really does)
Some parts of even the default AI will adjust the reputation - specifically the call NW_ATTACK_MY_TARGET which, thankfully, is off by default.
This does an AdjustReputation(oIntruder, OBJECT_SELF, -100); which affects the global faction reputation.
Be careful using this!
PCs and Faction Reputations
You can go mad figuring out why the AI is entirely hostile to PCs. Sometimes to all joining PCs. It's probably some bugs in the game where it eventually gets confused what "faction" a PC is in (hint: it's not an NPC one!) and it somehow changes the default PC faction reputation...
PCs can also be part of a party. Not tested how this affects factions. Probably insanely