Factions¶
A faction needs two things: a line in npc.xml so the game knows it, and a faction file so NPC Utilities knows how it feels about everyone else.
1. Declare it (Config/npc.xml)¶
2. Describe it (NPCUtilities/factions.xml)¶
Put the file in a folder named NPCUtilities in your mod. Every NPCUtilities/*.xml file of every loaded mod is
read when a world starts.
<npcutilities>
<faction name="myRaiders" player_start="100" hostile_below="300">
<relation faction="undead" value="0"/>
<relation faction="dsdSurvivors" value="0"/>
<relation faction="dsdBandits" value="700" mutual="false"/>
</faction>
</npcutilities>
| Attribute | Default | Meaning |
|---|---|---|
player_start |
400 |
Standing every player starts with. |
hostile_below |
200 |
The faction's NPCs attack players with lower standing. |
relation faction / value |
How this faction feels about another, 0-1000. Below 200 they fight. | |
mutual |
true |
false sets it one way only. |
How friend and foe is decided¶
| An NPC looks at... | Enemy when |
|---|---|
| a player | that player's standing with the NPC's faction is below hostile_below |
| another NPC | the factions' relation is below 200 |
| a zombie | its faction's relation with undead is below 400 (true unless you raise it) |
| a hired NPC | it judges the hired NPC's owner instead |
Hired companions never attack players or other hired NPCs, and fight what their owner would.
Built-in factions¶
| Faction | Player start | Hostile below | Relations |
|---|---|---|---|
dsdSurvivors |
500 | 200 | hates undead, bandits, dsdBandits; likes whiteriver (700) |
dsdBandits |
150 | 300 | hates undead, whiteriver; friends with bandits (800) |