LootLocker
The BasicsGame SystemsContent ManagementPlayer Management
LootLocker
  • 📌The Basics
    • Getting Started
    • What is LootLocker?
    • Core Concepts
      • Players
      • Assets
      • Character Classes
      • API Types
      • Web Console
      • Stage & Live Environments
      • Glossary
    • Unity Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • Unreal Quick Start
      • Install & Configure the SDK
        • Older versions
      • Authenticate Your First Player
    • Godot Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • SDKs
    • Samples
      • Authentication Samples
      • Leaderboard Samples
      • Progression Samples
      • Player Samples
    • Launching Your Game
    • Support
      • Error Codes
      • Unreal Marketplace Plugin Support
  • 🎭Players
    • Overview
    • Authentication
      • How To
        • Guest Login
        • Steam
        • Apple
        • Apple Game Center
        • Google
        • Epic Games
        • PlayStation
        • Meta / Oculus
        • Xbox
        • Nintendo Switch
    • Files
      • How To
        • Manage Files in Web Console
        • Work with Files In-Game
    • Inventory
      • How To
        • Work with Player Inventory
    • Messages
      • How To
        • Configure Messages in Web Console
    • Names
      • How To
        • Work with Player Names
    • Player Manager
      • How To
        • Manage Players through Web Console
        • Manage Players In-Game
        • Use Player Operations
    • Unified Player Accounts
      • How To
        • Configure UPA in Web Console
        • Use Remote Login In-Game
        • Connect Identiy Provider to Player
        • External Provider Linking
        • Transition from Guest Login to Other Provider
        • Disconnect Identity Provider from Player
    • White Label Login
      • How To
        • Configure White Label Login
        • Create a New White Label User
        • Request User Verification
        • Handle Returning Users
        • Start a White Label Session
  • 🪙Commerce
    • Overview
    • Catalogs
      • How To
        • Configure Catalogs in LootLocker Console
        • List all Catalogs
        • Use Catalogs In-Game
        • Setup In-Game Store
    • Currencies
      • How To
        • Configure a Currency in Web Console
        • Use Currencies In-Game
    • DLC Management
      • How To
        • Configure DLC in Web Console
        • Use DLC In-Game
    • Entitlements
      • How To
        • Work with Entitlements In-Game
    • Real Money Purchases
      • How To
        • Configure In-App Purchase in Web Console
        • Make Purchases through Google Play Store
        • Make Purchases through Apple Store
        • Make Purchases through Steam Store
    • Virtual Purchases
    • Wallets
      • How To
        • Manage a Wallet in Web Console
        • Use Wallets In-Game
  • ⚔️Content
    • Overview
    • Assets
      • How To
        • Create & Configure an Asset
        • Organize & Search for Assets
        • Retrieve Assets In-Game
        • Set up Asset Storage Template
        • Check Grant Notifications
        • Set up a Game Config Asset
        • Create a Loot Box
        • Work with Loot Boxes In-Game
        • Create a Drop Table
        • Work with Drop Tables In-Game
        • Create a Rental Asset
        • Work with Rental Assets In-Game
    • User Generated Content (UGC)
      • How To
        • Create UGC In-Game
    • Twitch Drops
  • 🕹️Game Systems
    • Overview
    • Classes & Heroes
      • How To
        • Base Classes
        • Hero Classes
        • Implement Classes In-Game
        • Implement Heroes In-Game
    • Leaderboards
      • How To
        • Configure Leaderboard in Web Console
        • Use Player Leaderboards
        • Use Generic Leaderboards
        • Use Metadata to Store Additional Information
        • Use Scheduled Reset with Rewards
        • Use Leaderboards for Time Based Rankings
      • Leaderboard FAQ
      • GameMaker References
    • Feedback
      • How To
        • Manage Feedback Categories
        • Create Player Feedback
        • Create UGC Feedback
        • Create Game Feedback
        • View and Manage Feedback
    • Progressions
      • How To
        • Create a Progression
        • Game Progressions
        • Player Progressions
        • Class Progressions
        • Asset Instance Progressions
    • Triggers
      • How To
        • Setup a trigger in the Web Console
        • Invoke trigger from game
  • ⛓️Shared Systems
    • Overview
    • Metadata
      • How To
        • Add Metadata in Console
        • Fetch a Single Metadata In-Game
        • Fetch Metadata In-Game by Tags
        • Fetch Metadata In-Game from Multiple Sources
    • Notifications
      • How To
        • List Notifications and Mark as Read In-Game
  • 🗝️Admin
    • Settings
    • User Settings
    • Organization Settings
    • CORS Allowlist
  • ⭕️ Legacy
    • Deprecations
      • Unity SDK Deprecation Log
        • Version 2.1.5 - Migration to Open UPM
        • Version 2.0.0
      • Unreal SDK Deprecation Log
        • Version 4.0.0
        • Version 3.0.0
    • Legacy Storage
    • Legacy Triggers
      • Activate a trigger
      • Create a trigger
    • Legacy Progressions
      • Create a Progression System
      • Use a Progression System In-Game
