Skip to content

Creating a Parameter Effect

Parameter effects let viewers choose a quantity, an option, a color, or an integer range. In the current Blueprint API, define them with SetupParameterEffect and handle them through OnParameterEffectTrigger.

Create the Effect Definition

From OnSessionReady, create an FCrowdControlParameterEffectInfo and call Setup Parameter Effect.

Fill in the base fields:

  • id: unique lowercase ID with no spaces,
  • displayName,
  • description,
  • price,
  • category.

Optional Quantity

Enable RequiresQuantity and set the inclusive quantity range when viewers should choose how many times the effect is applied. The default range is 1 through 99.

A quantity parameter effect with an inclusive range from 1 to 100

Option Parameter

Use Make Option Parameter from UCrowdControlFunctionLibrary.

  1. Choose a stable parameter ID, such as color.
  2. Set its viewer-facing name, such as Color.
  3. Set the type to OPTIONS.
  4. Add FCrowdControlParamOption values. Each option needs a stable id and a viewer-facing DisplayName.
  5. Add the resulting parameter to the effect's parameters array.

Example option IDs might be red, green, and blue. Use the IDs, not the display labels, in gameplay logic.

An options parameter effect with red, green, and blue choices

Integer Range Parameter

Use Make Min Max Parameter with a parameter ID and inclusive integer bounds. The helper creates a MinMax parameter and uses the ID as its name.

Hex Color Parameter

Create an FCrowdControlParameter with:

  • _id set to the stable parameter ID,
  • name set to the viewer-facing name,
  • type set to HexColor.

The request value is a hexadecimal color string.

Bind the Trigger

Bind OnParameterEffectTrigger once, preferably before registering the effect. The delegate provides:

  • ID: request ID,
  • DisplayName,
  • OptionalQuantity: quantity as a string in this delegate,
  • Params: FJsonObjectWrapper containing selected parameter IDs and values,
  • EffectID,
  • ViewerName.

Branch on EffectID, read the expected values from Params, validate them, and then apply the effect.

TIP

OnEffectRequestReceived also reports quantity as an int32 for notifications, but it does not contain the full parameter object and does not replace the trigger delegate.

Respond to the Request

Every trigger requires one response using ID:

  • Effect Success or Effect Success With Message
  • Effect Failure Temporary when the current game state prevents the effect
  • Effect Failure Permanent when the request can never be valid

Use a failure message to tell the viewer why the request was rejected. You may respond after asynchronous work completes, but retain the correct request ID and respond exactly once.

Component Limitation

UCrowdControlEffectComponent can receive quantity and parameter JSON when a matching request is routed to it, but its Blueprint registration path currently creates only instant or timed definitions. Use SetupParameterEffect plus the global parameter delegate for a Blueprint-only parameter effect.

C++ integrations can register a parameter definition and route it to a component with RegisterEffectComponent.

Test Cases

Before submission, verify:

  • every option ID is handled,
  • range boundaries are accepted,
  • malformed or missing parameter data produces a failure response,
  • quantity scaling does not overflow or bypass gameplay limits,
  • every branch sends exactly one response.

Continue with Starting a Session and Testing Effects.