Tool RPGM DazedMTLTool - A tool that provides quality MTL translations using ChatGPT

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
oh that's interesting. do you mind explaining?
Basically instead of making a single request per line of translation, now I translate 50 lines in a single request. It takes a bit of prompt engineering to get GPT to spit it out right and not combine lines but once you get a good output it reduces the cost dramatically... Around 10x cheaper which is why GPT-4 is now mainly what I use.
 

xorxorrax

Member
Modder
Apr 12, 2020
221
1,083
Basically instead of making a single request per line of translation, now I translate 50 lines in a single request. It takes a bit of prompt engineering to get GPT to spit it out right and not combine lines but once you get a good output it reduces the cost dramatically... Around 10x cheaper which is why GPT-4 is now mainly what I use.
Have you tried the new ? I've been meaning to try it vs traditional prompt engineering to batch translate lines and getting more consistent output but I haven't gotten the time try it.
 
  • Like
Reactions: dazedanon

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
Have you tried the new ? I've been meaning to try it vs traditional prompt engineering to batch translate lines and getting more consistent output but I haven't gotten the time try it.
Huh. No actually I didn't know this was a thing. It sounds perfect for this use case actually.

However since I have the output exactly as I need it right now with very little errors I kinda wanna leave it as is instead of accidentally breaking it by refactoring using this method lol.

Currently as I have it now you only get around 1 mismatch (lines given vs lines returned not matching) per game which is super easy to fix manually.

However this isn't the case for GPT 3.5, so it would actually make sense to try this method for that maybe if you wanna keep cost low. Though, I'm not a big fan of 3.5 anymore...
 

Thicc Lord

Purveyor of Assets
Trial Moderator
Uploader
Donor
Game Developer
Mar 20, 2019
4,529
10,904
Thread Rule #1 violation: off-topic
Lets not derail the threads with arguments.
Take it to off-topic, or a PM.

This is for questions and discussion around the tool, nothing else.
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
View attachment 3478864
Why are the inputs and outputs different?
Did I set it up wrong?
No it looks right. The input is the amount of tokens you send to OpenAI while the output is the amount of tokens sent back. Those get added together and the cost is caluclated afterwards.

For the mismatch error, just rerun the tool on that specific file.
 
Last edited:
  • Like
Reactions: SUKIRITOD

SUKIRITOD

Member
Feb 3, 2018
130
213
Not it looks right. The input is the amount of tokens you send to OpenAI while the output is the amount of tokens sent back. Those get added together and the cost is caluclated afterwards.

For the mismatch error, just rerun the tool on that specific file.
Ah yes, I got it... Thanks...
 
  • Like
Reactions: dazedanon
Mar 12, 2018
239
389
Basically instead of making a single request per line of translation, now I translate 50 lines in a single request. It takes a bit of prompt engineering to get GPT to spit it out right and not combine lines but once you get a good output it reduces the cost dramatically... Around 10x cheaper which is why GPT-4 is now mainly what I use.
Does it mean that game requests are cheaper now?
 

NTR-Lord

Newbie
May 24, 2023
16
66
How does one translate R-word stuff or /ss/ stuff or just any sexually explicit content through GPT with their account API key, without their account getting nuked. This is the part I don't understand. Even asking GPT to write you a lewd novel or a tragic story gets you a warning.
 

hehexdxdxd

New Member
Oct 8, 2017
7
1
Hi, I am having issues with the .env file. I have put the api and org key into the .env file but it doesn't seem to recognize the file at all as no variables are set when I run the script. Did I do something wrong?

1712129433607.png
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
Hi, I am having issues with the .env file. I have put the api and org key into the .env file but it doesn't seem to recognize the file at all as no variables are set when I run the script. Did I do something wrong?

View attachment 3505428
Looks like your project folder is in the wrong directory. Make sure the vscode project directory is the same one the env is in.
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
Is that not just what you select when you open folder?

View attachment 3505449
When you create a new terminal does it start you in the correct folder? 1712130239650.png

`GPT4-TL` is where my .env is. If that's correct I can only think you need to double check the format is correct for all the values inside. By default the py code will look for the .env in `./`
 

hehexdxdxd

New Member
Oct 8, 2017
7
1
`GPT4-TL` is where my .env is. If that's correct I can only think you need to double check the format is correct for all the values inside. By default the py code will look for the .env in `./`
Yea, if you look at my first image the directory in my terminal is the exact same

Here's dir for reference

1712130580959.png

For the .env I've literally changed nothing but put in the keys into key and organization inside "".
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
Yea, if you look at my first image the directory in my terminal is the exact same

Here's dir for reference

View attachment 3505464

For the .env I've literally changed nothing but put in the keys into key and organization inside "".
Oh I know the reason. You are running using `python ./start.py`. Thats causing the directory used to be where python.exe is located. Instead of doing that use F5 on the start.py file.

1712131184328.png
 

hehexdxdxd

New Member
Oct 8, 2017
7
1
Oh I know the reason. You are running using `python ./start.py`. Thats causing the directory used to be where python.exe is located. Instead of doing that use F5 on the start.py file.
Ah got it, thank you!

One more question: what I would like to translate is a dialogue script in a .txt file and is not really part of any game engine, so how should I approach this? Is the NScript module what I should be using? If not, is there an example of a file format that works that I should format the file to be?
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,036
18,379
Ah got it, thank you!

One more question: what I would like to translate is a dialogue script in a .txt file and is not really part of any game engine, so how should I approach this? Is the NScript module what I should be using? If not, is there an example of a file format that works that I should format the file to be?
You will have to modify a script to work with that specific txt format. I would actually use Wolf2 as a base (one I worked on most recently) and modify it to parse the text in the .txt file.

It reads a txt file line by line and uses regex to capture strings on that line needed to translate. It might be kind of difficult depending on the format of the text file.

Editing the `def translateWOLF` function should be all you really need to do. I would make use of the debugger and breakpoints to test each line of code step by step. Just change the if statements around to parse the txt as you like.

For example best practice for this tool (if possible) is to always grab the speaker of the line, translate it using `getSpeaker` then assign it to the speaker variable. Afterwards grab the line you want to translate and append it to the stringList. Do that for every line you wish to translate. Then last thing that is needed is to go into `#Pass 2` section below which has the responsibility of writing back into the txt file. You might not need to change anything here if the format is fairly simple. Otherwise make sure you are writing to the correct format.

1712132084704.png
 
Last edited: