hướng dẫn việt hóa Prototype 2 (2012) – (Text and Font Tool)

Simple Python/EXE tool for exporting and importing the English text of Prototype 2 (2012) PC.
It exports the game text into one editable TXT file, then imports the edited text and fonts folder back by rebuilding and patching the original English game archives directly.

Usage:
Place the tool in the game root folder, next to the game EXE and the .rcf archives
First run exports: Prototype2_Text.txt
First run also exports GFX/font files to: Prototype2_Fonts
Translate Prototype2_Text.txt line by line
Do not add, delete, merge or reorder lines
Keep all tags/placeholders unchanged, for example: %0:BUTTON03, %1:STRING, %1:NUMBER, \n
Do not translate or edit AudioFile lines, because they are usually internal audio/file references, not normal visible text. AudioFile lines are not worth translating and changing them may cause missing dialogue, broken references or game issues
Second run imports Prototype2_Text.txt and patches the needed .rcf archives
If Prototype2_Fonts exists, the tool also imports the modified .gfx files back into the correct .rcf archives
Backups are created automatically in: Prototype2_TextTool_Backup

Font/GFX usage:
Font/GFX files are exported to: Prototype2_Fonts
The files keep their archive/internal folder structure, for example: Prototype2_Fonts\art.rcf\art\hud\fonts_latin.gfx
To import modified font files, keep the same folder structure and run the tool again
The tool will rebuild the affected .rcf archive and inject the modified .gfx files
For normal font replacement/editing, it is probably enough to modify fonts_latin.gfx. In most cases, start with fonts_latin.gfx first
Use JPEXS Free Flash Decompiler / FFDec for opening and editing .gfx files: https://github.com/jindrapetrik/jpexs-decompiler
.gfx files are Scaleform GFx / Flash-based UI files, so many of them are UI screens, images or HUD elements, not actual fonts
Do not edit every exported .gfx file blindly
Small .gfx files are usually small UI/image/texture reference assets and are not normally needed for font editing

Tech infos:
RCF magic: ATG CORE CEMENT LIBRARY
RCF archives use an entry table with hash, offset and size values
RCF metadata stores internal file names and alignment values
P3D files use Pure3D-style chunk data
Many .p3d.rz files are RZ-wrapped zlib-compressed P3D files
Text data can be stored in P3D/TextBible-style chunks and dialogue subtitle chunks
Audio dialogue subtitles can contain language blocks and audio-related references
AudioFile entries are internal references and should normally be kept unchanged
NIS/cinematic subtitles, UI text, mission text and dialogue subtitles may be stored across multiple .rcf archives
The tool recalculates sizes, offsets and rebuilt archive data during import

Important archives:
art.rcf: UI text, HUD text, tutorial text, cinematic/NIS text and GFX/font files
00audio.rcf: many gameplay voice subtitles and dialogue text
01audio.rcf: additional gameplay/dialogue subtitles
movies.rcf: movie/FMV subtitle data
00woi.rcf / 01woi.rcf / 02woi.rcf / 03woi.rcf: Web of Intrigue subtitle/text data
scripts.rcf: scripts and other text-related files, usually not the main subtitle source

Note:
(The EXE is a standalone Python program compiled with PyInstaller. It does not contain any virus or malicious code. However, because PyInstaller packs Python, required libraries, and the script into a single executable, some antivirus programs or VirusTotal may report false positives. If you do not trust the EXE, use the original Python script instead, inspect the source code yourself, or build the EXE on your own machine.)

Source: Noob – ResHax

1. Giới thiệu về JPEXS Free Flash Decompiler (FFDec)
JPEXS Free Flash Decompiler (FFDec) là một công cụ mã nguồn mở vô cùng mạnh mẽ được sử dụng để phân tích, dịch ngược (decompile), chỉnh sửa và trích xuất tài nguyên từ các tệp Adobe Flash (định dạng .swf).

Do được viết bằng ngôn ngữ Java, công cụ này có thể hoạt động đa nền tảng trên Windows, macOS và Linux. Đây là một trong những công cụ phổ biến và toàn diện nhất hiện nay dành cho các lập trình viên, nhà nghiên cứu bảo mật, hoặc những người muốn mod/việt hóa các tựa game Flash cũ.

