Jump to content

Bionicle Heroes .rad and .nup extracting


Avak
 Share

Recommended Posts

I extracted everything from the main dat archive. I unpacked .pak archives. After unpacking I found .rad and .nup archives. Who knows how to unpack .rad and .nup archives? (I need bms script). Help me please.

Link to comment
Share on other sites

I vaguely recall these files back when I was having a brief look at the game, I would need to relook at them to see what they where. Did you perhaps have a some sample rad/nup files you could upload we could have a look at?

Link to comment
Share on other sites

Yes, I have these files. I can post them tomorrow.

 

I need to change the completeid in the game and by that I need to unpack the nup/rad files. I know that compleids are not in configuration files (.cfg) but it exists in compressed configuration in levels data

 

I need to play for all of piraka after defeating vezon. I know that vezon is tied to completeid25 in the game

Link to comment
Share on other sites

You can't really use it as is. But with that you should be able to write a tool edit the nup file as it pretty much explains how it is loaded. I might be able to write this tool, but not immediatly, I have a little bit of a backlog. If there's another tool maker lurking around, they might like to make this for you.

Link to comment
Share on other sites

Quisoves Potoo
9 hours ago, Avak said:

This is the script for unpacking the dat file (I have it already unpacked it). I need a script to unpack .nup and .rad level files

That's what I figured, I just wanted to make sure.

6 hours ago, Avak said:

I found part of the source code of the tt games engine. There's a nup file.cpp, how to use it?

Two things: This isn't *the* source code for any version of the TT Games-engine; rather, it's an attempt at reverse-engineering it. Secondly, you don't use a .cpp file on its own. It's a source code file, which is compiled with others into a binary executable. That said, the file presumably contains functions for processing the .nup format, so it may be worth studying.

Link to comment
Share on other sites

Yes, most likely this program is designed to compile/decompile nup and hgp files. 
We need to learn more about this program and how it works and try to compile it.

I do not know the C++ language so I am asking for your help.
Help me please.

Link to comment
Share on other sites

Quisoves Potoo
4 hours ago, Avak said:

Sorry that I am so late to reply to the topic just I live in Russia and we have at that time night. 

It's fine, this forum has members from all over the world. Besides, there's no need to rush.

 

Also, you must understand that this forum is rather less active than it once was. Time was when these sort of tools were written on a regular basis, but those days are long past. Someone might be still be able to help you, but don't expect instant results.

Link to comment
Share on other sites

Quisoves Potoo
11 hours ago, Avak said:

I can't create my own tool to unpack nup files because I don't know c++.Help me please with this. I really need to unpack .nup files.

C++ isn't strictly necessary; a scripting language such as Python should do nicely for your purpose.

Link to comment
Share on other sites

  • 3 weeks later...
Spoiler

# GSC NU20 (old Lego games) work-in-progress
#   it's a work-in-progress script that extracts only the textures.
#   currently it's not different than the results obtained with a file ripper.
# script for QuickBMS http://quickbms.aluigi.org

getdstring SIGN 4
goto 0
if SIGN u== "NU20"
    math MODE = 0
else
    math MODE = 1
    get DATA_SIZE long
    #goto DATA_SIZE 0 SEEK_CUR
    # this is where NU20 starts but TST0 doesn't have the size of the DDS!
    get FILES short # ERROR because it includes also the meshes and files without header!!!
    for i = 0 < FILES
        get DUMMY long
        get DUMMY long
        get DUMMY long
        get DUMMY long
        get DUMMY long
        get SIZE long
        savepos OFFSET
        log "" OFFSET SIZE
        math OFFSET + SIZE
        goto OFFSET
    next i
    cleanexit
endif

idstring "NU20"
get INFO_SIZE signed_long
if INFO_SIZE < 0
    math INFO_SIZE n INFO_SIZE
endif
get VER long
get DUMMY long
savepos TYPE_OFF
math DATA_OFF = INFO_SIZE
math DATA_OFF + 4   # DATA_SIZE
for TYPE_OFF = TYPE_OFF != INFO_SIZE
    getdstring TYPE 4
    get TYPE_SIZE long
    #print "%TYPE_OFF|X% %TYPE%"
    math TYPE_OFF + TYPE_SIZE
    string NAME p "%s/" TYPE

    if TYPE u== "NTBL"
        get LIMIT long
        savepos TMP
        math LIMIT + TMP
        for i = 0
            savepos TMP
            if TMP == LIMIT
                break
            endif
            get NAME string
            putarray 0 i NAME
        next i
    elif TYPE u== "TST0"
        math OFFSET = DATA_OFF
        for i = 0
            savepos TMP
            if TMP u>= TYPE_OFF
                break
            endif
            get DUMMY long
            get DUMMY long
            getdstring DUMMY 16
            getdstring DUMMY 0x2c
            get SIZE long
            getdstring DUMMY 0x38
            if SIZE != 0
                log NAME OFFSET SIZE
            endif
            math OFFSET + SIZE
        next i
    else
        xmath OFFSET "8 + (TYPE_OFF - TYPE_SIZE)"
        xmath SIZE   "TYPE_SIZE - 8"
        log TYPE OFFSET SIZE
    endif

    goto TYPE_OFF
next

script for extracting textures from nup/hgp!

But it doesn't works.

Link to comment
Share on other sites

8 hours ago, Avak said:

script for extracting textures from nup/hgp!

But it doesn't works.

Looks like that's actually for GSC files, not nup/hgp.

Link to comment
Share on other sites

  • 2 weeks later...

I took a look at the nup.cpp file from the github repo. The header structs and the NUP file you supplied didnt really seem to fit well (maybe i did a mistake?).

Regarding the textures:

They are stored as DDS files inside the NUP file. So when you search for "DDS " (with space) you get the start of DDS file. Only problem i see is, that we dont know the length of the DDS file, to extract it.

 

Even so, it is not really an elegant way of extracting information out of the NUP files.

Currently i have more than enough to work on, but when i finish LRR-remake i would definetly take a look at Bionicle Heroes

Link to comment
Share on other sites

On 2/28/2019 at 3:16 AM, miningmanna said:

I took a look at the nup.cpp file from the github repo. The header structs and the NUP file you supplied didnt really seem to fit well (maybe i did a mistake?).

Regarding the textures:

They are stored as DDS files inside the NUP file. So when you search for "DDS " (with space) you get the start of DDS file. Only problem i see is, that we dont know the length of the DDS file, to extract it.

 

Even so, it is not really an elegant way of extracting information out of the NUP files.

Currently i have more than enough to work on, but when i finish LRR-remake i would definetly take a look at Bionicle Heroes

miningmanna, I really need help unpacking .nup files because I'm bad at  hex system / file compression.

Link to comment
Share on other sites

  • 1 year later...

I tried running this (https://github.com/leftmostcat/mortar-eng?files=1) got the program to compile and everything but everytime I tried loading a .nup it crashes because of an invalid array size.
Debugging the code showed that the .nup files didnt have Model data for the program to load (The number of Materials, Meshes and Objects was 0 but the number of textures was in the millions). 
 

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.