Editing How Pikmin 2 loads text

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
  
  
The way ''Pikmin 2'' loads text is very complicated. That is why I am making a page to describe what I've learned about how it works and how I made new treasures that have text associated with them. The first thing to note is that the game loads text in 2 different ways. In cutscenes, text loaded in text boxes is loaded by its index in the BMG file. Every other part of the game uses the text's ID.
+
The way Pikmin 2 loads text is very complicated. That is why I am making a page to describe what I've learned about how it works and how I made new treasures that have text associated with them. The first thing to note is that the game loads text in 2 different ways. In cutscenes, text loaded in text boxes is loaded by its index in the BMG file. Every other part of the game uses the text's ID.
  
 
The way index loading works is simple.  You enter what index the game should load in the cutscene's STB and it loads the text, even its brand new text after the last vanilla message. If the game only called text by index, we could easily add as much new text as we want. But it doesn't, the game '''ONLY''' loads text this way for cutscenes.
 
The way index loading works is simple.  You enter what index the game should load in the cutscene's STB and it loads the text, even its brand new text after the last vanilla message. If the game only called text by index, we could easily add as much new text as we want. But it doesn't, the game '''ONLY''' loads text this way for cutscenes.
  
Loading text by ID is where things get messy, and unfortunately, its what the game does 99% of the time. you can change the ID of existing text boxes and it works fine. but adding new text boxes messes with the whole system. New text messages have to be put at the end of the list or you break the game loading by index. Unfortunately, '''the game will NOT load text by ID if the text's index is higher than the highest index in the vanilla game'''. In other words, '''you CAN NOT add new text entirely unless its being loaded by index''', which is unlikely unless you're somehow making all new cutscenes.
+
Loading text by ID is where things get messy, and unfortunately, its what the game does 99% of the time. you can change the ID of existing text boxes and it works fine. but adding new text boxes messes with the whole system. New text messages have to be put at the end of the list or you break the game loading by index. Unfortunately, the game will NOT load text by ID if the text's index is higher than the highest index in the vanilla game. In other words, you CAN NOT add new text entirely unless its being loaded by index, which is unlikely unless you're somehow making all new cutscenes.
  
 
== How I Made Custom Treasures Have Text==
 
== How I Made Custom Treasures Have Text==
  
  
Now to explain how my custom treasure has text that loads. Of course, all text associated with the treasure collection screen and piklopedia is loaded by ID. In the games boot.dol there is a line that tells the game to start reading treasure IDs at ID 0101_00. There are also lines that tell the game where to start reading Olimars log and Sales Pitch. Normally the treasure names stop at 0301_00 for the 201 vanilla treasures. After that there is a gap in IDs until 0401_00 where it starts reading Olimars journal entries. Olimars log goes to 0601_00 where the Sales pitches pick up right after starting at 701_00. It's good theres a gap between each group because that allows me to use ID 0302_00 to ID 0400_00 for treasure name text without having to change ID numbers for Olimar Journals. The issue is that, as I said before, I cant just add new text and move everything else forward, or all text messages past the highest vanilla index wont load. This means I have no choice but to overwrite Olimars Journal entries while changing their IDs to be in sequence starting where the vanilla entries end. I can then move Olimars Logs to replace sales pitches. Thankfully, '''theres no part of the code that tells the game to STOP reading text IDs''' after 301_00, and it just keeps using text for each treasure until theres a gap in IDs, where it stops.  
+
Now to explain how my custom treasure has text that loads. Of course, all text associated with the treasure collection screen and piklopedia is loaded by ID. In the games boot.dol there is a line that tells the game to start reading treasure IDs at ID 0101_00. There are also lines that tell the game where to start reading Olimars log and Sales Pitch. Normally the treasure names stop at 0301_00 for the 201 vanilla treasures. After that there is a gap in IDs until 0401_00 where it starts reading Olimars journal entries. Olimars log goes to 0601_00 where the Sales pitches pick up right after starting at 701_00. It's good theres a gap between each group because that allows me to use ID 0302_00 to ID 0400_00 for treasure name text without having to change ID numbers for Olimar Journals. The issue is that, as I said before, I cant just add new text and move everything else forward, or all text messages past the highest vanilla index wont load. This means I have no choice but to overwrite Olimars Journal entries while changing their IDs to be in sequence starting where the vanilla entries end. I can then move Olimars Logs to replace sales pitches. Thankfully, theres no part of the code that tells the game to STOP reading text IDs after 301_00, and it just keeps using text for each treasure until theres a gap in IDs, where it stops.  
  
 
It's worth noting that the game uses 2 copies of a treasures name for the collection screen and the pikopedia. After I post this, I'm going to experiment with it because I think I might be able to make the game use only 1 entry for each name, which would mean the names wouldn't overflow into olimars log and olimars log would only overflow into sales pitch for the first 50, keeping 151 sale pitch entries. This could be a big help, but no guarentee it will work.
 
It's worth noting that the game uses 2 copies of a treasures name for the collection screen and the pikopedia. After I post this, I'm going to experiment with it because I think I might be able to make the game use only 1 entry for each name, which would mean the names wouldn't overflow into olimars log and olimars log would only overflow into sales pitch for the first 50, keeping 151 sale pitch entries. This could be a big help, but no guarentee it will work.

Please note that all contributions to Pikmin Technical Knowledge Base are considered to be released under the Creative Commons Attribution-ShareAlike (see Pikmin Technical Knowledge Base:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)