2. Các tính năng nổi bật của công cụ

  • Trích xuất tài nguyên (Resource Extraction): Cho phép bạn xuất hàng loạt các thành phần bên trong tệp SWF như: mã nguồn (scripts), hình ảnh (shapes/images), âm thanh (sounds), phông chữ (fonts), video và các đoạn text.
  • Chỉnh sửa trực tiếp (Editing Capabilities):
    • Chỉnh sửa trực tiếp mã nguồn ActionScript (hỗ trợ cả AS1, AS2 và AS3).
    • Thay thế trực quan các tài nguyên như hình ảnh, âm thanh, văn bản mà không làm hỏng cấu trúc tệp.
    • Chỉnh sửa nâng cao thông qua mã nguồn cấp thấp (Assembler) hoặc mã Hex (Hex dump).
  • Chuyển đổi định dạng: Hỗ trợ chuyển đổi tệp SWF sang định dạng dự án nguồn FLA (để mở bằng Adobe Flash / Animate) hoặc xuất/nhập dưới dạng XML.
  • Trình gỡ lỗi tích hợp (ActionScript Debugger): Hỗ trợ đặt điểm dừng (breakpoints), theo dõi giá trị biến số và chạy từng bước mã nguồn để phân tích luồng xử lý của tệp Flash.
  • Các tính năng nâng cao khác:
    • Hỗ trợ định dạng UI game chuyên dụng như GFX Scaleform (thường dùng trong các game lớn).
    • Tích hợp Proxy Server để bắt và phân tích các tệp SWF được tải từ trình duyệt web.
    • Công cụ giải mã/chống làm mờ mã nguồn (Deobfuscation).

3. Hướng dẫn sử dụng cơ bản
Bước 1: Chuẩn bị môi trường & Tải về

  1. Cài đặt Java: Vì FFDec chạy trên nền tảng Java, bạn cần đảm bảo máy tính đã cài đặt Java Runtime Environment (JRE) hoặc Java Development Kit (JDK) bản mới nhất.
  2. Tải công cụ: Truy cập mục Releases trên trang GitHub jpexs-decompiler để tải về phiên bản mới nhất dưới dạng trình cài đặt (Installer) hoặc bản chạy ngay không cần cài đặt (Portable – file .zip hoặc .jar).

Bước 2: Mở và khám phá cấu trúc tệp SWF

  1. Khởi chạy chương trình FFDec.
  2. Chọn File > Open ở góc trên cùng bên trái và tìm đến tệp .swf bạn cần phân tích.
  3. Khám phá giao diện:
    • Cột bên trái (Navigation Pane): Hiển thị cấu trúc dạng cây của tệp SWF được chia thành các thư mục như texts, images, shapes, sounds, fonts, scripts (chứa mã ActionScript).
    • Vùng hiển thị ở giữa/phải (Viewing Pane): Hiển thị nội dung chi tiết của thành phần bạn đang chọn ở cột bên trái (như xem code ActionScript, xem trước hình ảnh hoặc nghe thử âm thanh).

Bước 3: Trích xuất tài nguyên (Hình ảnh, Âm thanh, Code…)

  1. Tại cột bên trái, tìm đến thư mục chứa loại tài nguyên bạn muốn xuất (ví dụ thư mục images hoặc sounds).
  2. Nhấp chuột phải vào tài nguyên cụ thể (hoặc nhấp chuột phải vào cả thư mục mẹ để xuất hàng loạt) và chọn Export hoặc Export selection.
  3. Chọn định dạng đầu ra mong muốn và chọn thư mục lưu trữ trên máy tính của bạn.

Bước 4: Chỉnh sửa mã ActionScript hoặc thay thế tài nguyên

  • Chỉnh sửa Code:
    1. Tìm đến mã script cần chỉnh sửa trong thư mục scripts.
    2. Ở bảng bên phải hiển thị mã nguồn, nhấp vào nút Edit ở phía dưới hoặc nhấp chuột phải chọn Edit ActionScript.
    3. Thực hiện thay đổi mong muốn, sau đó nhấn Save để áp dụng thay đổi cho tệp.
  • Thay thế hình ảnh/âm thanh:
    1. Nhấp chuột phải vào ảnh hoặc âm thanh cần đổi ở cột bên trái.
    2. Chọn Replace… và trỏ tới tệp hình ảnh/âm thanh mới trên máy tính của bạn để thay thế.

Bước 5: Lưu lại tệp SWF mới

  • Sau khi hoàn tất các chỉnh sửa, chọn File > Save hoặc Save as… để ghi đè hoặc tạo ra một tệp SWF mới chứa các thay đổi của bạn.

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

0
    0
    Tạo wiki game yêu thích
    Giỏ game trốngTrở lại trang
    Lên đầu trang