Skip to content

Faction Subsystem

The Faction Subsystem is used as a Fa├žade to the Faction Database and the Attitude Solver classes configured in the project.

These classes are not meant to be directly exposed as they mostly represent inner workings of system and instead, consumer objects such as the Faction Component or Faction Widget are meant to interact with this Subsystem instead.

Accessing the Subsystem

You can access the Faction Subsystem the same way you would access any other Subsystem in Unreal Engine: In Blueprints, you can request access to the Faction Subsystem and in C++, you would be able to retrieve it through the Game Instance.

Accessing the Faction Subsystem

// Sample retrieved from the Faction Component.
UNinjaFactionSubsystem* UNinjaFactionComponent::GetFactionSubsystem() const
{
    return GetWorld()->GetGameInstance()->GetSubsystem<UNinjaFactionSubsystem>();
}
Faction Component

You can also access the subsystem from the Faction Component.

Available Functions

Function Description
GetFactions Retrieves all Faction Data Assets provided by the Database.
GetFaction Retrieves a specific Faction Data Asset.
GetFactionComponent Retrieves the Faction Component from a member.
GetReputationTiers Retrieves all Reputation Tiers provided by the Database.
GetReputationTier Retrieves a specific Reputation Tier by Reputation.
GetReputationTierByName Retrieves a specific Reputation Tier by its Unique Name.
GetAttitude Determines an attitude between members, using the Solver.