Cloud Script
The Cloud Script plugin is specifically designed to call Cloud Functions and Microsoft Azure Functions through PlayFab's automation feature, for games built using Construct 3 and Construct 2.
Cloud Script allows the developer to extend the features of PlayFab through server-side scripting with JavaScript, and a lot of other server-side scripting languages with Microsoft Azure.
The Cloud Script plugin is used similar to the Construct 3's functions feature, it calls a function using a name with parameters. Except the function called is in the script of PlayFab's Automation feature or Microsoft Azure's Cloud Function feature.
With Cloud Script, you can freely extend the features of PlayFab with your own server scripts.
Introduction
The Construct Master Collection supports the full and easy integration of the PlayFab service for both Construct 3 and Construct 2.
Please click here to learn more about PlayFab.
Features
Here are some of the features of the PlayFab service:
Server-side scripting
Cloud Script
Azure Functions (Coming soon!)
Server API
Admin API with Azure Functions (Coming soon!)
Automation features
Cloud functions
Security features with server scripting.
Organized request and update features.
For more information about all the integrated PlayFab service features, please click here to learn the introductory lessons to PlayFab.
Network Services
Here are some of the platform services that can be linked:
PlayFab
Google Play
Game Center
Facebook
Facebook Instant Games
Steam
Xbox Live
Instant Games (Android Studio port)
Nintendo Switch (3rd party porting services)
PS4 (3rd party porting services)
Nintendo Switch (3rd party porting services)
Editor Features
Here are some of the features in the Construct editor:
All platforms support, including web, mobile and desktop.
Construct 3
Construct 2
How to use?
It is easy to use the Cloud Script plugin, you will only need to follow the steps below.
Set up the PlayFab API plugin, please click to visit the documentation. This includes creating a PlayFab account, studio and title.
Set up the Authentication plugin, please click to visit the documentation.
Finally, you can now use the Cloud Script object, and include more PlayFab addons for more features.
Documentation
There is currently nothing to show, we will add more in the future.
Introduction
Cloud Script is an advanced PlayFab feature, but it only involves basic JavaScript scripting. It's a powerful feature and a useful skill to game developers using PlayFab.
If you are new to JavaScript, then it is a great journey ahead of you. With PlayFab's automation feature, you only need basic JavaScript knowledge to use the scripting feature. There are some learning ahead, however it is a worth it endeavor and investment in your career since you can also use this skill for any development purposes, including using your skill to use Construct 3's Scripting feature, which allows you to do more advanced implementations with your projects.
​
The most important things you need to know to get started in writing JavaScript with Cloud Script is the writing structure or syntax. These include comments, variables, operators, arithmetic, assignment, data types, functions, objects... up until you reach arrow functions. You will learn the rest as you go.
​
It's not a difficult course to learn, everyone who managed to understand the event sheet system with Construct 3 or Construct 2 can certainly do it.
For further studies, you can lookup CodeAcademy, W3Schools or Tutorialspoint. For video based learning, we highly recommend Derek Banas' complete JavaScript tutorial.
If you already know JavaScript, then it is straightforward to use. You only need to write a handler function in your customized server-side script in the Automation features page of the PlayFab Console. In the server-side script, you can access the Server API and make requests alongside your customized functions. You can call these functions through their handler. You can call the handler function from Construct 3 through the Cloud Script plugin by passing the handler name and the parameters. To get started, please refer to the documentations below:
Make sure to also lookup the Introduction to Cloud Script tutorial, a basic learning guide for Cloud Scripting.
Azure Functions
Reminder!
There is now a new implementation for Cloud Script in PlayFab, it is called Microsoft PlayFab's Azure Functions, which no longer relies on PlayFab's own hosting of server-side scripts. You will be managing the servers yourself through Microsoft Azure. Fortunately, this is an easy process as well, however you still need to do some technical server management unlike before.
While the previous Cloud Script implementation is now a legacy feature, which only now exists for existing projects or for those who request through email to convert their titles back to the classic Cloud Script feature.
We will be updating the plugin along with the entire PlayFab Master Collection, to accommodate the new Microsoft Azure features, including tutorials to ease the transition. We will announce as soon as this project is finished, and the update made available.
Properties Guide
The Cloud Script plugin has a properties section to easily configure how you want to select and request server-side scripts.
Click to select the Cloud Script object and take a look at the Properties Bar while the Cloud Script object is selected. This will show the 3 configuration properties, the Revision, Specific Version and Generate Play Stream.
There are 3 types of revisions, Live, Latest and Specific. If the property is set to Specific, the specified version in the next property below will be used. The Generate Play Stream Event toggle will enable the log generation in the Play Stream Monitor from the PlayFab Dashboard, if checked.
​
You can also read each property's descriptions for more information.
Actions, Conditions & Expressions
Actions
The following action groups:
Cloud Function
Cloud Function
Plan Parameter - Plan a parameter for the next "Cloud Call Function".
Key - The key of the parameter.
Value - The value of the parameter.
​
Call Function - Call a "Cloud Script Function".
Name - The name of the CloudScript function to execute.
Conditions
The following condition groups:
Cloud Function
Checking
Logs
Cloud Function
On Finished - Triggered when a function is called and has responded with a success.
Name - The name of the function that is being called.
On Finished Failed - Triggered when a function is called and has responded with a failure.
Name - The name of the function that is being called.
On Any Finished - Triggered when any function is called and has responded with a success.
On Any Finished Failed - Triggered when any function is called and has responded with a failure.
Checking
Has Error - Checks if the latest Cloud Function response has an error during execution.
​
Results Too Large - Checks if the latest Cloud Function response return value is too large (>350KB) and was dropped.
Logs Too Large - Checks if the latest Cloud Function response logs are too large, when the total event size is (>350KB).
​
Logs
For Each Log - Loops through all the logs received from the recent "Call Function".
Expressions
The following expression groups:
Content Delivery Network
Server Response