The problem is that I've got no coding knowledge and the other problem is, is that I'm looking for a program to edit text, that can manually change the string length byte, not an extractor. And it's actually NOT incorrect pointers that gives me the black screens but, incorrect string length bytes.azerty1 said:WataruKun said:So basically make a list of what each control code does?DarthNemesis said:Looks like this game uses file formats similar to Kimi no Yusha - the text is embedded into the event scripting, so there are no pointers, just line lengths. This makes writing an inserter a lot more complicated, since you have to be able to determine which parts of the file to interpret as text and which parts to ignore. You can either do that by figuring out all the other control codes in the file, or by applying some sort of pattern to identify text.
For example, this is the format of the control code to display text:
03xxFFyy[nntt]nntt
xx = speaker ID
yy = speaker mode
nn = length
tt = text
If y is 0 it uses the speaker's assigned name from CharaName.dat.
If y is 1 then before the length and text block there is an additional block with the length and replacement text to use for the speaker's name.
A text control code is usually followed by control codes 06 and 05, which respectively tell the game to wait for you to press the button and to wait for the text to finish drawing before continuing with the scene.
If you can identify the format of all the other control codes, or if you can come up with some other way to reliably locate those text control codes programmatically without missing any or finding false positives, I could adapt YushaTrans to work with it. Knowing the format of the other control codes would allow you to add or remove text boxes as necessary, though. The first two bytes of each script file indicate the total number of control codes for that file.
wait, didn't he say that he was getting black screens when he didn't rewrite pointers?
oh, heh...i personally find embedded codes easier to deal with since you can just corrupt them and it also makes the programming a bit easier. of course, it all depends on the game.
programming-wise, just loop through the entire program and if ever you land on a byte you recognize, do whatever is needed. Like, if index i is 0x03 and index i+2 is 0xFF, then you know that index i+4 is going to be the length, so read everything from i+4 to i+4+whatever###you just got. a lot depends on luck, though. if 03**FF is used for anything else, you're going to have a lot of garbage in your output...so...the best thing to do is get to know those file formats. some games i've hacked, i've been able to write ane extractor after looking through the hex for about 3 minutes, others i've had to sit there for 3 hours, screwing with stuff until it was happy...
from darth's' description, it sounds relatively simple compared to other games i've seen, so maybe you might want to take this opportunity and try out coding your own extractor, to learn.
For instance if the string length byte is 2A and the length from the string length byte to the end of the screen is not 2A, then it will screw up the whole file.