How the faction system works for Miscreated servers
Before starting, please navigate to 'Gaming' > 'Game Servers' > 'Details' of the server you wish to edit > 'Config editor'
The options discussed here can be placed in the 'hosting.cfg' file
The faction system will only work if you set your server to 'Whitelisted only'
Miscreated Faction System
The faction system can support a multitude of scenarios like PVE, factions, or role play.
Players, mutants/animals and bases have each already been assigned to a builtin faction
and the damage caused between those factions is controlled in detail by a damage multiplier
matrix described in the following sections.
Players can also join additional defined factions by issuing a chat command that is the name of the faction
(in the faction example below it would be !lawmen or !outlaw since those are the defined names for factions)
After a faction is joined it can't be left until a server restart. A player's current faction can be determined with
the chat command "!faction".
Server administrators can fully customize the factions by turning them on/off, the damage amounts,
faction names, and faction access based on Steam IDs.
Up to 4 additional factions can be defined. By default two are already predefined: lawmen and outlaw -
each of those can be redefined by the server administrator.
Faction Definition
Special builtin faction indexes: (builtin factions can't be disabled)
The indexes will be used in some of the following commands
0 - players (without an assigned faction)
1 - environment (mutants, animals, etc)
2 - bases
To use a player faction they must be enabled, like in the following example
g_gameRules_faction3=1 (activate first additional faction - faction index 3)
g_gameRules_faction4=1 (activate second additional faction - faction index 4)
g_gameRules_faction5=1 (activate third additional faction - faction index 5)
g_gameRules_faction6=1 (activate fourth additional faction - faction index 6)
Once each player faction is enabled then you can define additional settings and rules for them
In the following examples [0-6] means to specify one of the faction indexes.
g_gameRules_faction_name[0-6]="factionname"
Sets the faction's name and chatcommand keyword to join that faction.
Each faction name must be unique.
g_gameRules_faction[3-6]_steamids="123456;1234567;..."
By default anyone can join a faction, but it can restricted by adding a semicolon separated
list of 64-bit Steam IDs
g_gameRules_faction[0-6]_dmg_f[0-6]=1.0
By default every faction does normal damage to every other faction, but a damage multiplier
can be specified for any combination of factions - it's a 7x7 damage multiplier matrix.
As examples, you could use the following values on the right side of the equals sign to
scale the default damage done between to two specified factions:
0.0 no damage
0.5 means half damage
1.0 normal damage
2.0 double damage
The faction system allows, as one example, a PVE server with the following rules:
- players can't damage each other and bases
- players can join a outlaw or lawmen faction
- outlaw and lawmen can fight each other while the other players are unaffected
- lawmen can't damage each other
- players can damage outlaws but not lawmen
- outlaws could be allowed to damage bases while lawmen can't
- the environment can damage anyone (and to increase difficulty player damage to them can be halved while damage to players could be doubled)
- messages for deaths and join/disconnect
The following added to the hosting.cfg configures all of the above settings:
------------------------------------------------
-- Example section to add to hosting.cfg file (PVE with outlaw and lawmen) --
------------------------------------------------
-- lawmen need to join the faction with !lawmen chat command
-- outlaw need to join the faction with !outlaw chat command
-- default (no faction assigned) players can't damage each other and bases
g_gameRules_faction0_dmg_f0=0.0
g_gameRules_faction0_dmg_f2=0.0
-- players can join an outlaw or lawmen faction
g_gameRules_faction3=1
g_gameRules_faction3_name="lawmen"
g_gameRules_faction4=1
g_gameRules_faction4_name="outlaw"
-- outlaw and lawmen can fight each other while the unassigned players are unaffected
g_gameRules_faction3_dmg_f0=0.0
g_gameRules_faction3_dmg_f4=1.0
g_gameRules_faction4_dmg_f0=0.0
g_gameRules_faction4_dmg_f3=1.0
-- lawmen can't damage each other
g_gameRules_faction3_dmg_f3=0.0
-- players can damage outlaws but not lawmen
g_gameRules_faction0_dmg_f3=0.0
g_gameRules_faction0_dmg_f4=1.0
-- outlaws could be allowed to damage bases while lawmen can't
g_gameRules_faction3_dmg_f2=0.0
g_gameRules_faction4_dmg_f2=1.0
-- environment can damage anyone (and to increase difficulty player damage to them can be halfed while damage to players could be doubled)
g_gameRules_faction0_dmg_f1=0.5
g_gameRules_faction3_dmg_f1=0.5
g_gameRules_faction4_dmg_f1=0.5
g_gameRules_faction1_dmg_f0=2.0
g_gameRules_faction1_dmg_f3=2.0
g_gameRules_faction1_dmg_f4=2.0
-- messages for deaths and join/disconnect
sv_msg_conn=1
sv_msg_death=1
-- to allow only specific players to join the lawmen group do the following:
-- the following would only allow the Steam IDs of Miscreated and MrsMiscreated to join the lawmen faction
g_gameRules_faction3_steamids="76561198082291600;76561198136157752"
-- uncomment if wanted: allow bases to be built everywhere
-- (if abused you can define a access restricted faction with a high damage multiplier to clean them up)
-- g_gameRules_bases=2