Tyulis / 3DSkit

A multi-purpose and pluggable program to extract and repack files found in 3DS (and some other Nintendo consoles) games
GNU General Public License v3.0
68 stars 11 forks source link

Error extracting nx_bffnt font ,I don't know why. #14

Closed fejich closed 6 years ago

fejich commented 6 years ago

Font found in [Captain Toad:Treasure Tracker] NS version https://drive.google.com/open?id=1X4yCZtTADGWygFNK0ELZhMU5h2Id1sjW

Error Log

D:\TEST\3DSkit>3DSkit.py -x -V TitleFont32.bffnt

--------TitleFont32.bffnt--------
No compression
BFFNT file found
Extracting...
Version 4.1.0 (NX)
Texture format: BC4
Sheet width: 1024
Sheet height: 1024

Extracting wrapped BNTX
BNTI info for sheet 0:
 - Format: BC4
 - Width: 1024
 - Height: 1024
Traceback (most recent call last):
  File "D:\TEST\3DSkit\3DSkit.py", line 239, in <module>
    result = main(args, opts)
  File "D:\TEST\3DSkit\3DSkit.py", line 161, in main
    extract_files(filename, args.big, args.format, args.verbose, opts)
  File "D:\TEST\3DSkit\3DSkit.py", line 111, in extract_files
    unpack.extract(filename, file, format, endian, verbose, opts)
  File "D:\TEST\3DSkit\unpack\__init__.py", line 16, in extract
    unpacker = cls(*args)
  File "D:\TEST\3DSkit\util\utils.py", line 16, in __new__
    return self.main(*args, **kwargs)
  File "D:\TEST\3DSkit\unpack\BFFNT.py", line 84, in main
    self.readTGLP(data, self.tglpoffset - 8)
  File "D:\TEST\3DSkit\unpack\BFFNT.py", line 133, in readTGLP
    self.extract_underlying_BNTX(data)
  File "D:\TEST\3DSkit\unpack\BFFNT.py", line 189, in extract_underlying_BNTX
    self.extract_sheet_c3DSkit(data, outname, width, height, sheetsize, BNTI_FORMAT_NAMES[format], swizzlesize)
  File "D:\TEST\3DSkit\unpack\BFFNT.py", line 148, in extract_sheet_c3DSkit
    format = c3DSkit.getTextureFormatId(format)
AttributeError: module 'c3DSkit' has no attribute 'getTextureFormatId'
Tyulis commented 6 years ago

First, just a piece of advice, just use the -v option for verbose mode, -V is only intended to use with a debugger as it will turn every 3DSkit error into Python exceptions, that's not very convenient.

But that's not the question. Are you sure that c3DSkit is up to date ? If not, try to go in the c3DSkit folder, then remove the build folder and rebuild it with python3 setup.py install.

fejich commented 6 years ago

Thank you for your reply

I have tried: Python3 setup.py install. Error occurred: unable to find Vcvarsall.bat Computer environment: Win10 + Visual Studio 2017

Google search for half a day can not solve, I finally gave up.

Thank you again for your reply.

Hope to provide a compiled version of the download

Tyulis commented 6 years ago

I don't have any Windows, so I don't have a lot of experience with it.

I found this, if you haven't already tried, hope it can help.

Tyulis commented 6 years ago

Else I don't have released it yet, but I am working on a major refactoring to make a Python version of c3DSkit, for a better integration. When I'll have finished it, it would solve your problem, although it would be slower than using c3DSkit.

I just have to finish the audio part, so it shouldn't be too long

fejich commented 6 years ago

Thank you so much for your continued reply.

I'm interested in translating the game into Chinese, but I don't know how to program.

It's been a long time since you've been relying on these tools to do the job of modifying the game. Thanks again for your software.

fejich commented 6 years ago

Forgive my bad English, I have to use Google to send these posts :p

Tyulis commented 6 years ago

No problem, I'm not either a native speaker ;) I committed the changes, don't hesitate to report any other issue.

fejich commented 6 years ago
C:\Users\公司\Desktop\tm\3DSkit-master>3DSkit.py -vx TitleFont32.bffnt

--------TitleFont32.bffnt--------
No compression
BFFNT file found
Extracting...
Version 4.1.0 (NX)
Texture format: BC4
Sheet width: 1024
Sheet height: 1024

Extracting wrapped BNTX
BNTI info for sheet 0:
 - Format: BC4
 - Width: 1024
 - Height: 1024
 - Swizzle size: 0
Extracted

The new version is work👍

Found a problem, TitleFont32.bffnt should have two text charts picture. The software only exports a single picture.

Tyulis commented 6 years ago

Indeed, I hadn't noticed it. This seems to be a single texture to split into two sheets, with all metadata written like it would be with just one sheet. That's weird.

Tyulis commented 6 years ago

Done! The latest commit should unpack both sheets.