linuxluigi

Warper
Member
Joined
Sep 18, 2021
Messages
1
Reaction score
0
First Language
German
Primarily Uses
RMMZ
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
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.

Screenshot 2021-09-18 at 16.22.32.png

But it doesn't matter what I tried to include the wasm_exec.js file, it will always say that Go is not defined.

Screenshot 2021-09-18 at 15.34.53.png

Is there some tutorial how to do this?

Thanks for any help :)
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,682
Reaction score
15,293
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning Javascript. Thank you.



I'd ditch Go completely and just use javascript.
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
498
Reaction score
293
First Language
Portuguese(BR)
Primarily Uses
RMMV
if it works in the browser but not on PC, I imagine its because your working directory is different on each one. Try to verify relative path.

I believe that, on a browser, because your main page is the index.html that its directory will be the working directory(or root). For desktop, it may be where the Game.exe is located
 

Latest Threads

Latest Profile Posts

Creating 3D CGs for Cutscenes. :kaosalute:

I keep wanting to post every song I make for the game and have to hold back on that because at this rate, I'll have spoiled all the really good stuff lol..
DerniBorges wrote on TSR's profile.
Is there any way this plugin works with the big character, and the QSprite plugin? Using RTP chars, everything works fine, but the big ones, with QSprite, it's like that in the image, it doesn't reflect right. And there is, in the settings, an option to fix it. Thanks.
bug2.png
Bengawan Solo with fantasy style arrangement. :D
So I just got my computer back (Was posting stuff on my phone) But now my dang monitor's broken! I'll need to get a new one, which means... JOBS! Yaaay... When I get a new monitor, I'll post picture of one of my RPGMMV projects.
Wish me luck... :kaodes:

Forum statistics

Threads
115,897
Messages
1,093,801
Members
151,141
Latest member
daisyiscute
Top