Playgama
  • Welcome
  • 🚀Quick start
  • Submitting a game
  • Game Requirments
    • 💥Self-check
    • Technical Requirements
    • Advertising Requirements
    • User Experience Requirements
    • Content Requirements
    • Other Requirements
    • Platform-Specific Requirements
  • In-Game Purchases
    • Step-by-step IAP integration guide for Unity
  • FAQ
    • General
    • Submitting a Game
    • Game Moderation
    • Payments and Statistics
  • SDK
    • Getting started
    • Engines
      • Core (Plain JS)
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Unity
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Construct 3
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • GDevelop
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Godot
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Game Maker
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Defold
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
    • Changelog
  • For Partners
    • Getting Started
    • Embed the Widget
      • Adding Games Widget to Your WordPress Site
      • Adding Games Widget to Your Tilda Site
      • Adding Games Widget to Your Framer Site
    • Import the Game Catalog
    • Share your referral link
Powered by GitBook
On this page
  1. SDK
  2. Engines
  3. Construct 3

User Data

PreviousPlatform ParametersNextAdvertising

Last updated 18 days ago

Store and manage player data to enhance gameplay experience and retain progress.

There are two types of storage: LocalStorage and PlatformInternal. When writing to local storage, data is saved on the player's device. When writing to internal storage, data is saved on the platform's servers.

If you need to call storage methods in a sequence, make sure you wait for previous call to finish, so there is no potential data collisions.

Default Storage Type

Identify the default storage type to understand where data is being saved (local or server).

PlaygamaBridge.DefaultStorageType

Used automatically if a specific type is not specified when working with data. Possible values: LocalStorage, PlatformInternal.

Support Check

Verify if the specified storage type is supported on the platform to ensure compatibility.

Copy This Example
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-storage-supported","objectClass":"PlaygamaBridge","parameters":{"storage-type":"local-storage"}}],"actions":[{"type":"comment","text":"local storage supported"}]},{"eventType":"block","conditions":[{"id":"is-storage-supported","objectClass":"PlaygamaBridge","parameters":{"storage-type":"platform-internal"}}],"actions":[{"type":"comment","text":"platform internal supported"}]}]}

Ensure the platform supports the required features and storage types for proper functionality.

Storage Accessibility Check

Check if the specified storage type is currently available for use to manage data storage effectively. Possible values: true, false.

Copy This Example
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-storage-available","objectClass":"PlaygamaBridge","parameters":{"storage-type":"local-storage"}}],"actions":[{"type":"comment","text":"local storage available"}]},{"eventType":"block","conditions":[{"id":"is-storage-available","objectClass":"PlaygamaBridge","parameters":{"storage-type":"platform-internal"}}],"actions":[{"type":"comment","text":"platform internal available"}]}]}

Retrieve stored data based on a key or multiple keys to restore player progress or settings.

If you need data in JSON format, use the PlaygamaBridge.StorageDataAsJSON("key_1") expression.

Copy This Example
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"append-storage-data-get-request","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_1\""}},{"id":"append-storage-data-get-request","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_2\""}},{"id":"send-storage-data-get-request","objectClass":"PlaygamaBridge","parameters":{"storage-type":"default"}}]},{"eventType":"block","conditions":[{"id":"on-storage-data-get-request-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"has-storage-data","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_1\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"PlaygamaBridge.StorageData(\"key_1\")"}}]},{"eventType":"block","conditions":[{"id":"has-storage-data","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_2\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"PlaygamaBridge.StorageData(\"key_2\")"}}]}]}]}

Save data to the specified storage with a key to retain player progress or settings.

Copy This Example
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"append-storage-data-set-request","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_1\"","value":"42"}},{"id":"append-storage-data-set-request","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_2\"","value":"\"test\""}},{"id":"send-storage-data-set-request","objectClass":"PlaygamaBridge","parameters":{"storage-type":"default"}}]},{"eventType":"block","conditions":[{"id":"on-storage-data-set-request-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}

Delete Data

Remove data from the specified storage by key to manage player data and settings effectively.

Copy This Example
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"append-storage-data-delete-request","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_1\""}},{"id":"append-storage-data-delete-request","objectClass":"PlaygamaBridge","parameters":{"key":"\"key_2\""}},{"id":"send-storage-data-delete-request","objectClass":"PlaygamaBridge","parameters":{"storage-type":"default"}}]},{"eventType":"block","conditions":[{"id":"on-storage-data-delete-request-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}

Load Data

Save Data