Can I read values and properties from .txt files instead of having to write them in RPG Maker events?

Hello there, rarely it is that I post questions here, but a request an answer yet again.
I am working on a massive project, or at least the sheer amount of values that I will be using may reach 100k for sure as the game progresses. I am using Makai's Object Properties plugin and am wondering if there is a way to add these properties in .txt files and read them from those files instead of having to write them in RPG Maker events, because that'll mean a lot of space will be occupied just by the scripts needed to add those values.

So, is there a way to read them from .txt files? I know RPG Maker MV reads .txt files converted to .js, or well, the that's how plugins are read. Is there another way, and if not, well, how do I make RPG Maker MV be able to read from external files?

Thank you in advance and happy RPG makin'!

Kind regards,
Annwfn
RPG Maker MV has the `fs` module included which pretty much lets you read any file with a script call. What is the format of that .txt file?

I've moved this thread to MV Support. Thank you.

I actually prefer using .json files over .txt for external data because then you can use JSON.parse to turn it into objects you can reference in code.
RPG Maker MV has the `fs` module included which pretty much lets you read any file with a script call. What is the format of that .txt file?
Thank you for the reply everyone! Hugs! >😀<
What exactly do you mean by "What is the format of that .txt file?" It is a text file with Makai's Object Properties written in it, each for a needed value. There will be thousands of such writings, if not even tens of thousands. I'd rather leave them in well organised files outside of my project than having to write them in the project once so the game knows of them. It's all about having as little of them written in the game itself. That is why I need to learn if I can read them easily from outside sources.
Thank you for the reply everyone! Hugs! >😀<
What exactly do you mean by "What is the format of that .txt file?" It is a text file with Makai's Object Properties written in it, each for a needed value. There will be thousands of such writings, if not even tens of thousands. I'd rather leave them in well organised files outside of my project than having to write them in the project once so the game knows of them. It's all about having as little of them written in the game itself. That is why I need to learn if I can read them easily from outside sources.
It's best to respond to replies on the assumption that nobody reading it knows the details of the plugins you're using. "Makai's Object Properties" won't mean anything to a lot of people.
It's best to respond to replies on the assumption that nobody reading it knows the details of the plugins you're using. "Makai's Object Properties" won't mean anything to a lot of people.
Hello, it is a plugin that allows me to use object properties instead of just the Global Variables that RPG Maker has to offer. To put it shortly, those are too few for me to use. So I use the plugin to allow those same Global Variables to host properties like objects do in JavaScript. Therefore, instead of assigning 1 single value to a Global Variable, I can assign thousands of such values, then call on them with ease.

Example:
maka.objVar.setProp(926,"_BnvlFmAfár_dmgTaken_Recorded",0);
maka.objVar.setProp(926,"_BnvlFmAfár_Ally_healing_Ratio",1.5);
maka.objVar.setProp(926,"_BnvlFmAfár_Chant_turnActive","GraceFromAfár");

This is a snippet from a small ability that allows me to add 3 values to 1 of those Variables, in this case, 926. I will be having dosens of thousands of such written in different text files (.txt extension). Only thing I need is to know a way of convincing RPG Maker MV to be able to read these bunches from those corresponding files as if they were written inside RPG Maker.
The way I do it in my game is to have my plugin inject the file into the database (so that it gets parsed into an object the same way as any other game object does) for example:

JavaScript:
DataManager._databaseFiles.push({ name: "$dataCompendium", src: "Compendium.json" });

And then I can just use $dataCompendium to access any data in the file. The structure looks like this:

1760581979891.png

So then I can do something like $dataCompendium.races_cte and get an array of enemy type strings.
Hello, it is a plugin that allows me to use object properties instead of just the Global Variables that RPG Maker has to offer. To put it shortly, those are too few for me to use. So I use the plugin to allow those same Global Variables to host properties like objects do in JavaScript. Therefore, instead of assigning 1 single value to a Global Variable, I can assign thousands of such values, then call on them with ease.

Example:
maka.objVar.setProp(926,"_BnvlFmAfár_dmgTaken_Recorded",0);
maka.objVar.setProp(926,"_BnvlFmAfár_Ally_healing_Ratio",1.5);
maka.objVar.setProp(926,"_BnvlFmAfár_Chant_turnActive","GraceFromAfár");

This is a snippet from a small ability that allows me to add 3 values to 1 of those Variables, in this case, 926. I will be having dosens of thousands of such written in different text files (.txt extension). Only thing I need is to know a way of convincing RPG Maker MV to be able to read these bunches from those corresponding files as if they were written inside RPG Maker.
It's just JavaScript code. Put it into a JS file, add as a plugin and you're done. Just make sure it's below the Makai's plugin on the list.
It's just JavaScript code. Put it into a JS file, add as a plugin and you're done. Just make sure it's below the Makai's plugin on the list.
Hello and thanks, I'd have to try it like this. Wish it were that simple!
Hugs! >😀<
The way I do it in my game is to have my plugin inject the file into the database (so that it gets parsed into an object the same way as any other game object does) for example:

JavaScript:
DataManager._databaseFiles.push({ name: "$dataCompendium", src: "Compendium.json" });

And then I can just use $dataCompendium to access any data in the file. The structure looks like this:

View attachment 351340
So then I can do something like $dataCompendium.races_cte and get an array of enemy type strings.
Thanks for the suggestion, sounds good as well. Will try below option first, since it sounds too good to be true. After all, those values have to be changed, not just accessed, there will be calculations that will happen with those for the complex abilities I have. I think it'd be good if I can access that data from my .txt files without any extra code to write to it. Good to know there are easy ways though, what I was hoping for! Hugs to everyone! >😀<
It's just JavaScript code. Put it into a JS file, add as a plugin and you're done. Just make sure it's below the Makai's plugin on the list.
Hello, I tried that and it doesn't recognise them. Should I try something else? Am I missing something? First time trying something like this.

Original thread: https://forums.rpgmakerweb.com/threads/can-i-read-values-and-properties-from-txt-files-instead-of-having-to-write-them-in-rpg-maker-events.180529/