Limen Framework 0.1 Help

ALimenGameModeBase

Overview

ALimenGameModeBase is a custom game mode class that extends AGameModeBase. It manages various aspects of the game, including player management, manager registration, and level streaming. This class ensures that all necessary managers are properly initialized and maintained throughout the game's lifecycle.

Properties

Type

Name

Access

Description

FGamePauseDelegate

OnGamePauseStateChanged

Public

A delegate that is called when the game pause state changes.

Functions

Return Type

Signature

Description

void

InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage)

Initializes the game mode with the specified map and options. Sets up managers and handles initial level streaming.

void

PostLogin(APlayerController* NewPlayer)

Called when a player logs in. Adds the player to the game state and sets up client readiness notifications.

void

Logout(AController* Exiting)

Called when a player logs out. Removes the player from the game state.

bool

SetPause(APlayerController* PC, FCanUnpause CanUnpauseDelegate = FCanUnpause())

Pauses the game and broadcasts the pause state change using the delegate.

bool

ClearPause()

Clears the pause state and broadcasts the pause state change using the delegate.

void

Tick(float DeltaSeconds)

Ticks the game mode, calling TickGameState if the game state is valid.

ALimenGameStateBase*

GetLimenGameState()

Retrieves the current instance of ALimenGameStateBase.

template<typename T>

T* GetManager() const

Retrieves a manager of type T from the list of managers.

template<typename T>

TArray<T*> GetManagers() const

Retrieves all managers of type T from the list of managers.

void

ResetManagers()

Resets all registered managers.

bool

IsInitialLevelStreamingComplete() const

Checks if all initial level streaming is complete.

template<typename ManagerClass>

void RegisterActorWithManager(AActor* Actor, const FGameplayTag& Id)

Registers an actor with a manager of type ManagerClass.

Usage & Implementation Notes

  • Threading Constraints: This class does not have any specific threading constraints.

  • Replication Requirements: None.

  • Memory Lifetime Management: Managers are managed using weak pointers to avoid memory leaks. The ResetManagers function resets all managers, ensuring proper cleanup.

  • Initialization Dependencies: The game mode depends on the presence of various manager classes and player controller classes. Ensure these classes are properly defined and initialized before using this game mode.

22 May 2026