Skip to content
We're expanding our documentation. Not all guides are available yet. 🛠️
Guides
☁️ Cloud Variable

Cloud Variable Extension

Overview

The Cloud Variable extension for 3Engine enables builders to store and manage variables for each user in the cloud, making it more secure than local storage. When combined with the Cloud Event extension, it ensures that game data is harder to manipulate, providing an extra layer of security against cheaters.

Manage Cloud Variables in the Editor

Description:
Easily add, remove, and manage cloud variables directly within the 3Engine editor.

Instructions:

  1. Open the Properties sidebar.
  2. Navigate to the Cloud Variables section to create, edit, or delete variables.

Manage Cloud Variables


Manage Cloud Variables in the Console

Description:
View and manage cloud variables via your 3Engine console account.

Instructions:

  1. Log into your console account.
  2. Go to the Cloud Variables section to monitor and update variable values.

Manage Cloud Variables


Updating Cloud Variable Values

Description:
Cloud variable values can only be updated on the server side through secure events such as Cloud Events or in-app purchase results, ensuring the integrity of your game data.


Retrieving Cloud Variables at Runtime

Description:
Access cloud variables for a player during gameplay to dynamically manage game state via expressions.

Example:

CloudVariables::getCloudVariable('coins');

Use this to retrieve the "coins" variable for the current player.


Conditions

1. Cloud Variables Are Loaded

Check if cloud variables have successfully loaded before proceeding with critical game logic.

💡

As a Tip: Ensure the game starts only after variables are loaded for a seamless experience.

2. Compare Cloud Variable Value as String

Compare a cloud variable’s string value against another string using operators like equals, not equals, starts with, ends with, or contains.

Manage Cloud Variables

3. Compare Cloud Variable Value as Number

Check if a numeric cloud variable matches conditions such as equals (=), not equals (!=), greater than (>), less than (<), greater than or equal (>=), or less than or equal (<=).

Manage Cloud Variables