How do I optimize text retrieval?

starbrother

Villager
Member
Joined
May 16, 2018
Messages
13
Reaction score
3
First Language
english
Primarily Uses
RMMV
Hello, I've got a script with a few options for the npc to say when spoken to. Right now I have the options in a bit of code inside of the event but I feel like that's a bit slow.

I plan on eventually having a lot of things the npc can say, so I would like the code to simply pull from a database in a text file. How would I go about doing that?
 

Eliaquim

Raze: The Rakuen Zero's Guardian!
Veteran
Joined
May 22, 2018
Messages
1,339
Reaction score
592
First Language
Portuguese - Br
Primarily Uses
RMMV
You can try to use some plugins that already do that like Dk tolls localization or Iavra localization.
The last one I made an upgrade and it includes a demo showing how to use it.
They can add a text inside an object in a JSON file.
So you have to simply call this object in your msgs:
{Map01.Npc01} - Something like that...
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
432
Reaction score
1,379
First Language
Bahasa
Primarily Uses
RMMV
If it just retrieving data from outside (text, number, data, even function, etc)

Here's a step by step.
I intent to make a tutorial of it anyway...
  1. Create a js file. Name it whatever you need. Put it inside yourgame/js/plugins folder
    1591339856887.png
  2. Activate it from your plugin manager
    1591339872353.png
  3. Use any text editor you like (I use Notepad++). Open the file, then write a self called function.
    1591339975079.png
  4. Make an object. Name it whatever you want.
    1591340146738.png
  5. Let's make a sample first...
    1591340329101.png
  6. It's done. Your "text" already stored. You may directly access it using game variables.
    1591340423605.png
  7. Result :
    1591340453443.png
Let's start by writing another sample :
1591340579115.png
Red : Any code from window message shall start with \x1b
Cyan : Code to write in new line (enter). \n
Purple : Code to write in new page (window). \f
Green : Use backslash beforehand to write single quote character (').

Result :
text example.gif

EDIT : I already made the tutorial.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

just spent FOREVER troubleshooting an issue with my keyboard... turns out the cord was just loose OTL
I count on someone one time, I let them promise something to me, and one week later it's complete silence as I'm completely let down. I hate everything.
Everytime I need to write dialogues I find myself writing new music pieces... what kind of trick is this?!
Me Being Dumb spending hrs trying to figure out Irenas Visual Novel busts plugin..lol. I'm probably missing something stupid and obvious xDD

let the journey begin >w>
X.X ok... I guess I'll just have to think about 48x48 a little differently. Its not "room for more work"..."its room for more detail!...yay"

Forum statistics

Threads
99,218
Messages
963,167
Members
130,807
Latest member
NotADev
Top