File IO

Hi all,

I’m making my own external tool for dialogue tree editing. This is because the dialogues in my game can branch quite a bit, and the RPG Maker editor isn’t great for these large dialogue trees.

In my external tool, I’m generating a .txt file that includes all my dialogue for that encounter. That being said, I’m not terribly aware of the way to properly import these files in JavaScript. Is there a difference between loading a file in the editor and loading a file in an exported version of the game? Any resources you could point me towards I’d greatly appreciate.
I'd suggest putting the dialogue file into your project's data directory and loading it via the built-in DataManager.loadDatafile method. Quick, easy, no custom file access code needed, and it'll do the parsing automatically if you set it up right. In case you're unaware: a .json just contains one or more stringified objects, pretty easy to write from scratch if you're familiar with JS. 😤

In case you're interested, I have an ExtraJSONs plugin that loads specified files into specified global variables (you may find this old thread helpful); feel free to use it as-is or as a learning reference~ 😮‍💨

Original thread: https://forums.rpgmakerweb.com/threads/file-io.111207/