Tutorial Debuting 10 years of Phoenix Wright - Ace Attorney Script Editor 0.2.1

pinet

Active Member
OP
Newcomer
Joined
Feb 3, 2015
Messages
38
Trophies
0
Location
Samba Land
XP
154
Country
Brazil
--------------------------
[Objective]
This simple tutorial aims to show you a step-by-step how to translate the texts inside the PWAA game,
using the "PWSE 0.2-1" (by Deufeufeu) and the "DsBuff" (by WB3000) tools to extract,
edit, and reinsert these texts inside the game.

(This tutorial is free to copy, share, modify and distribute.)
--------------------------
Obs.: This thread is a tutorial for Deufeufeu XML-like script tool method!
There is the OnePieceFreek JSON-like method, optional link below:
:arrow: More one Phoenix Wright Translation Project for DS [PT-BR]


holdit.png

Hold it!:
For this tutorial, before start, lets check the pre-requisites and download the software.

placa.gif
Minimum System Requirements:

- Microsoft Windows 98, Me, XP, 2000, 7 or better:
- 300 MB disk space
- 512 MB RAM (> 1GB recommended)

software.gif
Minimum Software Requirements:

1. A Zip/Unzip program with support for 'zip', 'rar' and '7z' files
- name: (any) 7-zip, Winzip, etc…
- description: you will need it to unzip the programs below.
- link: www.7-zip.org, www.winzip.com
- type: zip programs
- size: may vary.

2. Phoenix Wright Script Editor 0.2.1
- name: PWSE_0.2-1_win32.rar (by deufeufeu)
- description: a not so much intuitive program for NDS pwaa game.
- link: Romhacking.net
- type: Script Editor to this game, for extract and re-insert text in ".bin" files.
- size: - 5.6 MB

3. A Pack/Unpack NDS tool.
- name: dsbuff0_61_BETA.zip (by WB3000)
- description: compatible with old and new Windows version
- link: dsbuff 0.61 BETA, alternative link: dsbuff 0.61 BETA
- type: Utility tool for unpack/pack NDS ROM
- size: ~750 KB

4. The game:
- name: 0127 - Phoenix Wright - Ace Attorney (U)(Legacy).7z
- description: the english version of the game.
- link: (not available here).
- type: NDS compacted file.
- size: ~34 MB

5. A DS Emulator:
- name: (any) DeSmume, No$GBA, iDeaS, etc...
- description: a DS emulator of your preference
- link: desmume.com, www.nogba.com, ideas.softonic.com.br (etc.)
- type: NDS emulator
- size: ~1.5 MB to 10MB

6. Phyton 2.7 (optional)
- python-2.7.14.msi
- the Program Language package, for debug or development
- link: www.python.org
- size: ~20 MB

7. Any simple text editor.


phoenix-coffee-a.gif

Let's do it!

sino.gif
Attentions
a. The icon files and images showed in the example may vary between systems
b. Follow the steps without jump any part. These are connected.

Part 1 of 7: Preparing the enviroment:

1.1. Create a folder:
- for this tutorial, let's create in "C:\" a folder called "PwaaProject"
- now create two sub-folders:
- ScriptsBin (we will use it to save the text files in binary format)
- ScriptsTxt (we will use it to save text files in readable text format)

1.2. Prepare NDS rom:
- Unzip the "0127 - Phoenix Wright - Ace Attorney (U)(Legacy).7z".
- for this tutorial, rename the file to "pwaa.nds"
- and move the "pwaa.nds" into "PwaaProject" folder.

parte1.png

(the image above is showing the nds extract file)

1.3. Prepare the Phoenix Wright Script Editor:
- unzip the program PWSE_0.2-1_win32.rar into a PWSE_0.2-1 folder.
- for this tutorial, move this folder into "PwaaProject"
- the program is "pwse.exe". Do not open it yet!

1.4. Prepare the DSBuff:
- Unzip the dsbuff0_61_BETA.zip program into a "DsBuff" folder
- For this tutorial, move this folder into "PwaaProject"

pwaa_folder_and_files.png

(the image above is showing the folders after this steps.)

End of this part.

Part 2 of 7: Extracting de pwaa.nds internal files:

2.1. open "DsBuff" folder and execute the program "d s b u f f.exe"
2.2. locate and open the rom "pwaa.nds"
2.3. press the "UnPack" button.
2.4. the rom files was unpacked on folder "C:\dsbuff\ NDS_UNPACK\"
2.5. enter in the folder "C:\dsbuff\NDS_UNPACK\data"
2.6. copy the "mes_all.bin" into "C:\dsbuff\" for backup reasons

End of this part.

Part 3 of 7: Extracting the pwaa bin's text dialogues from "mes_all.bin" file:


3.1. open the folder "PWSE_0.2-1" and run the program "pwse.exe"
pwse_folder.png

3.2. in the dialog window, locate and select the file rom "pwaa.nds"
pwse_select_pwaands.png

(Obs. if the dialog window is not showed, close the program, locate and
delete this two files "config.py" and "config.pyc")
3.3. select "Show advanced commands"
3.4. select "Extract script archive to a folder"
pwse_select_extract.png

3.5. in the dialogue window, select the folder "C:\dsbuff\NDS_UNPACK\data"
3.6. open the file "mes_all.bin"
pwse_select_extract_file.png

3.7. select the destination folder: "C:\PwaaProject\ScriptsBin"
pwse_select_extract_folder.png

3.8. the program extract all script texts in this folder,
with pattern "script-00.bin", "script-01.bin", "script-02.bin" and so on…
pwse_select_extract_result.png

End of this part

Part 4 of 7: Converting Binnary Text Scripts into Human Readable Text Files:

4.1. In the "pwse.exe" program, select "Show advanced commands"
4.2. select "Convert binary script to text"
pwse_convert_bintotxt_dialog.png

4.3. in the dialogue window, select the folder "C:\PwaaProject\ScriptsBin"
4.4. let's open the file "script-01.bin"
4.5. select the destination folder: "C:\PwaaProject\ScriptsTxt"
4.6. the program will convert "script-01.bin" into "script-01.txt".

Obs.: when a file is not conversible, the program save a 0 byte .dec file

End of this part.

Part 5 of 7: Translating the text file to other language:

Now you can translate the English text "script-01.txt" to another Latin or Roman
compatible language, like Brazilian Portuguese (PT-BR).

Example:
<bgcolor:769,8,31><shake:30,0><speed:2>Dammit!<wait:34> <speed:6>
to…
<bgcolor:769,8,31><shake:30,0><speed:2>Droga!!<wait:34> <speed:6>

...Why me?<wait:70><bgcolor:514,1,31><wait:15><nextpage_nobutton>
to
...Porque eu?<wait:70><bgcolor:514,1,31><wait:15><nextpage_nobutton>


sino.gif
Tips:
- the script supports Character Encoding, (for example, {384} = "-")
- but, for our convenience in this tutorial, it's recommended you suppress the
diacritical signs (accent acute, grave, cedilla etc.).
- to start, try translate the words to the same length and space available in
the sentence (max 30 chars lenght).
- it's good respect the order of the lines, in this first moment, for not crash
accidentally the game.

End of this part.

Part 6 of 7: Recompiling text file to binary file:

6.1. Copy all txt translated files to the "C:\PwaaProject\ScriptsBin"
6.2. if you want, move the old "bin" file, for backup.
6.3. In the "pwse.exe" program, select "Show advanced commands"
6.4. select "Make a script archive from a folder"
make_script_select.png

6.5. in the dialogue window, select the folder "C:\PwaaProject\ScriptsBin"
make_script_folder.png

6.6. in the next window, select "C:\dsbuff\NDS_UNPACK\data" and "mes_all.bin"
make_script_mes_all.png

6.7. the program will convert all text scripts and save it on "mes_all.bin".

End of this part.

Part 7 of 7: Repack the NDS rom:

(If "dsbuff" is already running, jump to 2.3.)
2.1. open the program "d s b u f f.exe"
2.2. locate the rom "pwaa.nds"
2.3. press the "Pack" button.
2.4. select the folder "C:\PwaaProject\". Choose other name, like "pwaa2.nds" and save.
2.5. close "dsbuff".

End of this part.


takethat.png

Some Evidences:

exemplo1.png
exemplo2.png
exemplo3.png

exemplo4.png
exemplo5.png
exemplo7.png

exemplo8.png
exemplo9.png


The patch:
Here is is the link to the patch for the full playable Phoenix Wright: Ace Attorney - Episode 1.
Translated to PT-BR language. Keep in mind this is an eternal working in progress. And some
diacritical signs are not available for this translation. The patch is scrictly compatible to the DS (U) ROM
[0127 - Phoenix Wright - Ace Attorney (U)(Legacy).nds]. Enjoy.
:download: nds-pwaa-episode1-pt-br.zip


_________________________________
objection.png

Any objection?

Please, fell free to comment in this thread


That's it.
I hope this tutorial has been useful.
My next desire is to find people who can translate the other episodes, because there are so many scripts to translate.
I would like to thank everyone, and keep alive the hope of one day seeing this fantastic story being translated into all languages.
 
Last edited by pinet,

Zense

GBARunner2 config: Touch touchscreen -> Press R
Member
Joined
Apr 20, 2008
Messages
1,869
Trophies
1
XP
3,254
Country
Italy
*Python :)

If I were confident enough in my linguistical capabilities, I'd give this a shot.

Great tutorial! Even if the windows pics' theme make it seem very outdated.
 
  • Like
Reactions: Luluca

pinet

Active Member
OP
Newcomer
Joined
Feb 3, 2015
Messages
38
Trophies
0
Location
Samba Land
XP
154
Country
Brazil
:!: 0197 - Phoenix Wright [PT-BR] Full Episode 1
Translation to Portuguese from DS (U) version game.
Some diacritical signs (ê, ã, ó...) suppressed due encode table.
___________________________
Patch for: 0127 - Phoenix Wright - Ace Attorney (U)(Legacy).nds)
:download: nds-pwaa-episode1-pt-br.zip

Enjoy.

Videos:
________
Part 1 of 9

(click on the image to see the video)
________
Part 2 of 9:

(click on the image to see the video)
________
Part 3 of 9:

(click on the image to see the video)
________
Part 4 of 9:

(click on the image to see the video)
________
Part 5 of 9:

(click on the image to see the video)
________
Part 6 of 9:

(click on the image to see the video)
________
Part 7 of 9:

(click on the image to see the video)
________
Part 8 of 9:

(click on the image to see the video)
________
Part 9 of 9:

(click on the image to see the video)

________
Alternative links for double-screen video:

________
Thanks for watching, for playing, and for comments.
 
Last edited by pinet,

pinet

Active Member
OP
Newcomer
Joined
Feb 3, 2015
Messages
38
Trophies
0
Location
Samba Land
XP
154
Country
Brazil
:!: Phoenix Wright - Swapping Scripts:

It's possible swap scripts for personalize the game.
This evidence below show script 21 running over script 1.
Testes over ROM: 0127 - Phoenix Wright - Ace Attorney (U)(Legacy).nds
  • Convert binary script-21.bin to text, using the method in this thread (main post).
  • Rename script-21.txt to script-01.txt
  • Edit, remake it and repack it, using the method in this thread (main post).
:teach: Obs.: The script will loop after end of testimony, because there is no evidence at the beginning of the game to trigger the objection of the third case.

(click over the image to see the video)

PT-BR. XML Injection Test

Sources and patches:
:download: nds-pwaa-ep21-over-ep01-pt-br.zip