Powered by GitBook
On this page
  • Retrieving Class Progressions
  • Interacting with Class Progressions
  1. Game Systems
  2. Progressions
  3. How To

Class Progressions

PreviousPlayer ProgressionsNextAsset Instance Progressions

Last updated 1 year ago

Class progressions are progressions that the Class is currently on, your game may have many progressions but the Class doesn't necessarily progress through all of them at a given time, some may need to be unlocked or may be mutually exclusive.

Starting a Class on a progression is as easy as just starting to add points to it. That progression will then be listed when retrieving progressions for that Class.

Retrieving Class Progressions

Retrieving a single Class Progression using the progression key

int characterId = 1;
string progressionKey = "mage";

LootLockerSDKManager.GetCharacterProgression(characterId, progressionKey, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }
    
    // Output the character level and show how much points are needed to progress to the next tier
    Debug.Log($"The character is currently level {response.step}");
    if (response.next_threshold != null)
    {
        Debug.Log($"Points needed to reach next level: {response.next_threshold - response.points}");
    }
});

Above is an example of how to implement retrieval of a single character progression using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or xp gain.

Progression Key is required for this node so connect it from a variable or remove the reroute node and hard code a value in the node.

You also need to supply the id of the character for which you want to retrieve the progression.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

The retrieved progression provides the id, key, and name of the progression. It also provides properties that tell you the place in the progression ladder, among that current amount of points, the previous threshold (points needed to achieve this level), next threshold (points needed to achieve next level), step (number of points between levels), as well as the date of the last level up.

Retrieving all Class Progressions

int characterId = 1;

LootLockerSDKManager.GetCharacterProgressions(characterId, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }

    // Output the character level and show how much points are needed to progress to the next tier for all character progressions
    foreach (var characterProgression in response.items)
    {
        Debug.Log($"Current level in {characterProgression.progression_name} is {characterProgression.step}");
        if (characterProgression.next_threshold != null)
        {
            Debug.Log($"Points needed to reach next level in {characterProgression.progression_name}: {characterProgression.next_threshold - characterProgression.points}");
        }
    }
});

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or level start.

You also need to supply the id of the character for which you want to retrieve the progression.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

Retrieving Class Progressions using count

Count can be used to limit the number of entries returned.

int characterId = 1;
int count = 20;

LootLockerSDKManager.GetCharacterProgressions(characterId, count, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }

    // Output the character level and show how much points are needed to progress to the next tier for all character progressions
    foreach (var characterProgression in response.items)
    {
        Debug.Log($"Current level in {characterProgression.progression_name} is {characterProgression.step}");
        if (characterProgression.next_threshold != null)
        {
            Debug.Log($"Points needed to reach next level in {characterProgression.progression_name}: {characterProgression.next_threshold - characterProgression.points}");
        }
    }
});

Paginating through Class Progressions

You can use "after" parameter to paginate if the Class is on many progressions.

int characterId = 1;
int numberOfItemsPerPage = 10;
LootLockerPaginatedCharacterProgressionsResponse characterProgressions;

void Start()
{
    LootLockerSDKManager.StartGuestSession(_ =>
    {
        // Fetch the initial character progressions list
        LootLockerSDKManager.GetCharacterProgressions(characterId, numberOfItemsPerPage, response =>
        {
            if (!response.success)
            {
                Debug.Log("Failed: " + response.Error);
            }

            if (response.pagination.total == 0)
            {
                Debug.Log("You character does not have any progressions, start them by giving some exp to the character");
            }

            characterProgressions = response;
        });
    });
}

void Update()
{
    if (characterProgressions == null) return;

    // Fetch the next page if more character progressions exist
    if (Input.GetKeyDown(KeyCode.RightArrow) && characterProgressions.pagination.next_cursor != null)
    {
        LootLockerSDKManager.GetCharacterProgressions(characterId, numberOfItemsPerPage, characterProgressions.pagination.next_cursor, response =>
        {
            if (!response.success)
            {
                Debug.Log("Failed: " + response.Error);
            }
            
            characterProgressions = response;
            Debug.Log($"Paginating right, got {characterProgressions.items.Count} character progressions");
        });
    }
    
    // Fetch the previous page if we are not on the first page
    if (Input.GetKeyDown(KeyCode.LeftArrow) && characterProgressions.pagination.previous_cursor != null)
    {
        LootLockerSDKManager.GetCharacterProgressions(characterId, numberOfItemsPerPage, characterProgressions.pagination.previous_cursor, response =>
        {
            if (!response.success)
            {
                Debug.Log("Failed: " + response.Error);
            }

            characterProgressions = response;
            Debug.Log($"Paginating left, got {characterProgressions.items.Count} character progressions");
        });
    }
}

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or level start.

You also need to supply the id of the character for which you want to retrieve the progression.

To use pagination you should supply a value to the after parameter and optionally a value to the count parameter. For an explanation, see below.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

The response contains a list of progressions. The returned progressions contain the needed information on each progression that you may want to use for display or flow control.

The response also contains pagination data which you use as follows.

Usage example

Understanding pagination for the first time can be a challenge. So an example can help.

Say you have 50 progressions to receive. You can do this with pagination like this:

  1. Trigger the GetCharacterProgressions node with a count parameter of 10.

    1. Use the 10 progression items returned as you want (for example display in the UI). Note that out of your 50 progressions, these are progressions 1-10.

    2. Save the returned pagination data to make the next request. The most important here is the "Next Cursor" property. This is the value that you need to submit to subsequent GetCharacterProgressions calls to "offset" the call to start at the next progression item after the ones you've already received.

  2. Trigger the GetCharacterProgressions node again with a count of 10 but now also input the value "Next Cursor" into the after parameter. This tells the node to start off where it finished last time.

    1. Use the 10 new progression items returned as you want. Note that this time it is progressions 11-20 of your 50 progressions.

    2. Again, save the returned pagination data so that you can make subsequent requests.

  3. Repeat step 2 with new values for "Next Cursor" until you have received all the progressions.

This is how you paginate. It may seem redundant in this example because you could just set Count to 50 and get everything at once. But imagine you have thousands of progressions with rewards of all kinds. Then this system is very valuable.

Interacting with Class Progressions

Adding points to a Class Progression

int characterId = 1;
string progressionKey = "mage";
ulong amountOfPoints = 100;

LootLockerSDKManager.AddPointsToCharacterProgression(characterId, progressionKey, amountOfPoints, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }

    // If the awarded_tiers array contains any items that means the character leveled up
    // There can also be multiple level-ups at once
    if (response.awarded_tiers.Any())
    {
        foreach (var awardedTier in response.awarded_tiers)
        {
            Debug.Log($"Reached level {awardedTier.step}!");

            foreach (var assetReward in awardedTier.rewards.asset_rewards)
            {
                Debug.Log($"Rewarded with an asset, id: {assetReward.asset_id}!");
            }
            
            foreach (var progressionPointsReward in awardedTier.rewards.progression_points_rewards)
            {
                Debug.Log($"Rewarded with {progressionPointsReward.amount} bonus points in {progressionPointsReward.progression_name} progression!");
            }
            
            foreach (var progressionResetReward in awardedTier.rewards.progression_reset_rewards)
            {
                Debug.Log($"Progression {progressionResetReward.progression_name} has been reset as a reward!");
            }
        }
    }
});

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or level start.

You also need to supply the id of the character for which you want to retrieve the progression.

