File IO

nathanlink169

Game Dev by Career, no idea what I'm doing
Veteran
Joined
Aug 15, 2013
Messages
72
Reaction score
32
First Language
English
Primarily Uses
RMMV
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.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
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. :kaopride:

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~ :kaophew:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,972
Members
137,561
Latest member
JaCrispy85
Top