Exporting and Importing Cloud Code

You can export and import your game configuration Cloud Code scripts:

Exporting Cloud Code

At any point in your game's development in the GameSparks portal, you can export your Cloud Code scripts.

1. Go to Configurator>Cloud Code.

2. On the Scripts panel, click Export:

3. Select to save or open the exported archive.

Importing Cloud Code

If you've exported your game's Cloud Code and edited files or if you've written some scripts you want to use for your game's Cloud Code, you can import these scripts as a compressed archive:

1. Go to Configurator>Cloud Code.

2. On the Scripts panel, click Import:

The Import page opens where you can browse to select a Zip Archive.

3. Select the compressed archive folder for the Cloud Code you want to import:

4. Click Preview. A Review Import list opens:

Where differences with your game's existing Cloud Code scripts are identified, the differences are shown and you can quickly review these to decide whether or not you want to accept the changes:

5. If the compressed archive you selected to import contains a JavaScript file that contains invalid characters, then this file is blocked for reviewing your import and cannot be imported. You will see a Script error.

Other Import Errors? For details of errors on import, see below.

6. Scroll down the review list and use the checkboxes to accept or reject the scripts for import:

7. If you want to create a Snapshot of your game before you import the Cloud Code changes, select the Create Game Snapshot at the bottom of the page:

8. Click Import to import the selected Cloud Code scripts.

9. Click Close to return to the Cloud Code page.

Errors on Import

When you review your import, errors are shown if you are attempting to import invalid files that cannot be imported.

Errors Block Import! If all of the files you are attempting to import are invalid, the Import button will be disabled.

1. If a file contains invalid characters, then a Script error is shown:

2. If the file name contains invalid characters, an Invalid error shows:

3. If you try to import a file that will create a new object, such as a new Event, in the platform, then an Invalid error shows:

Exceptions? The exceptions to this rule blocking the creation of new objects when importing Cloud Code are Modules or Realtime Modules, both of which you can create directly from the Scripts panel on the Configurator>Cloud Code page.