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

Discussion in 'NDS - Tutorials' started by pinet, Oct 19, 2017.

  1. pinet
    OP

    pinet Member

    Newcomer
    38
    40
    Feb 3, 2015
    Brazil
    Samba Land
    --------------------------
    [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]


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

    [​IMG] Minimum System Requirements:

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

    [​IMG] 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.


    [​IMG]
    Let's do it!

    [​IMG] 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.

    [​IMG]
    (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"

    [​IMG]
    (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"
    [​IMG]
    3.2. in the dialog window, locate and select the file rom "pwaa.nds"
    [​IMG]
    (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"
    [​IMG]
    3.5. in the dialogue window, select the folder "C:\dsbuff\NDS_UNPACK\data"
    3.6. open the file "mes_all.bin"
    [​IMG]
    3.7. select the destination folder: "C:\PwaaProject\ScriptsBin"
    [​IMG]
    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…
    [​IMG]
    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"
    [​IMG]
    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>


    [​IMG] 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"
    [​IMG]
    6.5. in the dialogue window, select the folder "C:\PwaaProject\ScriptsBin"
    [​IMG]
    6.6. in the next window, select "C:\dsbuff\NDS_UNPACK\data" and "mes_all.bin"
    [​IMG]
    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.


    [​IMG]
    Some Evidences:

    [​IMG] [​IMG] [​IMG]
    [​IMG] [​IMG] [​IMG]
    [​IMG] [​IMG]

    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


    _________________________________
    [​IMG]
    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, Nov 27, 2017
    WiiU, MUDD_BR, Ricken and 8 others like this.
  2. pinet
    OP

    pinet Member

    Newcomer
    38
    40
    Feb 3, 2015
    Brazil
    Samba Land
  3. Zense

    Zense GBAtemp Regular

    Member
    298
    202
    Apr 20, 2008
    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.
     
    Luluca likes this.
  4. Jacklack3

    Jacklack3 ( ゚ヮ゚) buddie was here

    Member
    1,644
    2,138
    Oct 6, 2015
    Canada
    In your basement Dick Size: 5 meters.
    I would plan a kidnapping for a Ace Attorney Editor which instead of fan-cases on fan-games, it'd be fan-cases using rom hacks!
     
    Luluca likes this.
  5. Mr Skinner

    Mr Skinner Member

    Newcomer
    49
    11
    Jul 12, 2010
    Brazil
    Bananna Land.
    There are very few opportunities to be Brazilian in an online community and feel pride in the achievements of your compatriots. This is one of those rare opportunity to thank you, @pinet for the exceptional work done here.

    Feel proud of your own effort.
     
    Luluca and pinet like this.
  6. MUDD_BR

    MUDD_BR GBAtemp Regular

    Member
    236
    47
    Nov 17, 2008
    Brazil
    Awesomewok, mate. If I haven't played this jewel years ago and if the others wasn't in my list... I'll certainly try sometime.
     
    Luluca and pinet like this.
  7. pinet
    OP

    pinet Member

    Newcomer
    38
    40
    Feb 3, 2015
    Brazil
    Samba Land
    :!: 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
    [​IMG]
    (click on the image to see the video)
    ________
    Part 2 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 3 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 4 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 5 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 6 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 7 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 8 of 9:
    [​IMG]
    (click on the image to see the video)
    ________
    Part 9 of 9:
    [​IMG]
    (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, Nov 28, 2017
    Luluca and Gamerulez like this.
  8. pinet
    OP

    pinet Member

    Newcomer
    38
    40
    Feb 3, 2015
    Brazil
    Samba Land
    :!: 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)
    [​IMG]
    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, Nov 30, 2017
    Luluca and Gamerulez like this.
  9. pinet
    OP

    pinet Member

    Newcomer
    38
    40
    Feb 3, 2015
    Brazil
    Samba Land
    :!: 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:
    [​IMG]
    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:
     
    Luluca and Gamerulez like this.
  10. pinet
    OP

    pinet Member

    Newcomer
    38
    40
    Feb 3, 2015
    Brazil
    Samba Land
    :!: 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.
    [​IMG] [​IMG] [​IMG]

    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
    [​IMG]

    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, Nov 30, 2017
    Luluca and Gamerulez like this.
  11. RubiseL
    This message by RubiseL has been removed from public view by porkiewpyne, Dec 24, 2017.
    Dec 24, 2017