Limen Framework 0.1 Help

ULimenCreditsComponent

Overview

ULimenCreditsComponent is a custom actor component that manages credits for an actor. It provides functionality to deposit and withdraw credits, as well as retrieve the current credit balance. The component supports replication of credit changes across the network, making it suitable for multiplayer games where credit balances need to be synchronized between clients.

Properties

Type

Name

Access

Description

FCreditsUpdate

OnCreditsUpdated

BlueprintAssignable

A multicast delegate that is triggered when credits are updated.

bool

bAllowNegativeBalance

EditDefaultsOnly, BlueprintReadOnly

Determines if negative credit balances are allowed.

uint64

StartingCredits

EditDefaultsOnly

The initial number of credits the component starts with.

float

Multiplier

Private

A multiplier applied to deposited credits.

uint64

CurrentCredits

ReplicatedUsing=OnRep_CurrentCredits, Transient

The current number of credits, replicated across the network.

Functions

Return Type

Signature

Description

void

DepositCredits(const int64 NewCredits)

Deposits a specified amount of credits into the component's balance.

bool

WithdrawCredits(const int64 OutCredits)

Attempts to withdraw a specified amount of credits from the component's balance. Returns true if successful, false otherwise.

FString

GetCreditsString() const

Returns the current credit balance as a formatted string.

int64

GetCredits() const

Returns the current credit balance as an integer.

void

SetStartingCredits(const int32 NewStartingCredits)

Sets the initial number of credits for the component.

void

SetCreditsMultiplier(const float NewMultiplier)

Sets a multiplier that is applied to deposited credits.

void

CreditsUpdated()

Broadcasts the OnCreditsUpdated delegate with the current credit balance and its string representation.

void

OnRep_CurrentCredits()

Handles replication of the CurrentCredits property, broadcasting the OnCreditsUpdated delegate if the value changes.

Usage & Implementation Notes

  • Threading Constraints: This component is designed to be used on the game thread.

  • Replication Requirements: The CurrentCredits property is replicated using REPNOTIFY_OnChanged, ensuring that credit changes are synchronized across the network.

  • Memory Lifetime Management: The CurrentCredits property is marked as Transient, meaning it will not be saved or loaded from disk. It is only relevant during gameplay.

  • Initialization Dependencies: The component must be attached to an actor with authority, as it performs operations that require server-side control (e.g., depositing and withdrawing credits).

22 May 2026