Skip to main content
forge-gameplay-rules is a thin, testable wrapper over HELIX’s native gameplay-rules system (HGameplayRulesetComponent, which lives on the GameState). Rules are tag-based (GameplayRule.* tags), either toggle (bool) or scalar (number). Base values are authored per-experience; this package exposes server-authoritative runtime overrides behind FORGE’s Result convention. Its first consumer is forge-health, which toggles the downed state and auto-respawn at boot.

Concepts

  • Toggle vs scalar. A rule is a boolean flag or a number. Read with a default; override at runtime.
  • Overrides are server-only and reversible. Override* sets a value; ClearOverride / ClearAll restores the experience’s base value.
  • Reads are always safe. If the ruleset component isn’t up yet (no GameState), a read returns the supplied default with source = "default" rather than failing.

Exports

Well-known tags

Creators may read or override any GameplayRule.* tag, not just these.

Result codes

Three UnLua traps this package handles for you, worth knowing if you call the native component directly:
  1. World context must be a live player controller. GetGameState(HWorld) returns nil from server Lua; the component is resolved via an active controller’s world context instead.
  2. Class is UE.UHGameplayRulesetComponent (the U prefix matters).
  3. A tag must be a real FGameplayTag, built as local t = UE.FGameplayTag(); t.TagName = name. Passing a raw string silently no-ops (“userdata needed but got string”).

Configuration

Set Enabled = false to register the service inert (all overrides then reject). Ships no content.