Trihan's Dialogue From File 3.00 - now with choice override and evaluated control codes for database

Sup guys! I wrote this little script in answer to a topic posted by Paladin-Cleric of Awesome asking about a script that lets you place your dialogue in a text file which is then read. I know Andar linked him to the one by SES but this is my take on it: right now it's pretty barebones totally awesome but I'm hoping people will start listing features they want from a script like this so I can build it up to something universally usable.

UPDATE: Script has been updated to version 3.00, which adds so much stuff you won't want to use anything else ever again!

http://pastebin.com/gu787b8q

"How do I set this amazing script up, Trihan?" I hear you ask. Well it couldn't be simpler. Behold, a sample text file!

[Eric explains]<face: Actor1 0>EricGuys, we have to come up with a demo textfile.Dreadshadow needs us![Ryoma says some stuff]<face: Actor1 4>RyomaHow right you are \n[2]!Can we use icons in this? \i[1]You bet your sweet ass we can!Now I put the following lines as a script into an event:

get_dialogue("Eric explains")

get_dialogue("Ryoma says some stuff")

And lo and behold:

demo1.png


demo2.png
Seems nice. I wonder how someone can use the coloring and other special commands texts come with. 🙂

Busts or faces (from faceset) appear, stuff like that.
It already supports text codes: just put them into the text file as you normally would. Or are you looking for codes that aren't already in the default engine? If you want more codes, just tell me what they are and I'll add them.

Busts and facesets I can do!

Edit: Upon further reflection it only does colours, icons and text size codes. I can make it compatible with the others.
Superb. This seems a neat add on and a huge help for visual novels and also nice for... text proofing convenience and language selection.

What I mean?

Well imagine you did not hardcoded the textfile name.

Imagine a method you can add a file name.

Then use another file name

That way you can use filese for each scene, making the game more modular and easier to maintain.

You can also have variations for different languages.

Just a few good ideas I suppose. :3
Depending on the amount of text you might be better off reading all dialogue lines at game start, storing them in a hash and accessing them from there. This way you don't have to open a (potentially big) file every time you want to display text.

As an alternative, you could extend Cache so you only have to load every line once.
I thought it wasn't working with variables, actor names etc. but it was just because I forgot \n[0] isn't a built-in message code. XD

Edit: Good suggestion lavra, I'll look into doing that.
MAJOR UPDATE!

I've taken the suggestions on board and incorporated caching for the dialogue files, so they're only loaded once unless they're edited. Read the script header for more information.

OP updated to version 2.00
ooohh, that's something I thought about when I planned my game, to make it at least in english and german. but then it hits me directly to my face: nice if the dialogues are multilingual, but what with menus and all the other things in the databse??? well, now my game will be complete english. ^^"
It sucks that localising databases isn't as easy, but hey, at least with this script you'll have one less thing to worry about replacing. XD
haha, yeah. xD

I would be so happy if the database could be localized this easy...   I got ideas on how to do it, but it would be too time consuming for me right now! =/
This thing deserves a demo too, so it can show how to make the textfile correctly for a few NPCs 😛
Added screenshots and a sample file showing how to set it up/use it, just for you!

Edit: Updated to version 2.10, now with language support!
Wow... I am speechless. 
Database localization shouldn't be that hard. Just take a look at the module Vocab (the topmost script in the base ones).
I think they were referring to renaming items, monsters, skills etc.
Yeah you could just use tags like "vocab.potion.name" which for example will be placed into the first item name slot. Then there would be a file which could look like this:

vocab.potion.name="Potion 1"

vocab.potion.description="Example"

and so on.

The script would just gsub these tags with the values of the current localization file loaded.
I could make an addon that gives notetags to database entries which change their name depending on which localisation is being used. I'll look into this later.
Updated to 2.11, fixes a bug with faces.
actually for the database item..it would be far more easier to input a separated data and then you just load data_ sepparately....I suddently feel to make this ~
Updated to 2.22! Did someone say word wrap? I've got your word wrap RIGHT HERE.

UPDATE UPDATE: 2.24! Now it's got DYNAMIC wordwrap that doesn't care about font size! (and can get random lines)

wordwrap1.png

wordwrap2.png

wordwrap3.png

trihandemo.png

font1.png

font2.png

font3.png

font4.png

font5.png

font6.png

Original thread: https://forums.rpgmakerweb.com/threads/trihans-dialogue-from-file-3-00-now-with-choice-override-and-evaluated-control-codes-for-database.39811/