It contains:
  • nds-pwaa-ep21-over-ep01-pt-br.xdelta (the patch for the example above)
  • script-01.txt (xml script for the example above)
  • readme_patching.txt (how-to patch a xdelta file into the NDS (U) ROM.
 
Last edited by pinet,

pinet

Active Member
OP
Newcomer
Joined
Feb 3, 2015
Messages
38
Trophies
0
Location
Samba Land
XP
154
Country
Brazil
:!: Derived translations from European scripts are not compatible with American ROMs and vice-versa:

Problem:
If the translation of DS European (Legacy) version is injected into DS American (Legacy) ROM and vice versa, the dialogue during the game may loop or hang. The instruction of an animation may be different and the game will be deregulated.

Reason:
Below is the code example (Defeufeu XML pattern) demonstrating the difference between the animation instructions of a "Judge hammer" for American and European ROMs. The effect of the inversion of the instructions in their respective ROMs, will imply the display of disconnected animations, mixing a bugged Steel Samurai animation from episode 3 in European version, or a bugged Redd White animation from episode 2 in American version, instead the "Judge hammer" animation.

Difference of animation instructions between scripts:
PwaaDsEvsUs01.png

Tested Roms:
0197 - Phoenix Wright - Ace Attorney (U)(Legacy)
0395 - Phoenix Wright - Ace Attorney (E)(Legacy)

Video with the inverted effect showing Redd White instead Butz:
 

pinet

Active Member
OP
Newcomer
Joined
Feb 3, 2015
Messages
38
Trophies
0
Location
Samba Land
XP
154
Country
Brazil
:!: Translation from English (U) Legacy is not fully compatible with (E) Supremacy ROM.

Test:
This test used two roms:

1. English Version with suppressed japanese language
  • 0197 - Phoenix Wright - Ace Attorney (U)(Legacy).nds
where:
  • script-00.txt = 1º case suppressed japanese
  • script-01.txt = 1º first case english
  • script-02.txt = 2º second case suppressed japanese

2. European Version with German, Italian and Spanish language.
  • 0705 - Phoenix Wright - Ace Attorney (E)(Supremacy).nds
where:
  • script-00.txt = 1º case italian
  • script-01.txt = 1º case german
  • script-02.txt = 1º case spanish

The test swapped a full functional translated pt-br script-01.txt over the equivalent spanish script-02.txt script.
After recompile with pwse and dsbuff (see main post of this thread) the results were odd.

Problem:
Swapping Portuguese-Brazil language translation, from English (U) Legacy ROM (0197 - Phoenix Wright - Ace Attorney (U)(Legacy).nds) to spanish DS ROM (0705 - Phoenix Wright - Ace Attorney (E)(Supremacy).nds) will appear bugged on screen, diacritical font signs will appear odd, dialogs and testimonials can loop endlessly, or the game can simple freeze on aleatory conversation.

Below, odd chars, text and images over first case.
pwaa_es_b1.png
pwaa_es_b2.png
pwaa_es_b3.png


Reason:
In addition to the encode table difference, below is the an instruction example (Defeufeu XML pattern) demonstrating the difference between the animation instructions of a "Judge hammer" for English and Spanish scripts. The effect of the inversion of the instructions in their respective ROMs, will imply the display of disconnected animations, mixing a bugged characters animation from episode 3 and 2 in (E) Supremacy ROM.

Instruction diff: top = English; down = Spanish
uxsdiff.png


Video with odd effects results on font text and animations, due swap.

Sources used:
:download: source_test_U_legacy_vs_E_supremacy.zip
 
Last edited by pinet,

Silversnake14

New Member
Newbie
Joined
May 14, 2018
Messages
1
Trophies
0
Age
35
XP
78
Country
Russia
Guys, i need some help.
Somehow, part 6 (recompiling to the binary file) doesn't work: I'm doing everything according to the manual, but final ROM has unchanged text. No errors were occured...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    KennieDaMeanie @ KennieDaMeanie: Might be the first dlc I actually buy