ROM Hack [Release] MSBT Editor Reloaded

  • Thread starter Thread starter IcySon55
  • Start date Start date
  • Views Views 112,002
  • Replies Replies 218
  • Likes Likes 27
@Zarklord I don't. There's no need for me to know how the games use the labels. I only know how the format is structured and write the code to handle that.

The dev names don't have any weird characters before them. I presume there's a label API in the games and the game files refer to the dev names when they want to load a specific label.
 
@Zarklord I don't. There's no need for me to know how the games use the labels. I only know how the format is structured and write the code to handle that.

The dev names don't have any weird characters before them. I presume there's a label API in the games and the game files refer to the dev names when they want to load a specific label.
so you know how to match up the label to the string in your program right? well how is that done?
 
so you know how to match up the label to the string in your program right? well how is that done?
If I'm remembering correctly, the labels are three pieces of information.

1 byte string length
N bytes for the string
4 byte index (32bit unsigned int)

The labels give you an index into the TXT2 section which stores all the strings. After reading in the TXT2 section, you simply pull an entry out by index based on the labels.

Edit: You can also just https://github.com/IcySon55/3DLandMSBTeditor/blob/master/MSBT.cs read the code. ;P
 
If I'm remembering correctly, the labels are three pieces of information.

1 byte string length
N bytes for the string
4 byte index (32bit unsigned int)

The labels give you an index into the TXT2 section which stores all the strings. After reading in the TXT2 section, you simply pull an entry out by index based on the labels.

Edit: You can also just https://github.com/IcySon55/3DLandMSBTeditor/blob/master/MSBT.cs read the code. ;P
so one question where do i apply the 4 byte index to the txt2 section?
 
so one question where do i apply the 4 byte index to the txt2 section?
You don't.

TXT2 holds all strings in order. LBL1 ties each label to its respective TXT2 entry via an index (position) in the ordered list of TXT2 entries.

What are you trying to do exactly because your questions don't seem to be getting anywhere?

If you're trying to add a new label entry. Doing it manually is not easy. Very not easy. My current code doesn't do it properly yet.
 
Last edited by IcySon55,
You don't.

TXT2 holds all strings in order. LBL1 ties each label to its respective TXT2 entry via an index (position) in the ordered list of TXT2 entries.

What are you trying to do exactly because your questions don't seem to be getting anywhere?
im trying to figure out how to add msbt labels and strings for smash 4 modding...

Edit:so i would go the 84th(hex) string to get that result right?
Edit2: got it go to the 4 byte index + 1 to get string number...
 
Last edited by Zarklord,
im trying to figure out how to add msbt labels and strings for smash 4 modding...

Edit:so i would go the 84th(hex) string to get that result right?

It is not currently possible to add new labels properly. You can try it but the game will not load the string. You have to calculate the label group value for the string you are adding and then increase the count of labels for that group by 1. I also think that the labels may need to be in order (likely alphabetical) and then all of the relocated strings would change the indexes for all of the labels.

Basically, you are not going to be able to add a new string via hex editing alone. I do have a version of MSBT Editor with an early attempt at adding new labels but it has been tested with Smash and doesn't work, yet.

When I find the time, I'll likely be working on this exact feature but I'm swamped atm with real life.
 
  • Like
Reactions: I pwned U!
I've Currently Cheesed The Second(Female) Villager Tag To Be Pikmin's Tag and in your editor it shows up fine see: Capture.PNG but in game it freaks out like not loading tags after the first pikmin 02 reference(i believe) could it be something to do with txt2 text pos or something else?
 
Did you change the name of one of the labels? You can't do that. It doesn't work.

Like I said, adding new labels is not currently possible. Especially manually.
 
Edit: @Kinnay clarified the checksum. You'll need to AND the value with 0xffffffff before doing the modulo, since the 3DS and Wii U only handle 32 bits of data. I sent IcySon55 detailed information on how to add new entries, now that we can move forward with validating them.
can you send me them as well?
 
This was useful: http://rhcafe.us.to/?page=wiki&id=MSBT_(File_Format)

C# Function to determine the label group:
Code:
public uint LabelChecksum(string label)
{
    uint group = 0;

    for (int i = 0; i < label.Length; i++)
    {
        group *= 0x492;
        group += label[i];
        group &= 0xFFFFFFFF;
    }

    return group % LBL1.NumberOfGroups;
}


Good luck. Properly rearranging the labels just to add one will be a real pain to do manually.
 
This was useful: http://rhcafe.us.to/?page=wiki&id=MSBT_(File_Format)

C# Function to determine the label group:
Code:
public uint LabelChecksum(string label)
{
    uint group = 0;

    for (int i = 0; i < label.Length; i++)
    {
        group *= 0x492;
        group += label[i];
        group &= 0xFFFFFFFF;
    }

    return group % LBL1.NumberOfGroups;
}


Good luck. Properly rearranging the labels just to add one will be a real pain to do manually.
thx before this i was 101 tries to get it right...
 

Site & Scene News

Popular threads in this forum