Cloud Variable (Beta)

Cloud Variable Extension Thumbnail
Extension Description
Learn how to use the Cloud Variable Extension in PictoBlox. Discover how to store data online, connect users in real-time using WebSocket or WebRTC, and build multiplayer projects.

Introduction

The Cloud Variable Extension helps you share data between different users in the same PictoBlox project. It lets you store values like scores, usernames, or game data in the cloud and update them in real time. When one user changes a value, everyone connected can see the update instantly.

You can easily connect your project to a server, create cloud variables, set or delete values, and check who is connected using simple blocks. Special event blocks let projects react when a user connects, disconnects, or receives new data.

This extension can be used for building multiplayer games, team projects, live quizzes, and collaborative experiments.

What is a Cloud Variable?

A cloud variable is a special kind of variable that stores information online in the PictoBlox “cloud”. These variables are updated on the server side in real time, with little to no delay in project events.

Before You Begin

Step 1: Download or update PictoBlox

Install the latest available version of PictoBlox before using the extension.Download PictoBlox

Accessing the Cloud Variable Extension in PictoBlox

Step 1: Open PictoBlox and select the Block Coding environment.

Select Block Coding in Pictoblox

Step 3: Click the Add Extension button from the bottom left corner of the Blocks Palette.

Step 4: Search for and select the Cloud Variable extension.

cloud variable extension selection

Step 5: The Cloud Variable blocks can now all be accessed under the Cloud Variable category in the Blocks Palette.

cloud variable extension blocks added

Creating Cloud Variables and JSON Lists

1. Creating a Cloud Variable:

Step 1: Click on the ‘Create cloud variable’ button to create a cloud variable.
Create Cloud variableStep 2: The added cloud variable will be visible in the list of cloud variables.

created cloud variable on block pannel

2. Creating a JSON List:

Step 1: Click on the ‘Make a list’ button.

Step 2: Name the JSON list and then click on the ‘Create’ button.

make json list in cloud variable

Step 3: Check out the newly created list in the JSON block section.

created json list in block pallete

Read More

PictoBlox Blocks

The script under this block will be invoked once the User gets disconnected to the server.
The script under this block will be invoked only after the user receives a specific selected list from another user or server.
The script under this block will be invoked only after the user receives a new list from another user or server.
This block is used to delete the selected list. Only the user who created the selected list can delete it.
This block will delete the specified key from the selected list.
This block is used to send the selected list to the connected server.
This block is used to get the value of the specified key from the selected list.
This block is used to get the length of the selected list.
The script under this block will be invoked only after the user receives a new list or packet from another user or server. If a specific list is selected from the dropdown, the script will be invoked only after the user receives that specific selected list.
The script under this block will be invoked once the specified cloud variable receives new data.
This block is used to set the selected cloud variable to a specified value.
The script under this block will be invoked once the User gets connected to the server.
This block is used to check if a specified Cloud variable has received any new data.
This block is used to check if a particular user is connected to the server or not.
This block is used to check if the user is connected to the server or not.
This block is used to disconnect from the server that the user was connected to.
This block is used to stop the local server.
This block will start a local server on a specified port (Used with WebRTC protocol).
This block connects the user to a specified server with a project ID.
This block selects the connection type – Websocket or WebRTC.
This block is used to delete the selected cloud variable.
This block is used to set the global data to a specified value. ‘Global Data’ refers to a variable whose value is the same for all users across all parts of a project.
All articles loaded
No more articles to load
Table of Contents