Morality System
UACFMoralityComponent handles a character's morality by tracking points assigned to different moral alignments, defined via GameplayTags.
It must be attached to the Player Controller.
Main Features
Track morality points for multiple alignments.
Retrieve or modify morality values in Blueprint or C++.
Identify the current dominant moral alignment.
Fully replicated over the network.
Event system (
OnMoralityChanged) to react to changes.
Key Functions
AddMoralityPoint(FGameplayTag Alignment, float Points)
Adds points to a specific alignment. Called on the server. Triggers replication and theOnMoralityChangedevent.GetMoralityPoints(FGameplayTag Alignment)
Returns the current number of points for a given alignment. If the tag doesn't exist, returns 0.GetMoralityAlignment()
Returns theGameplayTagwith the highest number of morality points. If no points are assigned, returns an empty tag.ResetMorality()
Clears all morality points. Useful for wiping the player's moral state at certain story beats.
Quest & Dialogue Integration:
You can use the provided AGSAction to provide morality points during Quests and Dialogues, see the picture below:
