NPCGuildTemplate - jimdroberts/FishMMO GitHub Wiki
ScriptableObject template for defining NPC guilds, their icon, description, archetypes, and requirements. Used to configure guilds that NPCs can belong to or interact with in FishMMO.
-
public Sprite Icon
The icon representing the guild in UI.
-
public string Description
Description of the guild and its purpose.
-
public List Archetypes
List of archetypes associated with this guild.
-
public BaseCondition GuildRequirements
Requirements that a player must meet to join or interact with this guild.
-
public string Name { get; }
The name of the guild, derived from the asset name.
-
public bool MeetsRequirements(IPlayerCharacter playerCharacter)
Checks if the given player character meets the guild's requirements. Returns true if requirements are met or if no requirements are set. Parameters:
-
playerCharacter
(IPlayerCharacter): The player character to evaluate.* Returns: bool — True if requirements are met, false otherwise.
-
- Create a new
NPCGuildTemplate
ScriptableObject in the Unity Editor. - Assign an icon, description, and list of archetypes in the Inspector.
- Set up any
GuildRequirements
using aBaseCondition
ScriptableObject. - Reference the template in NPC or guild-related systems.
// Example 1: Checking if a player meets guild requirements
NPCGuildTemplate guild = ...; // Reference to the ScriptableObject
iPlayerCharacter player = ...; // Reference to the player character
if (guild.MeetsRequirements(player))
{
// Player can join or interact with the guild
}
- Use descriptive names and icons for each guild to improve UI clarity.
- Define clear and consistent requirements for joining or interacting with guilds.
- Organize archetypes logically within each guild for better gameplay balance.
- Use the
MeetsRequirements
method to centralize requirement checks in gameplay logic.