Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Writing an automated build script for MV games
- Original author: AceOfAces
- Original date: September 3, 2021
- Source thread: https://forums.rpgmakerweb.com/threads/writing-an-automated-build-script-for-mv-games.140125/
- Source forum path: Game Development Engines > RPG Maker Tutorials > RMMV Tutorials
Summary
When working with custom tools (like my Cook Tool) it can be daunting to build the game before publishing. In this tutorial, I’ll show you how to build your own build script so you can automate the chores (and have a custom executable). Requirements PowerShell 7 or newer Node.js (either LTS or Stable)
Archived First Post
When working with custom tools (like my Cook Tool) it can be daunting to build the game before publishing. In this tutorial, I’ll show you how to build your own build script so you can automate the chores (and have a custom executable).
That’s all. Save the file, run PowerShell and then execute the ps1 script (after you navigate to the folder where both scripts live) with .\buildPackage.ps1.
Requirements
- PowerShell 7 or newer
- Node.js (either LTS or Stable)
- An MV project
- An icon in the .ico format.
Step 1: Build the exe script
- Download Node.js and PowerShell from the sites (or type winget install OpenJS.NodeJS and winget install Microsoft.PowerShell, if you have winget installed). If you are using Linux or macOS, look up if your package manager provides these.
- After exporting the game, edit the package.json file and add the “app_name” and “version” tags.
- Find a folder that you’ll put the exported project on. The project should be on in a folder inside it.
- Create two files: One called buildPackage.ps1 and another called buildExecutable.js
- Open the ps1 file. Then write the following:
Get-ChildItem -Path ‘.\<Game Folder>’ -Exclude “www”, “package.json” | Remove-Item -force -Recurse Remove-Item -Path “.\www\package.json” node buildExecutable.js
Important! If you have any folders outside of the www folder (and need to keep), add it to the exclude list. - Save the .ps1 file.
- Open the command line (or the terminal) on the folder, then type npm install nw-builder --save-dev.
- Once the nw-builder is installed, open the js file and put this script:
var gameName = '<Game Name>';
var gameVersion = '<Game Version>';
var gameTag = '<GameName>';
var NwBuilder = require('nw-builder');
var nw = new NwBuilder({
files: '<Game Folder>/**', // use the glob format
flavor: 'normal',
version: '0.22.0', //Specifies the version of nwjs. Remove this to get the latest version.
appVersion: gameVersion,
platforms: ['win64', 'linux64'], //Change this if you want to target more or less platforms
zip: false, //Only turn this to true. This may affect startup times on Windows
appName: gameTag,
//Windows Specific
winVersionString: {
'FileVersion': gameVersion,
'InternalName': gameTag,
'ProductVersion': gameVersion,
'CompanyName': '<Dev Name>',
'FileDescription': gameName,
'ProductName': '<Game or Series Name>',
'OriginalFilename': '<GameName>.exe',
'LegalCopyright': '<Insert copyright here>',
},
winIco: "Game.ico" //It should be in the same folder as this script
});
// Log stuff you want
nw.on('log', console.log);
nw.build().then(function () {
console.log('all done!');
}).catch(function (error) {
console.error(error);
});That’s all. Save the file, run PowerShell and then execute the ps1 script (after you navigate to the folder where both scripts live) with .\buildPackage.ps1.
Step 2: Chaining the other tools
In order to get the tools working with the script, it’s a simple line add before or after the js line. In the ps1 script, add this line:
Start-Process <tool executable> -NoNewWindow -PassThru -Wait -Arguments ‘<Arguments for the tool go here>’Step 3: Customizing and expanding the script
This step is left up to you. PowerShell is pretty powerful and you can do a lot of stuff with it. Want to create a zip file? You can. Want to edit a few files before creating? That too. Take a look at the documentation of PowerShell. Look on some tutorials. Experiment.
Downloads / Referenced Files
Log in to download
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.
0
replies
1
view
Topic Summary
Loading summary...