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:
- Open the Properties sidebar.
- Navigate to the Cloud Variables section to create, edit, or delete variables.
Manage Cloud Variables in the Console
Description:
View and manage cloud variables via your 3Engine console account.
Instructions:
- Log into your console account.
- Go to the Cloud Variables section to monitor and update variable values.
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.
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 (<=
).