Skip to content

Creating a Basic Effect

UCrowdControlEffectComponent is the simplest way to build instant and timed effects. One component owns one effect's menu metadata, request routing, response, and timed lifecycle.

Create an Effect Blueprint

Create a Blueprint subclass of the component so its trigger function can be overridden:

  1. In the Content Browser, select Add > Blueprint Class.
  2. Expand All Classes, search for CrowdControlEffectComponent, and select it as the parent class.
  3. Name and open the new component Blueprint.
  4. Select Class Defaults and configure:
PropertyMeaning
Effect IDStable, unique pack ID. Use lowercase with no spaces, for example forcejump.
Display NameViewer-facing name, for example Force Jump.
DescriptionShort explanation shown in the menu.
PriceDefault coin price; minimum 1.
CategoriesMenu category names.
Duration0 for an instant effect. Timed effects are covered separately.
Auto RegisterDisable this for actors already present when the game starts; register from OnSessionReady.

The editable Crowd Control fields on an unconfigured effect component

The image shows the component's initial fields. Supply the effect metadata for your game and, for a level-placed owner, clear Auto Register before continuing.

  1. Open the Actor Blueprint that should own the effect.
  2. Select Add Component, search for the new component Blueprint by name, and add it.

Keep the owning actor alive for as long as the effect should be routable. Adding the base component directly to an Actor exposes its settings, but its overridable functions belong to the component and cannot be implemented in the owning Actor's Event Graph.

Register the Component

In the object that handles OnSessionReady, call Register on the component. Registration:

  1. builds an FCrowdControlEffectInfo (or timed info when Duration is positive),
  2. calls the subsystem's setup function, and
  3. maps the effect ID to this component for trigger routing.

If the component is spawned after IsInitialized is already true, its default Auto Register behavior can be used instead.

Implement On Effect Triggered

Open the component Blueprint. In My Blueprint > Functions, open the Override menu and select OnEffectTriggered. The same menu contains the timed lifecycle functions.

The Override menu in a CrowdControlEffectComponent Blueprint

The override receives:

  • RequestID: unique request ID used for responses,
  • Quantity: viewer-selected quantity, or the default quantity,
  • Parameters: JSON object containing parameter selections,
  • ViewerName: display name of the viewer; it may be empty for tests.

Apply the gameplay change and return one ECrowdControlEffectResult:

A minimal OnEffectTriggered component override returning Success

The minimal graph above accepts the request but does not change gameplay. Add the effect's gameplay nodes before the Return Node.

ResultUse
SuccessThe effect ran. The component reports success automatically.
Fail TemporaryThe effect cannot run now. Crowd Control may retry it and the viewer is not charged for a failed request.
Fail PermanentThis request can never run successfully and must not be retried.
PendingWork continues asynchronously; no response is sent yet.

For Pending, eventually call exactly one of:

  • Complete Success
  • Complete Fail Temporary with a viewer-facing message
  • Complete Fail Permanent with a viewer-facing message

Do not also call the subsystem's response functions for a request that the component answers automatically.

Show a Purchase Notification

Bind OnEffectRequestReceived on the subsystem to show messages such as “Viewer sent Force Jump!” It fires before routing for every request, including component-handled effects.

This event is informational. The component or global delegate still has to answer the request.

Control Menu State

Call these functions on the component after registration:

  • Set Visibility shows or hides the effect.
  • Set Availability enables or disables purchases.

Visibility and availability are independent. For example, a boss effect can remain visible but unavailable before the encounter, or be hidden entirely.

For multiple manually registered effects, the subsystem also provides:

  • ShowEffectsByIDs / HideEffectsByIDs
  • EnableEffectsByIDs / DisableEffectsByIDs

An empty ID array applies those bulk functions to all registered effects.

Reuse an Implementation with Clones

After the source effect is registered and the subsystem is initialized, call Clone Effect or Clone Effect to IDs. Requests retain the cloned destination ID but route to the source component.

Destination IDs must be non-empty, unique, and not already registered. CloneEffectToIDs is atomic: if the DLL rejects the set, none of the requested clones are added.

Branch on the node's Boolean return value so invalid IDs, incorrect registration order, or an incompatible native DLL are visible during setup. See Clone Registered Effects for the complete Blueprint workflow.

Next Steps