Separate names with a comma.
Discussion in 'NDS - ROM Hacking and Translations' started by Whizz, Jul 10, 2008.
Problem seems to occur when repacking, and it's not related to the ptxt files at all.
I have not hacked the game myself but two things are possible.
When you say garbled are there random symbols/characters not like the ones you put in or are they just shifted around like:
If it is the latter then the chances are the pointers are not correct. Pointers post if you needed it:
Warning: Spoilers inside!
Pointers are just an index of the starts of sentences/paragraphs and it is used in nearly all occasions (some are fixed length but there are workarounds there, this is usually for menus though and even more rare is the end of section flag (here there is something the game parses and then starts a new line)). Typically they will be at the start of the text file or in a very similarly named file in the same directory, on rare occasions pointers can be in the binary (the ARM9 for the DS).
The will usually be a long string of numbers (you may have to flip them ABCD->DCBA or 0F76 -> 67F0) which may have "junk" between them (this junk can also be length of section, whether the text is bold/underlined or something like that).
When you change the length of the text naturally the pointer will now point to the wrong place.
Repointing is just changing the pointers to err point to the new position of the text.
There are several different styles of pointer, rather than type them out though (I am halfway through making a final version but have not done pointers yet) can I get you to go to the hacking docs:
(page search for "pointers")
A simple example of plain pointers (linked in the topic):
The easiest way for me is to use a spreadsheet with hex capabilities (open office has hex2dec and the like built in and MS office if you add in the engineering pack has the option). Copy and paste the old pointer table (it will usually be simple enough to calculate so a list of where the pointers are can be useful) in along with the actual position of the original text to figure out how they match up (you might want to do a simple test).
Now you have the method the original pointers use you can reapply it to the edited text and get the new pointers.
Second to this is character limits. Often games will only allow 60 characters per line and will do odd things (scatter files across lines, post on top the other characters, crash....)
If the characters are garbled then your have the encoding wrong. Often this is something trivial like starting the characters at a point that is not 16bit aligned (or that they are 16 bit aligned and the game does not want/expect this; hex editors are notorious for aligning unicode while games just use a single FF or something to mark the end of the line, workaround in that case is use ASCII and just skip every other character (which will likely be a 00) or get a better editor). To test, get the original file and just change two or three characters (if you come the end of the sentence/section stop) in whatever way you like. If it works then it is likely pointers that are your problem. If it does not then it is likely the encoding is wrong
Thanks for your reply. Something seems to go wrong with either the unpacking or the repacking. I took the rom, unpacked it, repacked it and I had the same result as before. Original works fine.
Is there some way to get past this problem?
i guess you'll have some extra work.
most likely it uses exact locations within the nds file, and since repacking removes some empty spaces files get a different location.
to fix it you'd either need to be able to change the location where it takes it's data from, or you'd need to apply any changes directly into the NDS using a hex editor.
Thanks for the reply.
I tried editting the rom, same result. However when I tried a trimmed version I was able to change some letters. When I try to edit whole lines I run into the pointer problem Fast mentioned. I just read the info and it seems to be a bit more difficult than I first expected...
the ptxt files I mentioned earlier start with:
Warning: Spoilers inside!