Skip to content

Tutorial: Translating Items and Enemies

PhoenixBound edited this page Feb 24, 2024 · 9 revisions

Translating Items and Enemies

This is probably one of the simplest steps! All you have to do is edit:

  • enemy_configuration_table.yml
  • item_configuration_table.yml

Simple, right?

Enemy Configuration Table

This file contains information about all the enemies. Each enemy is represented by a number value, followed by all their attributes, such as Name, their Vulnerabilities, Item dropped, etc.

For a translation, there are only TWO attributes you need to change for an enemy:

  • Name
  • Gender

BUT WAIT?! Why would I change an enemy's gender?!

In English, when you use an article to refer to someone or something, you might use something like 'the' or 'a'. Articles in English do not reflect gender. But in other languages, articles can.

If your language DOES reflect gender in an article, then I would change the gender of the enemy to match what an article would indicate. For most enemies that are people, this will likely be the same gender as the individual. But with a lot of the animal, robot, or even abstract enemies, the gender will depend on the NAME. For example, in Portuguese, if I'm referring to a Coil Snake (which is called a Cobra Espiral), the name Cobra Espiral is feminine, and so I set the gender for the Coil Snake to be female. If your language also has neutral reflection in articles or verbs or any other type of word, you can use that as well.

EarthBound supports three gender options:

  • male
  • female
  • neutral

In my translation, since Portuguese doesn't need the neutral form, I used neutral to indicate that the enemy's name is a proper noun. This allows me to provide options in the text to NOT include an article when referring to the enemy.

Enemy articles

First things first. You need to set the "THE" flag to 0 for all enemies and then update the gender for all enemies to reflect the gender of their name as outlined above.

The next thing you need to know is how the control codes [1C 14 XX] and [1C 15 XX] work. [1C 14 XX] checks the gender or number of the USER in a line (represented in ccscript as {user}). So if there is text somewhere, especially in battle, where you want to insert an article before the {user}, you can use a combination of three control codes: [1C 14 XX], [1C 15 XX], and [09 XX {e(label)} ...]

[1C 14 02] checks for number (for example, the number of enemies in a fight), and [1C 14 01] checks for gender.

With [1C 14 01]: It returns 01 if the enemy is Male It returns 02 if the enemy is Female It returns 03 if the enemy if neutral

This works great with [09 XX ...] because it checks working memory and jumps to one of several locations based on the value there, and that's exactly where 1C 14 stores its result.

So, if you have [1C 14 01] it will check for the gender of the current {user} and then drop the result into working memory. Then, you need to get 09 XX setup to properly handle the result. Since 1C 14 can have three different results, we set it up like this: [09 03 {e(label_1)}{e(label_2)}{e(label_3)}] where 03 corresponds with the range of results we can get from 1C 14 01, and then each of the {e(label_x)} point to a label somewhere in ccs that contains the text we want to display. We do the same thing with number, which is [1C 14 02], and that one will be setup with a [09 01 {e(label_1)}] because it only needs to check for one thing: is this more than one individual or several?

I know that is a lot of information, but here is a basic example. Again, this is in Portuguese:

// Here we check 1C 14 02, which checks number
// If we get back 1 we have only ONE, and we jump to where we handle singular
// Otherwise we start writing the line for a group, and then jump to where we handle gender for it
l_0xef790b:
    "[1C 14 02][09 01 {e(l_0xef792b)}]O grupo d" goto(l_group_gender) eob

// This is where we handle singular, which means we need to check gender
l_0xef792b:
    "[1C 14 01][09 03 {e(l_singular_male)} {e(l_singular_female)} {e(l_singular_neutral)}]" eob

// This is where we determine the gender with a group
l_group_gender:
    "[1C 14 01][09 03 {e(l_plural_male)} {e(l_plural_female)} {e(l_plural_neutral)}]" eob

// Here we have results for singular gender
l_singular_male:
    "O {user}" eob

l_singular_female:
    "A {user}" eob

l_singular_neutral:
    "{user}." eob

// The following are results for plural gender
l_plural_male:
    "o {user}." eob

l_plural_female:
    "a {user}." eob

l_plural_neutral:
    "e {user}." eob

This can be used in a TON of places in the game. Anywhere you need to determine gender or number, experiment with 1C 14!

NOW! Moving onto targets of actions. In combat, every ability has a USER and a TARGET. The USER works with [1C 14 XX] but the TARGET instead uses [1C 15 XX]. [1C 15 XX] works almost exactly the same as [1C 14 XX], but it describes the enemy associated with {target} in CCScript. That means [1C 15 01] gets the gender of the target, and [1C 15 02] gets the number of enemies on the target's side.

This does mean that we need twice as many labels as before. But we can save space by not referring to the same text twice:

// Here we check 1C 15 02, which checks number
// If we get back 1 we have only ONE, and we jump to where we handle singular
// Otherwise we start writing the line for a group, and then jump to where we handle gender for it
l_describe_all_targets_sentence_beginning:
    "[1C 15 02][09 01 {e(l_target_one_gender)}]O grupo d" goto(l_target_group_gender) eob

// This is where we handle singular, which means we need to check gender
l_target_one_gender:
    "[1C 15 01][09 03 {e(l_singular_male)} {e(l_singular_female)} {e(l_singular_neutral)}]" eob

// This is where we determine the gender with a group
l_target_group_gender:
    "[1C 15 01][09 03 {e(l_plural_male)} {e(l_plural_female)} {e(l_plural_neutral)}]" eob

Sadly, [1C 15 XX]'s purpose wasn't known at the time when EarthBound was translated into Portuguese. The English translators never needed to use it anywhere. Because of that, the Portuguese translation had no consistent way of displaying articles for enemy names. Ultimately I decided to only use the checks for the first line when encountering enemies, which allowed me to handle lines for the number and gender of an enemy in that first line, and then after that I just displayed the name without articles.

These article and gender systems will work better for some languages better than others. If your language doesn't fit the same pattern (there are more types of nouns, or the "the" flag needs to be used and be smarter), you may get by with some of the loopholes described here (repurposing the neuter gender for dropping "the," for example. But in many cases, to get everything correct, you'll need to request some custom ASSEMBLY work.

Item Configuration Table

This file is very similar to the enemy configuration table, in that it contains information about all the items in the game. Every item is represented by a number, followed by its attributes.

For a translation, all you will need to edit is the item's Name. But you may be wondering: "Why isn't there a "gender" attribute for items? They have genders too, right?"

That is a really good question. Coilsnake doesn't handle item genders. So how do we add appropriate articles to items? It's actually fairly simple. All you have to do is download these three files:

  • asm65816.ccs - This file contains ASM * instructions. You will need this for any kind of ccscript hacking. DO NOT EDIT THIS FILE. (A copy of this file is also linked on the CCScript Library.)
  • itemarticles.ccs - This contains a lot of technical stuff. DO NOT EDIT THIS FILE.
  • data_gender.ccs - This file coordinates all the articles for all the items.

You can go ahead and add these three files to the ccscript folder in your Coilsnake project folder. Then, what you will have to do is edit the data_gender.ccs file, updating the definite and indefinite articles (which are currently in Portuguese) to your language. These articles follow the order of the items listed in item_configuration_table.yml, so you can check that file to be sure to use the correct article for the correct item.

Now that you have edited the data_gender.ccs file, you can go ahead and edit the main text files, replacing the control code [1C 05 00] with {call(data_gender.item_article)} for indefinite articles and {call(data_gender.item_def_article)} for definite articles.

If you want to try it out, I suggest editing data_35.ccs first, since it contains the text for the item boxes in line 431. As an example, here is how that line would look like if you wanted to add an indefinite article to the item name:

"@There is {call(data_gender.item_article)} inside![03]" eob

Item Inventory Limit and Full-Name description.

If you try to translate the items, you'll notice that you might end up getting a text overflow. You can tell if you get a text overflow if you have a full inventory and somehow the last row of items are not there:

Text Overflow

If you overflow the item text too much, you'll even start to see the last letters of the item at the start of the next line in the inventory.

For certain translations, you'll have to shorten the name of the item so that it fits the Inventory's text. Let's say you translate "Mammoth Burger" to spanish "Hamburguesa Mamut". The word "Hamburguesa" is too long to fit the Inventory text, so you can shorten the text to something like "Hamb. Mamut" or something similar, depends on what you want to translate it to and what you think looks better for the Inventory to recognize the item easily.

Now that you have the Inventory text done, there is still some way to put the complete item name in the item description.

The description for the items are stored from data_02.ccs up to data_05.ccs inside the "ccscript" folder. You will see something like this for the Franklin Badge:

l_0xc53711:
    newline
    " <[1C 05 01]>" next

The code [1C 05 XX] is how CCScript determines which item is being loaded. To know exactly what code belongs to what item, download the following text file with the list of the items find in EarthBound with their corresponding HEX value for the code

  • item_codes.txt - This file contains a list of all the items found in EarthBound with their corresponding HEX value.

Now all you have to do is replace [1C 05 01] with the translation of the item you want to put in there. Let's try with the Franklin Badge's text:

l_0xc53711:
    newline
    " <Franklin Badge>" next

Translated to spanish for example:

l_0xc53711:
    newline
    " <Medalla Franklin>" next

That's it.

The game will now load whatever text you write in there instead of the shortened item name you used in item_configuration_table.yml.

Clone this wiki locally