Show / Hide Table of Contents

Class FactionFile

Connects to FACTION.TXT and reads faction data.

Inheritance
Object
FactionFile
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class FactionFile

Constructors

| Improve this Doc View Source

FactionFile()

Declaration
public FactionFile()
| Improve this Doc View Source

FactionFile(String, FileUsage, Boolean)

Declaration
public FactionFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath
FileUsage usage
Boolean readOnly

Properties

| Improve this Doc View Source

CustomFactions

Declaration
public static Dictionary<int, FactionFile.FactionData> CustomFactions { get; }
Property Value
Type Description
Dictionary<Int32, FactionFile.FactionData>
| Improve this Doc View Source

FactionDict

Declaration
public Dictionary<int, FactionFile.FactionData> FactionDict { get; }
Property Value
Type Description
Dictionary<Int32, FactionFile.FactionData>
| Improve this Doc View Source

FactionNameToIDDict

Declaration
public Dictionary<string, int> FactionNameToIDDict { get; }
Property Value
Type Description
Dictionary<String, Int32>
| Improve this Doc View Source

Filename

Gets default FACTION.TXT filename.

Declaration
public static string Filename { get; }
Property Value
Type Description
String

Methods

| Improve this Doc View Source

GetFactionData(Int32, out FactionFile.FactionData)

Gets faction data from faction ID.

Declaration
public bool GetFactionData(int factionID, out FactionFile.FactionData factionDataOut)
Parameters
Type Name Description
Int32 factionID

Faction ID.

FactionFile.FactionData factionDataOut

Receives faction data.

Returns
Type Description
Boolean

True if successful.

| Improve this Doc View Source

GetFactionID(String)

Gets faction ID from name. Experimental.

Declaration
public int GetFactionID(string name)
Parameters
Type Name Description
String name

Name of faction to get ID of.

Returns
Type Description
Int32

Faction ID if name found, otherwise -1.

| Improve this Doc View Source

GetFlatData(Int32)

Turns a flat int back into archive/record format

Declaration
public static FactionFile.FlatData GetFlatData(int flat)
Parameters
Type Name Description
Int32 flat
Returns
Type Description
FactionFile.FlatData
| Improve this Doc View Source

IsAlly(ref FactionFile.FactionData, ref FactionFile.FactionData)

Check if a faction is another faction ally.

Declaration
public static bool IsAlly(ref FactionFile.FactionData firstFaction, ref FactionFile.FactionData secondFaction)
Parameters
Type Name Description
FactionFile.FactionData firstFaction

The faction to check the allies of.

FactionFile.FactionData secondFaction

The potential allied faction.

Returns
Type Description
Boolean

True if factions are allied, otherwise false.

| Improve this Doc View Source

IsEnemy(ref FactionFile.FactionData, ref FactionFile.FactionData)

Check if a faction is another faction enemy.

Declaration
public static bool IsEnemy(ref FactionFile.FactionData firstFaction, ref FactionFile.FactionData secondFaction)
Parameters
Type Name Description
FactionFile.FactionData firstFaction

The faction to check the enemies of.

FactionFile.FactionData secondFaction

The potential enemy faction.

Returns
Type Description
Boolean
| Improve this Doc View Source

Load(String, FileUsage, Boolean)

Load from FACTION.TXT file.

Declaration
public void Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to FACTION.TXT file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

Boolean readOnly

File will be read-only if true, read-write if false.

| Improve this Doc View Source

Merge(SaveVars)

Merges faction data from savevars into a new faction dictionary. Does not affect factions as read from FACTIONS.TXT. This resultant set of factions is the character's live faction setup. This is only used when importing a classic save. Daggerfall Unity uses a different method of storing faction data with saves.

Declaration
public Dictionary<int, FactionFile.FactionData> Merge(SaveVars saveVars)
Parameters
Type Name Description
SaveVars saveVars
Returns
Type Description
Dictionary<Int32, FactionFile.FactionData>
| Improve this Doc View Source

RegisterCustomFaction(Int32, FactionFile.FactionData)

Register a custom faction not in the DF FACTION.TXT file

Declaration
public static bool RegisterCustomFaction(int factionId, FactionFile.FactionData factionData)
Parameters
Type Name Description
Int32 factionId

faction id for the new faction

FactionFile.FactionData factionData

faction data struct for new faction, including child list

Returns
Type Description
Boolean

true if faction was registered, false if the faction id is already in use

| Improve this Doc View Source

RelinkChildren(Dictionary<Int32, FactionFile.FactionData>)

Relink parent factions to their child faction.

Declaration
public static void RelinkChildren(Dictionary<int, FactionFile.FactionData> dict)
Parameters
Type Name Description
Dictionary<Int32, FactionFile.FactionData> dict
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX