Guilds & Alliances
Redwood comes with a Guilds & Alliances system which are meant to group players and provide a mechanism to enable your custom game logic which leverages guild and/or alliance membership.
The guilds & alliances system is hosted within the Director rather than the Realm, which means your guilds/alliances are the same no matter which Realm you're connected to or the character you're using.
info
The RPG Template (as of 4.0) comes with a great example of the guilds & alliances system.
Config
You can override any of the guild/alliance config in game.yaml:
guilds:
# Whether any of the guild features are enabled.
enabled: true
# Allow players to create guilds; set to false if your game
# either has no guilds or if you want to manage guilds
# yourself.
# If set to false, guild creation will need to be done with
# an admin account (via the CLI, dashboard, or using the normal API).
allow-guild-creation: true
# The maximum number of guilds a player can be part of.
max-guilds-per-player: 1
# Tags are short-handed representations of the guild.
# e.g. "[TAG] Character Name"
tags:
allow:
casing:
force: "upper" # false | "upper" | "lower"
lower: false # ignored if force-casing is set to "upper"
upper: false # ignored if force-casing is set to "lower"
numbers: true
# set to false to disable special characters; setting to true does nothing; provide an array of allowed special characters
special:
- "_"
length:
min: 2 # must be set to >= 1
max: 4 # must be set to <= 10 and >= min
alliances:
# Whether any of the alliance features are enabled.
enabled: true
# Allow guilds to create alliances; set to false if your game
# either has no alliances or if you want to manage alliances
# yourself (i.e. the game only has 3 overall factions).
# If set to false, alliance creation will need to be done with
# an admin account (via the CLI, dashboard, or using the normal API).
# Alliance updates and any admin actions in alliances will need to be done
# with an admin account as well.
allow-alliance-creation: true
# Increase this number if you want to allow guilds to be in
# multiple alliances.
max-alliances-per-guild: 1
Unreal Functions
The main functions for the Guilds & Alliances system are available via the URedwoodClientGameSubsystem in the plugin:
Guilds
ListGuilds- List the public (akalisted) guilds or the current player's guildsSearchForGuilds- Search for a public guild by its nameGetGuild- Get a guild's details by providing its IDGetSelectedGuild- Get the current player's selected guildSetSelectedGuild- Set the current player's selected guildJoinGuild- Current player joins a guild if the guild is public or the current player is already invitedInviteToGuild- Invite a player to a guildLeaveGuild- Current player leaves a guildListGuildMembers- List the members of a guild if the current player is in it or if the guild islisted/public and hasmembershipPublicset totrueCreateGuild- Create a new guild and become its first adminUpdateGuild- (Admin) Update a guild's detailsKickPlayerFromGuild(Admin) Remove a player from a guildBanPlayerFromGuild(Admin) Remove and/or ban a player from a guildUnbanPlayerFromGuild(Admin) Unban a player from a guild; this does not add/invite themPromotePlayerToGuildAdmin(Admin) Promote an existing guild member to be a guild adminDemotePlayerFromGuildAdmin(Admin) Demote a guild admin to a normal guild member
Alliances
ListAlliances- List all alliancesSearchForAlliances- Search for an alliance by its nameCanAdminAlliance- Whether the current player can administrate an allianceCreateAlliance- Create a new alliance with an initial guild (must be an admin of that guild)UpdateAlliance- (Admin) Update an alliance's detailsKickGuildFromAlliance- (Admin) Remove a guild from an allianceBanGuildFromAlliance- (Admin) Remove and/or ban a guild from an allianceUnbanGuildFromAlliance- (Admin) Unban a guild from an alliance; this does not add/invite themListAllianceGuilds- List the guilds in an allianceJoinAlliance- Join a public alliance or one that you've been invited to (must be an admin of that guild)LeaveAlliance- Leave an alliance (must be an admin of that guild)InviteGuildToAlliance- (Admin) Invite a guild to an alliance