Skip to content

Kingdoms

Notes

Kingdom can exist without owning a Town. Castle is enough.

With the existing Culture to create a Kingdom it is necessary to have:

  • Castle or Town
  • 1 Clan - the owner of the Castle/Town
  • 1 Lord - the owner of the Clan/Kingdom

XML info on relations here.

Not necessary:

  • Spouse
  • Dead lords

All Kingdoms

foreach (Kingdom kingdom in Kingdom.All) { // do smthg }

Strength

float       TotalStrength [get]

Enemy kingdoms

IEnumerable<Kingdom> FactionManager.GetEnemyKingdoms(Kingdom faction)

// gives bandits, minor factions also
IEnumerable<IFaction> FactionManager.GetEnemyFactions(IFaction faction)

Check stance

bool FactionManager.IsAtWarAgainstFaction(IFaction faction1, IFaction faction2)
bool FactionManager.IsAlliedWithFaction(IFaction faction1, IFaction faction2)
bool FactionManager.IsNeutralWithFaction(IFaction faction1, IFaction faction2)

Set stance

void FactionManager.DeclareAlliance(IFaction faction1, IFaction faction2)
void FactionManager.DeclareWar(IFaction faction1, IFaction faction2, bool isAtConstantWar = false)
void FactionManager.SetNeutral(IFaction faction1, IFaction faction2)

Policies

Can be set in spkingdoms.xml

<policies>
    <policy     id="policy_royal_guard" />
</policies>

Full list here

In the code:

public class DefaultPolicies

LandTax
StateMonopolies
SacredMajesty
Magistrates
DebasementOfTheCurrency
PrecarialLandTenure
CrownDuty
ImperialTowns
RoyalCommissions
RoyalGuard
WarTax
RoyalPrivilege
Senate
LordsPrivyCouncil
MilitaryCoronae
FeudalInheritance
Serfdom
NobleRetinues
CastleCharters
Bailiffs
HuntingRights
RoadTolls
Marshals
CouncilOfTheCommons
ForgivenessOfDebts
Citizenship
TribunesOfThePeople
GrazingRights
Lawspeakers
TrialByJury
Cantons

Add a policy:

kingdom.AddPolicy(DefaultPolicies.RoyalGuard);

Remove a policy:

kingdom.RemovePolicy(DefaultPolicies.RoyalGuard);

Check if kingdom has policy

if (kingdom.HasPolicy((DefaultPolicies.RoyalGuard) {}
if (Kingdom.ActivePolicies.Contains(DefaultPolicies.CastleCharters))) {}

Find a Kingdom

public static Kingdom FindKingdomByStringID(string stringID)
{
    foreach (Kingdom kingdom in Kingdom.All)
    {
        if (kingdom.StringId == stringID)
        {
            return kingdom;
        }
    }
    return null;
}