Jump to content
Avak

Bionicle Heroes .rad and .nup extracting

Recommended Posts

Avak

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.

Share this post


Link to post
Share on other sites
Cyrem

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?

Share this post


Link to post
Share on other sites
Avak

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

Share this post


Link to post
Share on other sites
Avak

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

Share this post


Link to post
Share on other sites
Cyrem

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Avak

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.

Share this post


Link to post
Share on other sites
Avak

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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Avak
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.

Share this post


Link to post
Share on other sites
mumboking
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.

Share this post


Link to post
Share on other sites
Avak
7 hours ago, mumboking said:

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

Nup/hgp files contain NU20 AND NTBL

Share this post


Link to post
Share on other sites
miningmanna

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

Share this post


Link to post
Share on other sites
Avak
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.

Share this post


Link to post
Share on other sites
Nullp0

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). 
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.