# Bring a Construct 3 game

For a Construct 3 game that already ships as an HTML5 export on other web game portals. The work happens in the event sheet: you replace the other portal's object and actions with the ZokoGames addon. No scripting is needed. The full reference is the [Construct 3 engine page](https://docs.zokogames.com/engines/construct-3). The overall route is in [bring your game](https://docs.zokogames.com/porting/overview).

## 1. Export settings

Install `zokogames.c3addon` (not the zip) through **Menu > View > Addon Manager**, restart Construct, and insert the **ZokoGames** object ([Construct 3: install](https://docs.zokogames.com/engines/construct-3#install)). The addon loads the SDK script itself, so you edit no export file. Then check the export:

| Setting | On ZokoGames |
| --- | --- |
| Export type | **HTML5 website**; zip the folder contents so `index.html` is at the archive root. |
| **Offline support** | No. It adds a service worker, which the validator warns about (`service_worker`). |
| **Use worker** | Yes is supported. |
| **Minify script** | Simple or Advanced. |
| Pre-compression | None. Construct requests plain file names; upload the export as it is. |
| **Fullscreen mode** | A letterbox or scale-outer mode, so the layout fits a frame that changes with fullscreen and rotation. |

Details: [export settings that matter on the web](https://docs.zokogames.com/engines/construct-3#export-settings-that-matter-on-the-web).

## 2. Replace the platform events

Delete the other portal's object and every event that uses it, so no action points at an SDK that is not there. Then rebuild those events with the ZokoGames object. Every asynchronous action takes a **Tag**; **On request completed** or **On request failed** with the same tag fires when it ends ([tags, results and errors](https://docs.zokogames.com/engines/construct-3#tags-results-and-errors)).

| Your game does | With the ZokoGames addon |
| --- | --- |
| Start the SDK | **Initialize** at the start of the first layout; wait for it before other actions. **Is available** is false when the SDK is `disabled`, and the game must still run. |
| Loading finished | **Loading stop** once the first layout can be played (optionally **Loading start** and **Report loading progress** before it). The addon does not send these on its own. |
| Gameplay start and stop | **Gameplay start** and **Gameplay stop**. |
| Midgame (interstitial) or rewarded ad | **Request ad** (midgame or rewarded). Pause on **On ad started**; resume on **On ad finished** and on **On ad error**. Grant a reward only in **On ad finished**. |
| Mute | **On settings changed** with **Is mute requested**. |
| Cloud save | **Set saved item**, **Get saved item** (then read `SavedItem(key)` in **On request completed**), **Remove saved item**. |
| Leaderboard score | **Submit score** for a logged-in player, on a board created in the console. No wrapper builds an encrypted payload; see [leaderboards](https://docs.zokogames.com/sdk/leaderboards#client-submission). |
| Purchases | **Get catalogue items**, **Buy item**, **Consume item**, **Get player inventory**. Purchases are test purchases for now ([purchases](https://docs.zokogames.com/sdk/purchases)). |
| Sign-in prompt | **Show login prompt**; **On auth changed** and **Is logged in**. |

A complete event sheet is in [a working event sheet](https://docs.zokogames.com/engines/construct-3#a-working-event-sheet). The Local Storage object keeps data in IndexedDB on one device; move progress you want kept to the cloud save actions.

The [compatibility shim](https://docs.zokogames.com/guides/migrating#two-ways-to-port) is for JavaScript call sites. Use it only if a script in your project calls another portal's JavaScript SDK directly; event sheets move to the addon.

## 3. Build size and mobile

- Budget: 1,500 files, 250 MB unpacked, about 50 MB initial download (20 MB for mobile), estimated from uncompressed sizes.
- Compress images (WebP) and audio (Opus or AAC); put large media in a second layout loaded once the first is interactive.
- Split rarely used layouts and keep sprite sheets small for phones.
- Start music from a "tap to play" button, not on start of layout. See [mobile](https://docs.zokogames.com/guides/mobile).

## 4. Test before you submit

1. **Preview on `localhost`.** There is no separate simulator: on `localhost` the SDK runs its own local mode with a three-second ad overlay, a fake player and local saves. If your preview is not on a localhost address, add `?useLocalSdk=true`. See [Construct 3: test locally](https://docs.zokogames.com/engines/construct-3#test-locally).
2. **Try the failures.** `?ad_response=unfilled` forces ad errors, `?user_response=logged_out` tests guests, and a second midgame within three minutes fails with `adCooldown`.
3. **Upload the zip** and open the game's **Preview and QA** tab in the developer console to run it in the portal frame with ads on ([build preview](https://docs.zokogames.com/getting-started/local-testing#the-build-preview-in-the-console)).

## Checklist

- [ ] Addon installed; the other portal's object and events removed.
- [ ] **Initialize** first; the game plays when **Is available** is false.
- [ ] Gameplay start and stop at the right moments.
- [ ] Ads resume on **On ad finished** and **On ad error**; rewards only on finish.
- [ ] One tag per request in flight.
- [ ] Saves through the cloud save actions; scores on a board created in the console.
- [ ] Offline support off; other portal's logos, links and sitelock removed.
- [ ] Tested on `localhost` and in **Preview and QA**.

## Next

- Full reference: [Construct 3](https://docs.zokogames.com/engines/construct-3).
- Before upload: [build validation](https://docs.zokogames.com/requirements/build-validation) and the [launch checklist](https://docs.zokogames.com/requirements/checklist).
- Upload and publish: [submission walkthrough](https://docs.zokogames.com/getting-started/submission-walkthrough).
