New DOM Side Plugin

The new DOM Side plugin is now part of the suite!
With this plugin you can load scripts directly to the DOM Side and communicate with the Web Worker using a simple API of events and procedure calls.
The first thing you should do is to create a new JavaScript file inside your files/ folder (no scripts/). Then load it with a simple action.

Inside your loaded script, you have full DOM APIs.

The script doesn’t have context of your game though, so if you want to communicate between the Web Worker (where the runtime of your game is running) and the DOM Side (where you have full DOM APIs and can modify the HTML), you must use the global object DomSideHandler.
DomSideHandler is a global object that exists on both sides. With it you can listen for events or send events to the other side. You can register procedures so the other side can call them or call procedures of the other side.
You can listen to events like:

And on the other side, you can dispatch them like:

You can also do everything in EventSheets of course:

Events can be listened with on or onOnce, then dispatched with send. But what if we want to execute an action that returns us a value? For that we must register procedures.
You can register a procedure like:

Or you can do it via EventSheets:

Then you can call those procedures from the other side like:

So we can register procedures with handle and call them with invoke. Just be sure that your procedures have distinct names, you can only have one procedure per name, meaning that if you register two On Handle triggers in the EventSheets with the same name, only one will run. If you need to execute multiple stuff use events.
That’s pretty much it, the plugin is simple but powerful. With it you have a way to load scripts to a limitless context and you have a simple API to communicate with your game.
Enjoy!
Files
Get Primitives for Construct 3
Primitives for Construct 3
The missing primitives that you may need and Construct lacks
| Status | Released |
| Category | Tool |
| Author | Master Pose |
| Tags | addon, Construct 2, construct-3, Math, primitives |
More posts
- Available on Construct.netMar 05, 2025

Leave a comment
Log in with itch.io to leave a comment.