Progression Key is required for this node so connect it from a variable or remove the reroute node and hard code a value in the node.

The node also requires you to supply an amount of points to add to the progression.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

Subtracting points from a Class Progression

int characterId = 1;
string progressionKey = "mage";
ulong amountOfPoints = 10;

LootLockerSDKManager.SubtractPointsFromCharacterProgression(characterId, progressionKey, amountOfPoints, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }
    
    // Output the amount of points the character has after subtracting points
    Debug.Log($"Character now has {response.points} points in {response.progression_name} progression");
});

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or level start.

You also need to supply the id of the character for which you want to retrieve the progression.

Progression Key is required for this node so connect it from a variable or remove the reroute node and hard code a value in the node.

The node also requires you to supply points to subtract from the progression.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

Resetting a Class Progression

Resets the Class Progression points to 0, effectively returning the Class to level 1, if you want to remove the progression from a Class see below.

int characterId = 1;
string progressionKey = "mage";

LootLockerSDKManager.ResetCharacterProgression(characterId, progressionKey, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }
    
    // Character level is now 1 
    Debug.Log($"Character is level {response.step} since the {response.progression_name} was reset");
});

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or level start.

You also need to supply the id of the character for which you want to retrieve the progression.

Progression Key is required for this node so connect it from a variable or remove the reroute node and hard code a value in the node.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

Deleting a Class Progression

Completely removes a Class Progression, it will no longer be listed when retrieving Class Progressions.

int characterId = 1;
string progressionKey = "mage";

LootLockerSDKManager.DeleteCharacterProgression(characterId, progressionKey, response =>
{
    if (!response.success) {
        Debug.Log("Failed: " + response.Error);
    }
    
    // Trying to fetch the deleted character progression will result in a "Not Found" error
    LootLockerSDKManager.GetCharacterProgression(progressionKey, response =>
    {
        if (!response.success) {
            Debug.Log("Failed: " + response.Error);
        }
    }
});

Input

You need to exchange the trigger with an event that you want to trigger the flow. For example a button click or level start.

You also need to supply the id of the character for which you want to retrieve the progression.

Progression Key is required for this node so connect it from a variable or remove the reroute node and hard code a value in the node.

Output

We recommend branching the completed event on the success flag, and if you do this you will probably want to add error handling in case the request fails.

Above is an example of how to implement retrieval of multiple character progressions using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

The response is a list of progressions as well as pagination data (for information on how to use that see ). The returned progressions contain the needed information on each progression that you may want to use for display or flow control.

Above is an example of how to implement retrieval of multiple character progressions supplying a count to limit the number of progressions to receive and supplying a cursor into the after parameter to paginate using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

Above is an example of how to add points to a character progression using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

The response contains the current state of the progression, like when . It also contains a list of all the awards received after the points were added.

Above is an example of how to subtract points from a character progression using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

The response contains the current state of the progression, like when . It also contains a list of all the awards received after the points were subtracted.

Above is an example of how to reset a character progression using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

The response contains the current state of the progression, like when . It also contains a list of all the awards received after the points were subtracted.

Above is an example of how to delete a character progression using blueprints in Unreal Engine. For an example you can copy and paste into your editor, .

🕹️
look here
look here
look here
look here
look here
look here
the section on it
getting a single progression
getting a single progression
getting a single progression
look here
Blueprint example of how to retrieve a single character progression using a progression key. To copy the example, see .
Blueprint example of how to retrieve multiple character progressions. To copy the example, see .
Blueprint example of how to retrieve multiple character progressions. To copy the example, see .
Blueprint example of how to add points to a character progression. To copy the example, see .
Blueprint example of how to subtracting points from a character progression. To copy the example, see .
Blueprint example of how to resetting a character progression. To copy the example, see .
Blueprint example of how to delete a character progression. To copy the example, see .
https://blueprintue.com/blueprint/8ky5so9r/
https://blueprintue.com/blueprint/dcmlm8nc/
https://blueprintue.com/blueprint/cpluomb6/
https://blueprintue.com/blueprint/w9mso2e7/
https://blueprintue.com/blueprint/h42fj_00/
https://blueprintue.com/blueprint/0aie8c1f/
https://blueprintue.com/blueprint/zx2b8owe/