Capabilities

'Capabilities' are the concept of certain players, or groups of players, having sets of permissions. This is often tied into the Roles system to give special abilities to 'admin' players in a world (for example presenters in a live experience, moderators or QA), or could be used to enable certain player features at the right time (for example the ability to fire a weapon once a round has started).

Capabilities are a set of server-authoritative Gameplay Tags for each player, replicated and queried with the JM_CapabilitiesComponent. Capabilities are only replicated to the owning Morpheus Actor, so are not visible to other players.

Usage

Granting and removing

Ensure the player's Morpheus Actor contains a JM_CapabilitiesComponent. On the server, grant capabilities either individually or as a set:

Capabilities are reference counted, or 'stacked', meaning that if the same capability is granted twice (e.g. by two different systems) then the player will still have that capability until it has been removed twice. Use the equivalent RemoveCapability or RemoveCapabilities nodes to remove.

Once granted or removed, capabilities are replicated to the controlling client. Gameplay actions can be gated on capabilities by using any of the these functions:

Suppression

Capabilities can be 'suppressed' on the server, using the same capability stack concept. If a capability is suppressed then it will be removed from the player, regardless of how many stacks of that capability the player may have. This can be used for temporarily disabling a capability while not interfering with other systems, for example muting all players while a custscene occurs in a live event.

Responding to Capability changes

Bind to the OnCapabilityAdded, OnCapabilityRemoved and OnCapabilitiesUpdated events to respond to changes. OnCapabilitiesUpdated will be called both when capabilities are added or removed.

Last updated

Was this helpful?