GDevelop
Verified with a real GDevelop export. A project using the Gamealia extension, exported to HTML5 with GDevelop 5.6.269's own exporter, passes the autotest's SDK checks (init, loading, gameplay start/stop, language, pause). If something does not work, tell us in the Support chat in your dashboard or at hello@gamealia.app: include your GDevelop version (Help > About) and what you expected to happen.
The Gamealia extension adds actions, conditions and expressions under Gamealia in the events sheet. It is an events-based extension written with JavaScript code events over the JavaScript SDK. When the first scene loads it loads the SDK, runs init() and calls loadingStop(); it pauses the scene and mutes the game while the portal asks for it.
Install
- Download the extension: Gamealia.json (save the file; your browser may show it as text).
- In GDevelop open the project, then Project manager > Extensions (or Add a new extension in the events sheet) > Import extension, and pick
Gamealia.json. - Save the project. The extension is stored inside it, so every export includes it.
Off the portal, in GDevelop's preview, the SDK runs in mock mode: fake ads, a local save, nothing is sent.
Minimal flow
| When | Event |
|---|---|
| The game is loaded | nothing to do: init and Loading finished are automatic |
| Texts | Gamealia::Locale() ("en", "es", "pt-BR"...), and the condition Locale changed to translate again |
| Play starts (a level, a round) | action Gameplay started |
| Play stops (game over, pause menu, level end) | action Gameplay stopped |
| A natural break | action Show midgame ad; continue under Ad finished |
| Reward button | action Show rewarded ad; give the reward under Rewarded ad was completed |
Ads are asynchronous: the conditions Ad finished, Rewarded ad was completed and the other "just happened" conditions are true during one frame, so test them in ordinary (not "at the beginning of the scene") events. While an ad plays the portal pauses and mutes the game.
If your game keeps loading after the first scene starts (your own loading screen), use the action Delay loading finished at the beginning of the first scene and Loading finished when the game is playable.
Actions, conditions and expressions
| Area | Actions | Conditions | Expressions |
|---|---|---|---|
| General | Loading finished, Delay loading finished, Loading started, Gameplay started, Gameplay stopped, Happy time, Set progress, Set context value, Clear context, Report error, Track event | SDK ready, On SDK ready, Is on Gamealia, Is mobile, Is instant multiplayer, Is chat off, Locale changed, On error | Locale, Environment, GameId, Device, DeviceClass, Country, App, OsName, OsVersion, BrowserName, BrowserVersion, LastError |
| Ads | Show midgame ad, Show rewarded ad, Check adblock, Show banner, Show responsive banner, Clear banner, Clear all banners | Ad is playing, Ad finished, Rewarded ad was completed, Rewarded ad was not completed, Has adblock, Banner shown, Banner failed | LastAdReason, BannerReason, BannerSize |
| Pause and audio | Automatic mute, Automatic pause | Muted, Paused | |
| Player account | Ask to sign in, Refresh player, Request token | Signed in, Player changed, Token received | Username, UserId, AvatarUrl, Token |
| Cloud save | Load saved values, Save value, Save number, Remove value, Clear save, Read one value | Saved values loaded, Has saved value | SavedValue(key), SavedNumber(key) |
| Rooms and invites | Publish room, Unpublish room, Show invite, Request invite link, Request join pass, Join failed, Set presence status | Room join requested, Has join code, Invite link ready, Join pass ready | JoinCode, JoinKey, JoinParam(name), InviteLink, JoinPass |
| Friends | Load friends list, Invite friend | Friends list loaded, Friends changed | FriendCount, FriendName(i), FriendId(i) |
| Leaderboards | Submit score, Load leaderboard, Show leaderboard | Score submitted, Leaderboard loaded | LeaderboardCount, LeaderboardName(i), LeaderboardValue(i), LeaderboardRank(i), LastBest, LastRank |
Each one maps to the JavaScript SDK call of the same name (SDK reference). A few details:
- Cloud save: run Load saved values once (for example at the beginning of the first scene), then read
Gamealia::SavedValue("key")orGamealia::SavedNumber("key")under Saved values loaded. For structures, saveToJSON(MyVariable)with Save value and read it back with Parse JSON. - Player accounts: guests must be able to play. Request token gives a token for your own server; see Player accounts.
- Rooms: when Has join code is true at start (or under Room join requested), join the room
Gamealia::JoinCode()in your own netcode; see Multiplayer. - Leaderboards: boards are set up in the dashboard; see Leaderboards.
- Lists (friends, leaderboard entries) are 0-based: use a Repeat event
Gamealia::FriendCount()times with a counter variable.
Audio mute and pause
With Automatic mute on (the default) the game's global volume goes to 0 while the portal mutes it and comes back on unmute. With Automatic pause on (the default) the current scene's time scale goes to 0 while the portal pauses the game. Turn either off with its action and use the conditions Muted / Paused to handle it yourself.
JavaScript-only features
Chat, store and the other extras of the SDK reference have no actions. Call them from a JavaScript code event, where window.Gamealia is available:
window.Gamealia.chat.join("global");
Export
- File > Export > Web (HTML5) (the "HTML5 (external websites)" local export), to a local folder.
- Upload that folder, with
index.htmlat its root (or zip it as it is).
The extension loads https://gamealia.app/sdk/v1.js itself; gamealia init on the export folder also adds the script tag to its index.html.
Already use another portal's GDevelop extension?
If that extension loads the other portal's SDK from a script tag in the exported index.html, our compatibility shim can take its place, as the migration guides explain. Most GDevelop extensions load their SDK themselves, though: then add the Gamealia extension and move their actions to the Gamealia ones (same idea: loading, gameplay start and stop, midgame and rewarded ads).
Common autotest failures
gameplay_start/gameplay_stop: no Gameplay started / Gameplay stopped actions in your events.loading_stop: Delay loading finished is used and Loading finished is never reached.sdk_loaded: the export was made before the extension was imported. Export again.translations: texts set once fromGamealia::Locale()without the Locale changed condition.
Problems or questions: the Support chat in your dashboard, or hello@gamealia.app (Support).