MaowImpl

Furry
Member
Joined
Sep 21, 2014
Messages
9
Reaction score
6
First Language
English
Primarily Uses
RMMV


Prelude

Hello! Here's a tutorial on installing external dependencies in RPG Maker MV since I couldn't find any other sources for it after looking for hours, so it took me a bit of time to figure this out myself.

Note: This works without a bundler (like Rollup.js) or TypeScript, but I have yet to test if it works with them.



1. Install Node.js

Skip this section if you already have Node.js installed; otherwise, continue onwards.
You will need to download Node.js as it comes with NPM, a tool with which we will install dependencies. Link here.

2. Install Dependencies

To install a dependency, you need to open up your terminal and go to your game directory, then, once you're there, type npm i <name> (e.g. discord-rpc, ws, ...), this will install said dependency into a newly created node_modules folder.

3. Using Dependencies with Node.js's require(...)

This is really easy, just declare a new variable in your script like const Thing = require('name-of-the-module');, and then you can use it normally just fine.

4. After Deployment

Now, making the newly installed dependencies work with a production build (AKA a copy of your game meant to be played by users, not you, the developer) is a slight hindrance, but doesn't take long at all.
You need to move the node_modules folder from the www to the root folder (AKA the one containing your Game.exe), you can also delete the additional package.json and package-lock.json in www (not the root folder, do not delete the package.json in the root as Game.exe requires it)

5. Done!

You should be good to go now, if I missed anything make sure to tell me.
 

MaowImpl

Furry
Member
Joined
Sep 21, 2014
Messages
9
Reaction score
6
First Language
English
Primarily Uses
RMMV
Note: This might not even work on other platforms, I've only tested it on Windows, and it would probably work on Linux, but I'm skeptical about Mac, browser, and mobile. Make sure to tell me if you do get it to work so I can add a new section to the tutorial.

Addendum: NW.js

It's also possible that this only works with an updated version of NW.js (what RPG Maker MV uses to run games on desktop) since it works for me and I did update my NW.js manually.

In order to update NW.js, you need to download a copy of the runtime and SDK at the official site, and replace the files in your RPG Maker MV/nw-win and RPG Maker MV/nw-win-test folders (RPG Maker MV would be in your Steam folder if you installed it on Steam).

I recommend keeping a backup of both folders in case that breaks anything, but it's unlikely.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm familiar with MZ thanks to jam now. I say it's a better working and looking MV. Lots of plugins too and FOSSIL helps alot. It's not bad.
Some more progress <3 and in most important news:
ALPACARAPTOR SPRITE! (not animated yet, though :( )
h4u90Sz.png
Caz
At the risk of giving myself even more work to do, I kinda wanna redraw the faces of the MV RTP to be a little less.. uhhhhh..

mv-redraw.png
Hmm...you'd think in this day and age, what with Japanese Schoolgirls frequenting anime, JRGs and whatever else...that someone might have made some gym clothes for the generator. You know, the ones with the short bloomers.
finished the draft of some of this dude's motions!

mc0xoB4.gif


gonna work on the drafts of the other 3 now before i put detail, need to position these rather tall sprites well on the field

waiting for the term to end so i can get more time w this :kaodes:

Forum statistics

Threads
113,639
Messages
1,076,368
Members
147,657
Latest member
DevilMortar
Top