What is this?
I made an automatic translator for RMMV using AI in Node+Next.
I am just learning Node, so my code quality is not that good, but the results are really good.
I am giving this project as open source, so if anyone want to help to improve it is welcome!
I made it for RMMV, I don't know if it could work for RMMZ.
IMPORTANT: OpenAI's API offers a $18 credit for the first month; afterwards, a payment is required to continue using their services.
How it works?
RMMV stores the dialogues in data/MapXXX.json, every line is a code 401 command, so, you could have a dialogue like this:
The program joins the lines not ending in any of these separators: ,.?!
This way the line "Adversity may test us, but it also presents an" is not translated alone, the whole sentence is joined to get context: "Adversity may test us, but it also presents an opportunity for growth and transformation".
The translation is made with OpenAI (Chat GPT).
As the translation can has different length, the translation is splited again on the last space character before reaching the window limit.
So you could get something like this translating to spanish:
As you can see, the first line is separated, and the other lines made more characters than the original text, so a a new line appears in a new window, it also remove lines if the translation is shorter.
Choices are also translated, here I translated to "traditional chinese":
How to install it?
Install node js from here.
Download the translator for RMMV folder form here.
Before runing the server edit the .env file and write your Open AI API key, you can create a new key here.
Extract the folder and copy you maps.json (Map001.json, Map002.json, Map003.json...) in the maps folder.
Right click on the "RMMVTranslatorAI" folder and select "Open command windows here" or "Open in windows terminal".
run the following commands:
finally open http://localhost:3000/
How to use it?
When you run the server you will see something like this:
You have to write a language, you could wirte something like "italian" or "medieval chinese".
And select a file, you will see a list of all the files you drop in the "maps" folder.
When you press "Translate file", you will see the translation below and a new file will appear in the maps folder.
And that is all, you now have all the dialogues in that map translated.
What can be translated?
Dialogues and choices can be translated for the following files:
How can you help?
If you think you can help improve this, you are welcome. There are many things I don't know how to do as I am relatively new to programming in Node.
Some features needed:
If you have any problem tell me.
I made an automatic translator for RMMV using AI in Node+Next.
I am just learning Node, so my code quality is not that good, but the results are really good.
I am giving this project as open source, so if anyone want to help to improve it is welcome!
I made it for RMMV, I don't know if it could work for RMMZ.
IMPORTANT: OpenAI's API offers a $18 credit for the first month; afterwards, a payment is required to continue using their services.
How it works?
RMMV stores the dialogues in data/MapXXX.json, every line is a code 401 command, so, you could have a dialogue like this:
Code:
"Really!?"
"Adversity may test us, but it also presents an"
"opportunity for growth and transformation."
The program joins the lines not ending in any of these separators: ,.?!
This way the line "Adversity may test us, but it also presents an" is not translated alone, the whole sentence is joined to get context: "Adversity may test us, but it also presents an opportunity for growth and transformation".
The translation is made with OpenAI (Chat GPT).
As the translation can has different length, the translation is splited again on the last space character before reaching the window limit.
So you could get something like this translating to spanish:
Code:
"¿¡En serio!?"
"La adversidad puede ponernos a prueba,"
"pero también nos presenta una"
"oportunidad para el crecimiento y la"
"transformación"
As you can see, the first line is separated, and the other lines made more characters than the original text, so a a new line appears in a new window, it also remove lines if the translation is shorter.
Choices are also translated, here I translated to "traditional chinese":
How to install it?
Install node js from here.
Download the translator for RMMV folder form here.
Before runing the server edit the .env file and write your Open AI API key, you can create a new key here.
Extract the folder and copy you maps.json (Map001.json, Map002.json, Map003.json...) in the maps folder.
Right click on the "RMMVTranslatorAI" folder and select "Open command windows here" or "Open in windows terminal".
run the following commands:
Code:
npm run build
npm run dev
finally open http://localhost:3000/
How to use it?
When you run the server you will see something like this:
You have to write a language, you could wirte something like "italian" or "medieval chinese".
And select a file, you will see a list of all the files you drop in the "maps" folder.
When you press "Translate file", you will see the translation below and a new file will appear in the maps folder.
And that is all, you now have all the dialogues in that map translated.
What can be translated?
Dialogues and choices can be translated for the following files:
- Map files (mapXXX.json)
- Troops.json
- CommonEvents.json
How can you help?
If you think you can help improve this, you are welcome. There are many things I don't know how to do as I am relatively new to programming in Node.
Some features needed:
Set character per line based on the portrait, with no portrait characters are 55, with portrait characters are 43Currently the program translates dialogues only (code 401), other texts like "Show Choices" needs to be included- "Show scrolling text" should also be translated.
- 2023-05-23: Fixed some bugs related to spaces, line breaks and question marks.
- 2023-05-26: Fixed some bugs related to indentation, now the character limit with portrait decreases from 55 and 43, both values are editable.
- 2023-05-26: Now choices are also translated.
- 2023-11-22: Changed the code to use the GPT 3.5-Turbo, it is faster and cheaper.
- 2023-11-22: Fixed some bugs related to game codes (like \V[51] ).
- 2023-11-22: Fixed a bug which caused some choices translation to have double double quotes (""option"").
If you have any problem tell me.