So back in the RPG Maker VXA days, I had more than a few questions about this and decided to make a dedicated tutorial explaining Claimh’s Dictionary Script. Even though I’ve moved on to MV, I wanted to keep this tutorial up for those still using VXA that need help with this script.
Claimh does not wish for his script to be translated and so I will not release a translated version to anyone, not even privately. However, this script is more than usable without translation with just a little setup. This tutorial is meant more for people who can’t understand Japanese AND don’t know Ruby. If you are familiar with making scripts and know Ruby, then you can probably figure this out without translating the Japanese notes at all.
So first, obviously, you need the script from here:
The script comes in five parts. There are two extra parts near the bottom but those are plugins. I’m not going over installing the plugins in this tutorial, as I’ve yet to translate and set them up for myself. I may do that in a future tutorial but no promises.
The five sections you want are these:
設定
データベース
イベントスクリプト
ウィンドウクラス
シーンクラス
Put each in its own script beneath materials. The translation for those, in order, are Configuration, Database, Event Script, Window Class, and Scene Class. I have named each of the five scripts as such and will be referring to them in that way for the duration of the tutorial. It looks like a lot, but we will only be playing with Configuration, using some calls from Event Script, and editing a single line in Window Class.
First, we’re going to fix an issue. I give credit for this fix to Caveras from rpgmakervxace.net. There is a problem in the Window Class that causes the letter ‘n’ to not show up in the names of dictionary entries. So far this fix hasn’t caused me any problems, though if anyone runs into any problems with the script because of it, I’m afraid I can’t really help. So use at your own risk or prepare to make many item and people names without n’s. lol
Find line 113 in Window Class. It should read like so:
draw_text(x, 0, 200, line_height, @data.name.delete(“\\n”).delete(“\\”))
change the line to this:
draw_text(x, 0, 200, line_height, @data.name)
This should cause your names to show up properly.
Setting up your Categories
Alright, with that out of the way, let’s set up our Categories. The way the script works, you have categories of terms. Within those categories you have your actual terms, and teach term can have one or several pages about the term. These terms will not auto-fill as you collect items or meet people, so you must put them in using event calls. I’ll go over what these calls are later in the tutorial. One of the plugins available on Claimh’s page is a plugin to make these fill in as you collect the items, weapons, and fight the enemies, but I’ve yet to play with this.
You can have as many categories as you’d like, though some layouts are better for smaller amounts of categories. (We’ll touch on designs later)
To edit your categories, find this in the Configuration:
CATEGORY = [“人物”, “魔物”,”地名”, “物品”, “単語”]
The categories shown in this are People, Enemies, Locations, Items, and Terms. You can add as many categories to this array as you want. They will show up in the order you put them in the array, so make sure you’re listing them in the order you want. All category names should be in “quotations” and separated by commas.
Oddly enough, you’re done with categories for the most part. The rest of the category work is done in the section where we set up the terms.
Setting up your Terms
I love this script for the way it handles terms. There are a lot of scripts that limit you to what the database can show or whatever else, but this script is very flexible in what you show and how you show it.
You’re going to notice a wall of green, commented-out text as you scroll down to the section where you set terms. For the sake of time and laziness, I’m just going to post a translation of that entire block.
\\n[ID] : Actor ID’s Name
\\j[ID] : Actor ID’s Class
\\J[ID] : Class ID’s Name
\\e[ID] : Enemy ID’s Name
\\u[ID,type] : Enemy ID’s Parameter(type)
Valid Types: 0..MHP 1..MMP 2..ATK 3..DEF 4..MATK 5..MDEF 6..AGI 7..LUK
\\g[ID] : Enemy ID’s Gold
\\k[ID] : Enemy ID’s Exp
\\r[ID,index] : Enemy ID’s Item Drop(index:0..2)
0 would be first drop, 1 is second drop, 2 is third drop in database
\\t[ID] : Item ID’s Name
\\T[ID] : Item ID’s Price
\\w[ID] : Weapon ID’s Name
\\W[ID] : Weapon ID’s Price
\\a[ID] : Armor ID’s Name
\\A[ID] : Armor ID’s Price
\\s[ID] : Skill ID’s Name
\\m[ID] : Map ID’s Name
—————————————————————————
★Control characters for placing images
\\n[ID] : Actor ID’s Sprite(Front)
\\b[ID] : Actor ID’s Face
\\e[ID] : Enemy ID’s Battler Graphic
\\t[ID] : Item ID’s Icon
\\w[ID] : Weapon ID’s Icon
\\a[ID] : Armor ID’s Icon
\\s[ID] : Skill ID’s Icon
\\j[ID] : Class ID’s Icon
\\p[File] : Image file from Graphics/Pictures
\\h[File,index]: Image file from Graphics/Characters
\\f[File,index]: Image file from Graphics/Faces
—————————————————————————
★Control characters that can only be used in the description
\\c[n] : Change text color
\\+ : Start/End bold characters
\\- : Start/End italic characters
\\x[n] : Draw from the x coordinate set by n
\\y[n] : Draw from the n-th row
\\n : New Line
\\p : Page Break
\\i[n] : Display icon n
Some of this probably doesn’t make much sense, but it will for the section ahead.
Each category section below is set up like this:
WORDS[0] = {
1 => [
Name,
Type/Subtitle,
Sub-Image,
Description,
Initial state(true:Show; false:Hide),
Initial text color(0:Normal 1:New 2:Updated)
],
}
WORDS[0] refers to the category. Everything between WORDS[0] = { and } are within a single category. Remember the array with the categories earlier? Array items are indexed started from 0. So WORDS[0] refers to the first category in the list you made. 1 will refer to the second, etc. Make sure that whatever section you end with, the number is one less than how many items are in your array or you’ll get errors. (i.e. if you have 12 categories, the last category is #11)
After that, you’ll notice 1 => [. this starts a term. Anything between 1 => [ and ] is a single term’s worth of information. You can add as many terms as you want in a category. Unlike categories, terms start with 1, not 0.
Within each term, there are several things you need to put in, all separated by commas:
Name,
Type/Subtitle,
Sub-Image,
Description,
Initial state,
Initial text color
For the name, you can either put a custom name in “quotations” or you can use a command character. The following can be used:
\\n[ID] : Actor ID’s Name
\\J[ID] : Class ID’s Name
\\e[ID] : Enemy ID’s Name
\\t[ID] : Item ID’s Name
\\w[ID] : Weapon ID’s Name
\\a[ID] : Armor ID’s Name
\\s[ID] : Skill ID’s Name
\\m[ID] : Map ID’s Name
Each symbol is still used within “quotations”. They are rather self-explanatory, I think. In general, unless you have a category of major terms in the game you’re translating, which there’d be no command character for, I suggest using command characters when possible. I can be awkward at first, but if your first item in your database is a “Potion” and you put in “Potion” as the name of the term, what if you decide later you want to rename this item in the database to “Apple Gel”? Then you have to remember to go back into the dictionary to change names of items whenever you change names in the database. By using command characters, the script will simply pull the names from your database, thus using whatever you’ve edited your names to.
Type/Subtitle will be a term in [brackets] that comes to the right of the term name on the description page. This can be whatever you want. If you make it an image, it will leave the [brackets] and just show an image. This is useful if you want to use a character sprite or face graphic instead of a subtitle. Also, with monsters, it will make a half-opacity image in the background of their page if you use their battler sprite as their “subtitle”. There is a lot of room to play around with this option. Image tags should still be in quotations.
A sub-image shows in the lower-right corner. If you don’t want to use this, make the value “nil” without quotations.
Description works the same as most of these have been doing so far. \\n will make a line break, and \\p will make a page break. You can cycle through pages with whatever buttons you set L and R to. Each page can have up to 10 lines on it. Keep in mind that whatever you set for name, type/subtitle, and sub-image will show on every page for that term.
Initial state just refers to if it initially shows up in the dictionary. You can set it to true or false, without quotations. If true, it will show from the start. If false, you’ll have to set it true later through a script call.
Finally, initial text color tells what color it will start as in the dictionary. The colors of terms can be normal (0), new (1), or updated (2). You can set the colors for new and updated in the script, which we’ll do later. So for most terms that are hidden that you show later, you’ll want this set to 1 (no quotations). For most terms visible from the start, you’d obviously want 0 for normal. Then again, it depends on how you want to do it. The updated color will show up whenever you change the name, description, etc of a term mid-game through a script call. (yes! You can do that!)
So as a quick example:
WORDS[0] = {
1 => [
“Magic”,
“\\i[129],
nil,
“A type of power from deep within a person’s soul.\\nIt is rare that a person can use it.\\pThe elements are Fire, Earth, Wind, and Water.”,
true,
0
],
2 => [
“\\t[1]”,
“\\t[1],
nil,
“Recovers 500 HP.\\nPrice: \\T[1]\\nConsumable: Yes”,
false,
1
],
}
In this example, term 1 is called Magic, shows the icon with index 129 to the right of the name, and has no sub-image. It has two pages. The first says:
A type of power from deep within a person’s soul
It is rare that a person can use it.
The second:
The elements are Fire, Earth, Wind, and Water.
It shows from the beginning and its name starts off white to show it’s not a new term, it was something known by the player.
Term 2 uses the name of item 1 in the database, which for the default database is a Potion. It also shows the icon for that item to the right of it. Once again, it’s ID 1, so potion. I chose to have no sub-image again but I’m sure you can manage.
It only has 1 page and says the following:
Recovers 500 HP.
Price: 100G
Consumable: Yes
I’m not sure if that price is accurate to the default database, I just kinda threw it in there. The code I used puts in the price for an item with the ID listed in brackets. So the \\T[1] in the description is replaced with whatever the price of item 1 is.
So hopefully that gives you a better idea of how to do this. For the next category, you would just do the same thing again, but this time with WORDS[1] = { instead (remembering that the first category is 0, not 1).
Misc. Settings
Above the terms and categories but after the module for the plugins, you may notice we skipped a bunch of settings. I wanted to familiarize you with what we were working with before we went and messed with those settings. We’re going to go back and play with those settings now.
SHOW_COLLECT = true
Setting this to true will let your players see a completion percentage, letting them know how close they are to having found every term in the game.
If you want it shown and want it in english, go once again to the Window Class script for a moment, to line 288. Change this:
draw_text( 0, 0, 80, line_height, “収集率:”)
to this:
draw_text( 0, 0, 80, line_height, “Completion:”)
or whatever term you want to use for the completion. Remember to keep a space after the colon so the percentage isn’t awkward plastered against it.
Now back to the configuration.
VISIBLE_ONLY = true
This setting decides whether unknown terms are shown with a placeholder until learned, or simply hidden from the player entirely until learned. Set to true if you want the player to see ——- where a term is that has yet to be learned. Set to false if you don’t want the player to see anything for the term at all until learned. Note that if you use a placeholder, all the player will see is that a term exists that has yet to be learned. They will be unable to see any of the description information you set for that term until you enable it for them.
PAGE_LOCK = false
Now this one gave me trouble with the translation. I believe that if it’s true, swapping from one term while on page three will swap to page three of the next term instead of starting from page 1 again. Useful I guess if they are skimming through specific info through a set, like checking sell prices or enemy weaknesses. Using false would obviously set you back to page 1 for each new term. Once again, not 100% sure about this one.
NEW_COLOR = Color.new(255, 128, 128, 255)
CHG_COLOR = Color.new(255, 128, 255, 255)
These are the colors for the names of the terms when labeled new or updated. These are in RGBA (red, green, blue, alpha) format with the last number being the alpha/transparency (0 = transparent, 255 = opaque).
BT_OPACITY = 120
This is the opacity of the battler sprite when used as a background image for one of the terms. As with the colors above, 0 is transparent while 255 is completely opaque. 120 is the default and honestly I wouldn’t change it unless you absolutely want to. It looks pretty cool with that opacity. Too opaque and your pages can look too busy and make it hard for the player to read the text over it.
TYPE_ICON = true
This will make the location of an icon change depending on the type of term you’re using it for. So item, weapon, skill, etc icons have their own place they go to. I honestly haven’t played with this too much, so I can’t tell you specifics about where these go when this is switched on or off. It’s just something you’ll have to play with yourself.
DESIGN = 0
This is for the layout of the windows for the dictionary screen. I’ll post what I translated for the different values you can put in place of 0:
Design Pattern
0: 2 Panes (List of Categories and Terms, Term Info(Popup))
1: 1 Category (Doesn’t show Category list, displays a term list and info on them)
2: 3 Panes (Category List, Term List, and Term Info always displayed)
3: 3 Panes II (Useful for a small number of categories)
4: 2 Panes (Rounds the list of categories)
I won’t sit here and explain them all to you. 2 is honestly my favorite if you have a large number of categories but it’s all based on your preference. Try them all out and see what fits your project type.
INFO_TIMEOUT = 10
I’m going to be real with you here: I have no damn clue what this does. I tried translating it and after quite a few seconds of banging my head on my desk I gave up. I think it has to do with the input delay or something, I dunno. but I noticed that messing with the number can make things act kinda buggy so I just left the damn thing alone, personally. If you know what it does and want to play with it, go for it.
Event Script Calls
Okay, so now you know how to set up the script behind the scenes. Now you need to be able to play with it in-game.
Firstly, the thing you’re going to play with most:
SceneManager.call(Scene_Dictionary)
This is what you will run in an event to make the dictionary screen load up. If you’re using a custom menu or know how to add menu items, then you can add it to your menu instead. But I’m not here to teach you that today.
As for the other in-game script calls, they are all in the script Event Script.
If you poke around Event Script long enough, you can probably figure out what they do on your own. I’ll put it here for people who are staring at the code blankly:
call_dictionary(category=0)
word_permit(category_id, word_id, flag)
word_change_name(category_id, word_id, new_name)
word_change_type(category_id, word_id, type)
word_change_sub_g(category_id, word_id, sub_g)
word_change_info(category_id, word_id, info)
word_add_info(category_id, word_id, info)
I’m a big believer in people learning to at the very least READ Ruby. Even if you can’t write in Ruby and don’t plan on scripting yourself, if you’re going to spend any amount of time around or using scripts, you might as well familiarize yourself with parts of it.
That being said, I think some of these calls are rather self-explanatory on what they do and how. The first lets you call the dictionary screen with a certain category already highlighted. I haven’t played with it to see if it disables the other categories or not, you’ll have to play with that. The other calls have to do with hiding/revealing different terms, changing parts of a term by their category and word IDs, and adding info on top of what is already there.
And that about does it. With that, your dictionary should function. I didn’t make the script and it’s been a loooong time since I wrote this guide, so if you have any issues/errors with this script, I suggest posting the question on your favorite RPG Maker site. I definitely won’t be able to help. >_>