[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (2024)

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (2)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 8, 2024
  • #1

RGSS Script Editor
Use Visual Studio Code instead of the RPG Maker built-in script editor

This is a VSCode extension that allows you to extract all scripts from the scripts file that RPG Maker uses into individual Ruby files. Once extraction is done, it creates a backup of the original scripts file (Scripts.rxdata, Scripts.rvdata or Scripts.rvdata2) as a security measure, subsequently, it overwrites the original scripts file with a script loader that loads ruby scripts inside a relative folder based on a text file that dictates the loading order.

I have decided to go with this approach to allow having the RPG Maker editor running at the same time you are creating/modifying scripts with an external code editor.

You can check the README on GitHub for a more detailed description.

Important
If you have a Github account I would appreciate if you could upvote my request to be able to order the files when processing an exception in the same order in which they are in the backtrace, you can upvote and read more information about this in the link below.
Issue Link


Features

  • Workspace Support
    • You can change the active folder easily in a workspace.
    • If a key setting is modified, it will reopen the workspace folder that was open automatically.
  • Run Game
    • You can run the game within VSCode using a customizable key shortcut (F12 by default)
    • Both test (debug) and console (RPG Maker VX Ace) modes are supported.
    • Optionally, custom arguments can be used instead of the default ones.
    • You can also specify a custom path to the game, in case you want to run an MKXP-Z executable.
  • Backup Creation
    • A back up of the original scripts bundle file will be created upon script extraction
      • Thus, the script loader will be created
    • You can freely create a bundle file of all activated scripts as a back up at any time.
      • All back ups are named with a timestamp of when they were created.
    • All back ups are saved into the specified folder in the extension's settings.
  • Scripts Extraction
    • You can extract all scripts inside the bundle file to a custom folder within the project's folder.
    • Each RPG Maker script entry will be converted into the appropiate equivalent for the extension's script editor in the process.
      • Every nameless entry with no code will be treated as a separator.
      • Any other entry, will be treated as a script file.
      • An entry with no code besides an specific comment this extension creates will be treated as a folder.
    • If you are extracting a bundle file created by this extension, the tree structure will be recreated.
  • Bundle File Creation
    • You can create an RPG Maker bundle file (Scripts.rxdata, Scripts.rvdata or Scripts.rvdata2) using the current enabled scripts.
    • This process is heavily recommended when sharing a copy of your game.
    • The bundle file is created maintaining the order and tree structure the user creates (subfolders, separators...)
      • You can later rebuild the tree from any bundle file created by this extension (as well as the loading order) if it is not improperly modified by the user.
  • Script Loader
    • The game will load all scripts files individually based on a load order.
    • Any script can be ignored and not loaded when the game runs.
      • Instead of the old way of commenting the whole script code or deleting it, you can disable it and it won't be loaded.
  • Script Editor
    • This extension enables a view in VSCode where you can create a tree of script sections and perform several operations on them:
      • Create new sections.
        • You can create new sections of an specific type, the current types available are:
          • Script: Self-explanatory.
          • Folder: You can use it to organize scripts inside folders, all folders are collapsable.
          • Separator: An empty section (no name, no icon...) used to separate sections.
      • Enable/Disable sections.
        • You can enable or disable any section or group of sections.
          • If a section is enabled, it will be loaded when the game runs.
          • If a section is disabled, it will be ignored.
      • Delete sections.
        • Any section can be deleted along with all of its children.
        • Keep in mind that this action is irreversible!
      • Rename sections.
        • You can rename sections.
        • All changes will be reflected in its children sections.
      • Move sections.
        • The tree can be arranged in any order desired.
        • The load order is defined by the order of the editor, before running the game.
      • Editor Mode.
        • There are two editor modes available, you can switch freely between them:
          • Merge Mode: Merges any supported section with the section in which they are dropped.
          • Move Mode: Moves the selected sections to the next position of the section where they are dropped inside the same parent section.
  • Game Exception Processing
    • This extension can process the exception that killed the game in the last test game session.
    • The extension backtrace will be shown in a markdown file besides the active editor.
    • VSCode built-in peek menu will be used to show each backtrace location.

Planned

  • Maintain extension
  • Implement requests

Screenshots

You can open any folder from the current workspace

You can create any type of section inside the editor tree

Example tree


Other notable extensions
These extensions enhance the experience of working with Ruby in VSCode with RGSS Script Editor



If you find a bug or you want to request something new feel free to open an issue on the GitHub page.

Extension Links


GitHub
VSCode Marketplace
Open VSX Marketplace

Any feedback is appreciated.

Last edited:

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (6)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 21, 2024
  • #2

Wow, you are a legend.
It's sad there aren't any responses yet. This is huge, a big Thank You!
I hope I can try this out anytime soon. I checked your information page and I have one question about Wine, as I'm a Linux user. You state:

rgssScriptEditor.gameplay.useWine: Whether to use Wine to execute the game executable in Linux or not. (Linux Only)

How exactly does this approach Wine on my system? Can I customize the command in some way or does it only default to vanilla Wine like

Code:

wine "path/to/game/exe"

?
I ask because there are several Wine forks in the wild and I personally use Wine_GE (essentially Proton with Steam features stripped out) for which I have customized a nice alias so I can just type

Code:

wine-ge "path/to/game/exe"

beside the vanilla Wine.

Oh, any chance one can donate for your project?

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (8)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 21, 2024
  • #3

schM0ggi said:

Wow, you are a legend.
It's sad there aren't any responses yet. This is huge, a big Thank You!
I hope I can try this out anytime soon. I checked your information page and I have one question about Wine, as I'm a Linux user.

Thank you! [VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (9)

It's probably not the best extension made for this because it's my first time with VSCode API and TypeScript but I appreciate your words. [VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (10)

I was waiting for a Linux user to use the extension and report it since my Linux HDD died and I have not been able to fully test it and ensure that everything works perfectly on that OS.

schM0ggi said:

How exactly does this approach Wine on my system? Can I customize the command in some way or does it only default to vanilla Wine like

Right now Wine usage is hardcoded to use "wine", so yeah, it is the vanilla binaries, if you are interested, I can add a new option in the extension to allow you to modify the command to call Wine without any problems.

The command to call the game with Wine is structured in the following way:
wine "PATH_TO_GAME_EXECUTABLE" [args1, args2, args3...]

``args1``, ``args2``... being the arguments that the extension automatically determines (based on the RGSS version detected) or the custom arguments you can send deactivating the "auto mode" on the settings page and filling this input there.

I tried to make the extension as user-friendly as possible, that's why this "auto-detection" thing exists to avoid sending invalid arguments.

schM0ggi said:

Oh, any chance one can donate for your project?

I did not expect anyone to want to donate, there is no way to do so at the moment. If you are interested let me know via PM.

Right now I am trying to get the VSCode team to implement a way to order the files in the VSCode peek menu.

I would appreciate it if you guys could upvote the petition, it is the only way (that I know?) in which I will be able to show the files in the peek menu in the same order as the exception backtrace from the game process. (You can read more about this in the issue).

Last edited:

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (12)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 25, 2024
  • #4

SnowSzn said:

Right now Wine usage is hardcoded to use "wine", so yeah, it is the vanilla binaries, if you are interested, I can add a new option in the extension to allow you to modify the command to call Wine without any problems.

That would be appreciated!

---

So, I tried to use your extension. Keep in mind, I'm not that experienced in VStudio yet.
I'm having problems setting this up, don't know if I'm doing smth. wrong. A hint would be nice. What I have done:

- Install the exentions
- Open a project folder in VStudio
- Click on the extension icon on the left side
- Click on "Set Active Project Folder"
- Nothing happens

Clicking on the little icons at the top like "Choose Editor Mode" throws me an error like
"command 'rgss-script-editor.chooseEditorMode' not found.

Any idea?

---

Oh, btw, it's possible you could also offer your extension in the VSCodium Market? Though VSCodium can use extensions from the Microsoft market with a workaround, it would be nice to have it in its native market for installation. VSCodium is, if you don't know, VStudio without the Microsoft specific stuff (it's privacy friendly etc.). I've tested your extension in both versions (Microsoft VStudio and the FOSS VStudio VSCodium) and I have the same problem in both versions. Some info:

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (13)

GitHub - VSCodium/vscodium: binary releases of VS Code without MS branding/telemetry/licensing

binary releases of VS Code without MS branding/telemetry/licensing - VSCodium/vscodium

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (14)github.com

Market for extensions

Info for distribution

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (15)

vscodium/docs/index.md at master · VSCodium/vscodium

binary releases of VS Code without MS branding/telemetry/licensing - VSCodium/vscodium

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (16)github.com

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 25, 2024
  • #5

schM0ggi said:

That would be appreciated!

---

So, I tried to use your extension. Keep in mind, I'm not that experienced in VStudio yet.
I'm having problems setting this up, don't know if I'm doing smth. wrong. A hint would be nice. What I have done:

- Install the exentions
- Open a project folder in VStudio
- Click on the extension icon on the left side
- Click on "Set Active Project Folder"
- Nothing happens

Clicking on the little icons at the top like "Choose Editor Mode" throws me an error like
"command 'rgss-script-editor.chooseEditorMode' not found.

Any idea?

---

Oh, btw, it's possible you could also offer your extension in the VSCodium Market? Though VSCodium can use extensions from the Microsoft market with a workaround, it would be nice to have it in its native market for installation. VSCodium is, if you don't know, VStudio without the Microsoft specific stuff (it's privacy friendly etc.). I've tested your extension in both versions (Microsoft VStudio and the FOSS VStudio VSCodium) and I have the same problem in both versions. Some info:

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (19)

GitHub - VSCodium/vscodium: binary releases of VS Code without MS branding/telemetry/licensing

binary releases of VS Code without MS branding/telemetry/licensing - VSCodium/vscodium

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (20)github.com

Market for extensions

Info for distribution

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (21)

vscodium/docs/index.md at master · VSCodium/vscodium

binary releases of VS Code without MS branding/telemetry/licensing - VSCodium/vscodium

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (22)github.com

That's weird because I have checked and the extension registers all callbacks for the commands appropriately when it is activated, maybe the extension failed to activate on your end? What version of VSCode are you running the extension on?

Also if possible, send me the log file the extension creates within the project's folder, in case the log file does not exist, check the information written into the output channel, it should look something like this:

In case the extension was not able to register the output channel, VSCode likely failed to activate the extension on your system, in that case, open the command palette and type "Show Logs", click on the "Developer: Show Logs..." and then click on "Extension Host" and search the entry with the extension ID (SnowSzn.rgss-script-editor) If the extension was activated it should look something like this:

schM0ggi said:

Oh, btw, it's possible you could also offer your extension in the VSCodium Market? Though VSCodium can use extensions from the Microsoft market with a workaround, it would be nice to have it in its native market for installation. VSCodium is, if you don't know, VStudio without the Microsoft specific stuff (it's privacy friendly etc.). I've tested your extension in both versions (Microsoft VStudio and the FOSS VStudio VSCodium) and I have the same problem in both versions. Some info:

Sure no problem, I will check VSCodium out once I release v1.0.9, I'm planning to change the current setting "rgssScriptEditor.gameplay.useWine" from a boolean value to a string set to "wine" by default, so you will be able to change the Wine command freely.

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (25)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 25, 2024
  • #6

Thanks for the hint.

It seems that the extension can't be activated on my side. No log file is created in the project folder.
I have a fresh version of both installed on my system. Here is the "Extension Host" output.

VSCodium

Code:

2024-01-24 23:47:47.833 [info] ExtensionService#_doActivateExtension SnowSzn.rgss-script-editor, startup: true, activationEvent: 'workspaceContains:Game.ini'2024-01-24 23:47:47.845 [error] Activating extension SnowSzn.rgss-script-editor failed due to an error:2024-01-24 23:47:47.845 [error] Error: Cannot find module './ui/ui_extension'Require stack:- /home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js- /home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js- /usr/share/codium/resources/app/out/vs/loader.js- /usr/share/codium/resources/app/out/bootstrap-amd.js- /usr/share/codium/resources/app/out/bootstrap-fork.js- at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15) at o._resolveFilename (node:electron/js2c/utility_init:2:3040) at Module._load (node:internal/modules/cjs/loader:927:27) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6981) at n._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:36227) at t._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:45311) at Module.require (node:internal/modules/cjs/loader:1148:19) at h (/usr/share/codium/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js:35:24) at o._compile (/usr/share/codium/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1324:10) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6981) at n._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:36227) at t._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:45311) at Module.require (node:internal/modules/cjs/loader:1148:19) at h (/usr/share/codium/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js:28:30) at o._compile (/usr/share/codium/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1324:10) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6981) at n._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:36227) at t._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:45311) at Module.require (node:internal/modules/cjs/loader:1148:19) at require (node:internal/modules/cjs/helpers:110:18) at Function.i [as __$__nodeRequire] (/usr/share/codium/resources/app/out/vs/loader.js:5:98) at f._loadCommonJSModule (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:37854) at async Promise.all (index 0)

Microsoft VStudio

Code:

2024-01-24 23:53:15.616 [error] Activating extension SnowSzn.rgss-script-editor failed due to an error:2024-01-24 23:53:15.616 [error] Error: Cannot find module './ui/ui_extension'Require stack:- /home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js- /home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js- /usr/share/code/resources/app/out/vs/loader.js- /usr/share/code/resources/app/out/bootstrap-amd.js- /usr/share/code/resources/app/out/bootstrap-fork.js- at Module._resolveFilename (node:internal/modules/cjs/loader:1129:15) at s._resolveFilename (node:electron/js2c/utility_init:2:2786) at Module._load (node:internal/modules/cjs/loader:974:27) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:5632) at n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:29551) at t._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:35226) at Module.require (node:internal/modules/cjs/loader:1195:19) at h (/usr/share/code/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js:35:24) at o._compile (/usr/share/code/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1371:10) at Module.load (node:internal/modules/cjs/loader:1171:32) at Module._load (node:internal/modules/cjs/loader:1012:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:5632) at n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:29551) at t._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:35226) at Module.require (node:internal/modules/cjs/loader:1195:19) at h (/usr/share/code/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js:28:30) at o._compile (/usr/share/code/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1371:10) at Module.load (node:internal/modules/cjs/loader:1171:32) at Module._load (node:internal/modules/cjs/loader:1012:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:5632) at n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:29551) at t._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:35226) at Module.require (node:internal/modules/cjs/loader:1195:19) at require (node:internal/modules/cjs/helpers:110:18) at Function.i [as __$__nodeRequire] (/usr/share/code/resources/app/out/vs/loader.js:5:98) at f.vb (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:30730) at async Promise.all (index 0)

The output in both versions looks the same, except the difference in the path.

SnowSzn said:

Sure no problem, I will check VSCodium out once I release v1.0.9, I'm planning to change the current setting "rgssScriptEditor.gameplay.useWine" from a boolean value to a string set to "wine" by default, so you will be able to change the Wine command freely.

Sounds awesome!

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (27)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 25, 2024
  • #7

schM0ggi said:

Thanks for the hint.

It seems that the extension can't be activated on my side. No log file is created in the project folder.
I have a fresh version of both installed on my system. Here is the "Extension Host" output.

VSCodium

Code:

2024-01-24 23:47:47.833 [info] ExtensionService#_doActivateExtension SnowSzn.rgss-script-editor, startup: true, activationEvent: 'workspaceContains:Game.ini'2024-01-24 23:47:47.845 [error] Activating extension SnowSzn.rgss-script-editor failed due to an error:2024-01-24 23:47:47.845 [error] Error: Cannot find module './ui/ui_extension'Require stack:- /home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js- /home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js- /usr/share/codium/resources/app/out/vs/loader.js- /usr/share/codium/resources/app/out/bootstrap-amd.js- /usr/share/codium/resources/app/out/bootstrap-fork.js- at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15) at o._resolveFilename (node:electron/js2c/utility_init:2:3040) at Module._load (node:internal/modules/cjs/loader:927:27) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6981) at n._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:36227) at t._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:45311) at Module.require (node:internal/modules/cjs/loader:1148:19) at h (/usr/share/codium/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js:35:24) at o._compile (/usr/share/codium/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1324:10) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6981) at n._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:36227) at t._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:45311) at Module.require (node:internal/modules/cjs/loader:1148:19) at h (/usr/share/codium/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode-oss/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js:28:30) at o._compile (/usr/share/codium/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1324:10) at Module.load (node:internal/modules/cjs/loader:1124:32) at Module._load (node:internal/modules/cjs/loader:965:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6981) at n._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:36227) at t._load (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:45311) at Module.require (node:internal/modules/cjs/loader:1148:19) at require (node:internal/modules/cjs/helpers:110:18) at Function.i [as __$__nodeRequire] (/usr/share/codium/resources/app/out/vs/loader.js:5:98) at f._loadCommonJSModule (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:37854) at async Promise.all (index 0)

Microsoft VStudio

Code:

2024-01-24 23:53:15.616 [error] Activating extension SnowSzn.rgss-script-editor failed due to an error:2024-01-24 23:53:15.616 [error] Error: Cannot find module './ui/ui_extension'Require stack:- /home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js- /home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js- /usr/share/code/resources/app/out/vs/loader.js- /usr/share/code/resources/app/out/bootstrap-amd.js- /usr/share/code/resources/app/out/bootstrap-fork.js- at Module._resolveFilename (node:internal/modules/cjs/loader:1129:15) at s._resolveFilename (node:electron/js2c/utility_init:2:2786) at Module._load (node:internal/modules/cjs/loader:974:27) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:5632) at n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:29551) at t._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:35226) at Module.require (node:internal/modules/cjs/loader:1195:19) at h (/usr/share/code/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/modules/manager.js:35:24) at o._compile (/usr/share/code/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1371:10) at Module.load (node:internal/modules/cjs/loader:1171:32) at Module._load (node:internal/modules/cjs/loader:1012:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:5632) at n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:29551) at t._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:35226) at Module.require (node:internal/modules/cjs/loader:1195:19) at h (/usr/share/code/resources/app/out/vs/loader.js:4:647) at Object.<anonymous> (/home/schM0ggi/.vscode/extensions/snowszn.rgss-script-editor-1.0.8/out/extension.js:28:30) at o._compile (/usr/share/code/resources/app/out/vs/loader.js:4:1271) at Module._extensions..js (node:internal/modules/cjs/loader:1371:10) at Module.load (node:internal/modules/cjs/loader:1171:32) at Module._load (node:internal/modules/cjs/loader:1012:12) at f._load (node:electron/js2c/asar_bundle:2:13377) at c._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:5632) at n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:29551) at t._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:133:35226) at Module.require (node:internal/modules/cjs/loader:1195:19) at require (node:internal/modules/cjs/helpers:110:18) at Function.i [as __$__nodeRequire] (/usr/share/code/resources/app/out/vs/loader.js:5:98) at f.vb (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:168:30730) at async Promise.all (index 0)

The output in both versions looks the same, except the difference in the path.

Sounds awesome!

Could check if the given file exists within the extension's folder? For some reason, it seems that the extension fails to load the script that I use to handle the UI.

Go to the directory where VSCode installs all extensions, should be on Linux by default:

Bash:

cd ~/.vscode/extensions

Now cd into "./snowszn.rgss-script-editor-1.0.8/out/modules/UI" folder

Bash:

cd "./snowszn.rgss-script-editor-1.0.8/out/modules/UI"

A file called "ui_extension.js" should exist in there, if it does not try to install the extension again and let me know.

EDIT: I think I may have an idea of what is happening, could you confirm to me that the folder UI is all uppercase on your end? because since Linux is case sensitive and the script require sentence path is 'ui/...' it may be failing to load it.

Last edited:

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (28)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 25, 2024
  • #8

Yeah, you've nailed it. The extension works now after renaming the folder "UI" into "ui".

But the next problem appears. Due to the hard coded way of using wine in your extension, wine does create, if not present, a new prefix with the default directory

Bash:

~/.wine

and is trying to start the Game.exe in that place. In my case, because I do not rely on only one wine prefix and have several prefixes for different games/apps, launching a project via the extension fails. After copying the RPG Maker XP installation into that default prefix, launching the Game.exe works.

So I would suggest to not only let the the user customize the wine command but also make it possible to define a wine prefix for a project.

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (30)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 25, 2024
  • #9

schM0ggi said:

Yeah, you've nailed it. The extension works now after renaming the folder "UI" into "ui".

But the next problem appears. Due to the hard coded way of using wine in your extension, wine does create, if not present, a new prefix with the default directory

Bash:

~/.wine

and is trying to start the Game.exe in that place. In my case, because I do not rely on only one wine prefix and have several prefixes for different games/apps, launching a project via the extension fails. After copying the RPG Maker XP installation into that default prefix, launching the Game.exe works.

So I would suggest to not only let the the user customize the wine command but also make it possible to define a wine prefix for a project.

My bad then haha, I messed up the package when I uploaded it into VSCode marketplace, this is because originally the folder was called "UI", and sometime during development I renamed it into "ui", since Windows is case insensitive it never renamed the folder inside the output folder and works out of the box. The same may have happened to other folders/files inside the output folder.

I'm gonna clean up the output folder for v1.0.9 so all files within the output folder have valid names and include what you have suggested about Wine, speaking of which, could explain what wine does if that prefix is not given? (I have not used Wine very much) like does the command need an argument to specify the current working folder?

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (31)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 25, 2024
  • #10

SnowSzn said:

The same may have happened to other folders/files inside the output folder.

Some files have upper/lower case mixed together, if that helps.

SnowSzn said:

I'm gonna clean up the output folder for v1.0.9 so all files within the output folder have valid names and include what you have suggested about Wine, speaking of which, could explain what wine does if that prefix is not given? (I have not used Wine very much) like does the command need an argument to specify the current working folder?

When just running an app via wine without any additional parameters, the default wine prefix is, if not present yet, created under

Bash:

~/.wine

and the app is launched in that environment.
To specify a custom wine prefix, one has to use

Bash:

WINEPREFIX=/path/to/prefix

So, running an app installed in a custom prefix with wine would look like this

Bash:

WINEPREFIX=/path/to/prefix/folder wine /path/to/app.exe

A good insight might be the official wine documentation

FAQ - WineHQ Wiki

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (32)wiki.winehq.org

---

I played around a bit and so far, everything seems to work fine. Script files are created and loaded, Backtrace is functional.
One thing I noticed is that, when creating a bundle from the extracted scripts, I have to additionally name the extension (.rxdata) of the file despite having the option to choose between RPG Maker XP and VX Ace in the save dialog. Could be a general problem of the file dialog, though.

Feel free to ask me to test specific things of your extension.

Last edited:

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (34)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 26, 2024
  • #11

schM0ggi said:

Some files have upper/lower case mixed together, if that helps.

When just running an app via wine without any additional parameters, the default wine prefix is, if not present yet, created under

Bash:

~/.wine

and the app is launched in that environment.
To specify a custom wine prefix, one has to use

Bash:

WINEPREFIX=/path/to/prefix

So, running an app installed in a custom prefix with wine would look like this

Bash:

WINEPREFIX=/path/to/prefix/folder wine /path/to/app.exe

A good insight might be the official wine documentation

FAQ - WineHQ Wiki

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (35)wiki.winehq.org

I pushed v1.0.9, let me know if you can use your aliased wine fork, as well as setting up that env. variable when calling it, I believe as long as any wine fork accepts the arguments in the same order as the original Wine it should not be a problem.

The old useWine option was replaced with an input box.

For linux-based systems, I changed the logic to determine whether the game is a Linux executable or a Windows one, no need to activate/deactivate a flag to use Wine or not, the extension should be able to use that command to invoke Wine (or not) based on what type of executable is being used. But, since I cannot test it, I cannot ensure it works 100%

Also, I cleaned the output folder, you should have a clean "out" folder inside the extension's folder with the correct names, and removed all unnecessary files.

schM0ggi said:

I played around a bit and so far, everything seems to work fine. Script files are created and loaded, Backtrace is functional.
One thing I noticed is that, when creating a bundle from the extracted scripts, I have to additionally name the extension (.rxdata) of the file despite having the option to choose between RPG Maker XP and VX Ace in the save dialog. Could be a general problem of the file dialog, though.

Feel free to ask me to test specific things of your extension.

Thanks, I have not managed to replicate what you say about creating a new bundle file from the extracted scripts, now that it works, could you check the output channel of the extension to see what destination path it gets from the VSCode API? Could it be a OS thing?

This is what happens on Windows:
1. On the save window

2. Once you save it, the output channel should look like this:

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (39)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 26, 2024
  • #12

Ah, I see you've combined the customizable wine and wine prefix into one input box. That's fine.
I have tested this new input box and it works, though I can't use my defined aliases in .bashrc but that was to be expected.
I could play around with a symlink and putting it into a path which resides in $PATH, but nah ... it's okay.
Instead, I just input the absolute path to the wine fork, this does also the job. So, in the end it looks like this on my side:

Code:

WINEPREFIX="/path/to/prefix" "/path/to/wine/fork/wine"

SnowSzn said:

Also, I cleaned the output folder, you should have a clean "out" folder inside the extension's folder with the correct names, and removed all unnecessary files.

Yes, looking good.

Regarding the bundle. This is how it looks on my side with the output:


The file is created, but without the correct extension. Workaround is to just manually add it afterwards to the specific file or directly typing it in the name when saving.

Last edited:

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (43)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 26, 2024
  • #13

schM0ggi said:

Ah, I see you've combined the customizable wine and wine prefix into one input box. That's fine.
I have tested this new input box and it works, though I can't use my defined aliases in .bashrc but that was to be expected.
Instead, I just input the absolute path to the wine fork, this does also the job. So, in the end it looks like this on my side:

Code:

WINEPREFIX="/path/to/prefix" "/path/to/wine/fork/wine"

Yes, looking good.

Regarding the bundle. This is how it looks on my side with the output:

View attachment 293088
View attachment 293089

The file is created, but without the correct extension. Workaround is to just manually add it afterwards to the specific file or directly typing it in the name when saving.

Hmm I see, I thought that by using the NodeJS fs module to spawn a shell and execute the command it would support aliases since the shell would have loaded them upon creation, but I guess I was wrong, no idea why tbh.

EDIT: it seems the default shell that NodeJS uses on UNIX system is "/bin/sh", maybe this is the problem?

About the bundle file, I guess the save dialog is OS-dependent, VSCode is supposed to add the file extension automatically but it is directly omitted in Linux, unlike Windows.

One thing I can do about it is to ensure that an extension exists in the destination path, so it would work with Linux without manually adding it in the file name, I'll try to do this and include it in a future update.

If you have any other idea/feature feel free to suggest it!

I will try to get the extension into open-vsx in the next days, I need to verify the publisher namespace first and will try to upload it.

Last edited:

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (44)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 26, 2024
  • #14

SnowSzn said:

Hmm I see, I thought that by using the NodeJS fs module to spawn a shell and execute the command it would support aliases since the shell would have loaded them upon creation, but I guess I was wrong, no idea why tbh.

EDIT: it seems the default shell that NodeJS uses on UNIX system is "/bin/sh", maybe this is the problem?

Yeah, seems so.
On my system/distro, "/bin/sh" is a symlink to "/bin/bash".
Probably the symlink is wrecking things as when using "/bin/sh" instead of "/bin/bash" or "/usr/bin/bash", script files also don't seem to work when combined with an alias for a wine fork. If possible, you could add an input box to customize the path to the shell or smth. similar if you like. But not necessary if you ask me, as one can just point to the absolute path regarding a wine fork.

SnowSzn said:

About the bundle file, I guess the save dialog is OS-dependent, VSCode is supposed to add the file extension automatically but it is directly omitted in Linux, unlike Windows.

One thing I can do about it is to ensure that an extension exists in the destination path, so it would work with Linux without manually adding it in the file name, I'll try to do this and include it in a future update.

Probably OS-dependent, yeah. Sounds good if you can do that easily.

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (46)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Jan 27, 2024
  • #15

schM0ggi said:

Yeah, seems so.
On my system/distro, "/bin/sh" is a symlink to "/bin/bash".
Probably the symlink is wrecking things as when using "/bin/sh" instead of "/bin/bash" or "/usr/bin/bash", script files also don't seem to work when combined with an alias for a wine fork. If possible, you could add an input box to customize the path to the shell or smth. similar if you like. But not necessary if you ask me, as one can just point to the absolute path regarding a wine fork.

Probably OS-dependent, yeah. Sounds good if you can do that easily.

As long as it works with the absolute path I think I'd rather leave it as it is, trying to have as few settings as possible to make it easier to understand.

I think I fixed the bundle creation extension thing with the last version, I also uploaded it to open-vsx, I believe I do not have to modify anything to share the extension in that marketplace, let me know if it works in VSCodium downloading it from there.

schM0ggi

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (47)

Joined
Jul 26, 2012
Messages
48
Reaction score
21
First Language
German
Primarily Uses
  • Jan 28, 2024
  • #16

Tested the native extension in VSCodium, works like a charm. Very nice and thank you!
The budnle creation process is now good. File name extension is present when saving.

I think you might want to also advertise your extension in the discord server of mkxp and mkxp-z.

Join the The Maple Shrine Discord Server!

Check out the The Maple Shrine community on Discord - hang out with 335 other members and enjoy free voice and text chat.

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (48)discord.gg

I can imagine there are some people who would take your work with a kiss on your hand. [VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (49)

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (51)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Feb 2, 2024
  • #17

New version 1.1.0 released, changelog notes below.

The extension is now able to recreate a tree on the script editor view based on a previous bundle file created, due to obvious limitations of the RPG Maker data format, I had to use the script's name to save the filesystem location where a specific script was before it was bundled up.

This is something I wanted to fix asap since it could break the whole tree arrangement if the user accidentally overwrites the scripts bundle file this extension creates, forcing them to order the whole tree again.

As a small addition, you can use a new command to quickly create backups of the current state of all scripts and save them into the RPG Maker data format, since it uses the same functionality as the "Create Bundle" command, only enabled (loaded) scripts are considered for this backup.

If you have an issue (or an idea) feel free to open an issue on the Github repo, or say it here on this thread.

[1.1.0] - 01/02/2024​

Added​

  • Extension is now able to create a script tree and load order from a bundled scripts data file
    • Only bundled scripts data files created by this extension are supported
    • You will be able to restore the tree easily in case it was overwritten
  • Allows the user to quickly create a back up file of the current enabled scripts in the tree
    • This process is the same as creating a bundle file but does it automatically
    • All backups are stored with a time stamp

Changed​

  • Avoid creating empty backup files of the bundled scripts data if invalid
    • 'Invalid' means that only the script loader was inside of the bundled data file
  • Bundle creation now allows to overwrite an existing file
  • Modified some logging information to make it clearer

Fixed​

  • Fixed folder recognition to avoid empty filesystem entries to be recognized as valid folders

BCj

Regular

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (53)

Joined
Jun 19, 2014
Messages
2,000
Reaction score
1,372
First Language
Dutch
Primarily Uses
N/A
  • Feb 2, 2024
  • #18

Thanks a bunch! [VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (58)going to try this one out. Love the black mode, very low vision friendly.

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (60)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Feb 2, 2024
  • #19

BCj said:

Thanks a bunch! [VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (61)going to try this one out. Love the black mode, very low vision friendly.

No problem! If you have any questions about how the extension works feel free to ask [VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (62)

SnowSzn

Villager

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (64)

Joined
Jan 8, 2024
Messages
17
Reaction score
14
First Language
Spanish
Primarily Uses
N/A
  • Mar 1, 2024
  • #20

New version 1.2.0 released, changelog notes below.

[1.2.0] - 29/02/2024​

Added​

  • A new command to create a bundle file from the current selected editor sections on the tree view
    • You can select any group of sections on the tree view and create a bundle including only those sections
    • Sections will be included whether they are enabled or disabled

Changed​

  • Modified create bundle file and create backup bundle file commands to adapt it to the new feature
  • Renamed Create Script Loader command

You must log in or register to reply here.

[VSCode] Script Editor for RPG Maker XP, VX and VX Ace [v1.2.1] (2024)

References

Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 5893

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.