Original Source
- Original title: MZ How to write a wasm plugin
- Original author: linuxluigi
- Original date: September 18, 2021
- Source thread: https://forums.rpgmakerweb.com/threads/how-to-write-a-wasm-plugin.140557/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Learning Javascript
Summary
Hey a friend of me is askingif I could develop a plugin for him. But since I'm a Go developer I was wondering if it would be possible to create a wasm plugin. But I didn't find a way, to load my wasm file within the PRG maker runtime. In the golang wiki is written, that I need to include a JS file as a glue between the wasm file & JS: Golang Wiki -> https://github.com/golang/go/wiki/WebAssembly
Archived First Post
But I didn't find a way, to load my wasm file within the PRG maker runtime.
In the golang wiki is written, that I need to include a JS file as a glue between the wasm file & JS:
Golang Wiki -> https://github.com/golang/go/wiki/WebAssembly
Include JS file -> wasm_exec.js
And to use the Golang functions from wasm it should be something like this:
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
go.run(result.instance);
});When I add the wasm_exec.js file as a plugin and a try to load the wasm file in other JS file it only works in the Browser.
But it doesn't matter what I tried to include the wasm_exec.js file, it will always say that
Go is not defined.Is there some tutorial how to do this?
Thanks for any help
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...