Faction System
Last updated
Last updated
Universal Monster comes with a true Faction System that is capable of tracking dynamic reputations between an unlimited number of factions. You setup the initial reputation values and then use the faction functions to change the reputations during gameplay. You could allow your players and AI to go from having a friendly status to a hated status depending on the choices they make. Dialogue choices and quests can be setup to award positive or negative reputation, as well as defeating allies or enemies. You decide when to use the functions so that it can be setup in any way you desire.
Faction Reputations are initially setup in the DT_UMFactions data table. It is recommended you duplicate his data table and rename/move it so that future UM updates do not overwrite your Faction System configuration. By default, Reputations are in the range of -4.0 to +4.0 and each multiple of 1 represents a different Faction State.
Faction Name: The name of the Faction. Is Player Faction?: Is this Faction used for players? Reputations: Array of floats that represent this Faction's attitude towards the other Factions. Default Reputation: The reputation to start with for newly added Factions.
The indices in the Reputations array represent each Faction in the exact order they are arranged within the data table. In the image above, index 0 would represent the Passive faction while index 6 would represent the Test3 faction.
Faction States are stored in the E_FactionState enum. Feel free to change the names, add new Faction States or remove Faction States. You must have the same number of positive Faction States as you have negative Faction States and they must go in order from highest Reputation to lowest Reputation with a neutral Faction State of in the middle.
The Faction System functions must run on the server. You can use these functions to add/remove factions, change factions and adjust faction reputations.