ROM Hack Could someone write me a text editor...

WataruKun

Rom translator.
OP
Banned
Joined
Sep 12, 2009
Messages
616
Trophies
0
Website
Visit site
XP
130
Country
United States
Okay here's the thing, I KNOW the pointers in Doki Doki Majo Shinpan 2 and am well aware of how to repoint them. Up until now, I've been manually repointing text. But the problem with repointing text in this game is that, if ONE POINTER yes, ONE POINTER in the huge script file is wrong, the whole script won't load and you'll just get a black screen in the game. This makes manually repointing text a freaking headache. The last straw was when I could've sworn most of the pointers were correct, even COUNTED them several times and I still got a black screen in the game
dry.gif
.


So yes, could someone make a text editor for me? That would help me out a lot. One big thing this text editor has to be able to do, is to be able to automatically repoint text. By the way, I'm not some newbie who just started hacking the game, no. I've been working on translating and hacking this game for weeks and shall continue to do so. I can tell you anything you need to know about the game's text structure. I can tell you the pointers, the line skips, the line ends; anything you'd need to know to make a text editor.

I would make a text editor myself, but my knowledge of programming is nowhere near good enough to make a text editor.

So basically, I'm asking, can someone make me a text editor for this game that automatically repoints text? If you need to see an example text file, I can send you one.

But yeah, if someone could make a program like this for me, that would help this translation project TREMENDOUSLY.

Here are some screens of the translation, just to show you that I've actually been working on it...

dokidoki1.jpg


dokidoki2.jpg


dokidoki3.jpg


dokidoki4.jpg
 

azerty1

Well-Known Member
Member
Joined
Mar 22, 2009
Messages
160
Trophies
0
Age
28
Website
Visit site
XP
89
Country
Canada
WataruKun said:
Sigh... then I guess no one's up for it then. That doesn't mean good for this translation. All that hard work gone to waste.
dude...it's been 3 hours since you started the topic...
how would you describe your level of programming right now? I might be able to help you in that respect a bit...
i would like to write it for you, but my computer kinda exploded and it is absolute hell to type, much less code on an acer notebook that's smaller than my head...
and you don't really need a full text editor, I don't think. That would be a lot of effort making a pretty GUI when you can just extract text to .txt files, edit stuff in MS word or notepad and then rewrite the pointers when you reinsert them. It's actually the same thing, really.
 

Poryhack

Well-Known Member
Member
Joined
Oct 18, 2009
Messages
332
Trophies
0
Age
31
XP
242
Country
United States
I've been in your position but jeez... I've never had the gall to ask that a random stranger write a program for me. It just doesn't work that way. And then coming back three hours after the fact and pretending like it's a done thread? Do you honestly believe this place is overflowing with bored programmers that roam the forums at all hours of the night?

Nobody's gonna do anything unless they have an interest in this, and even then asking with the right attitude is a must.
 

WataruKun

Rom translator.
OP
Banned
Joined
Sep 12, 2009
Messages
616
Trophies
0
Website
Visit site
XP
130
Country
United States
Poryhack said:
I've been in your position but jeez... I've never had the gall to ask that a random stranger write a program for me. It just doesn't work that way. And then coming back three hours after the fact and pretending like it's a done thread? Do you honestly believe this place is overflowing with bored programmers that roam the forums at all hours of the night?

Nobody's gonna do anything unless they have an interest in this, and even then asking with the right attitude is a must.
Yeah lol I might just put this project on hold for a long while, that is, until I learn how to program a text editor as I have to do all the work for this project. It sucks, but that's the way it has to be, so for now the projects on hold. I'm certainly not going through the headache of repointing every line in a game where one line that's pointed wrong screws up the script.

Maybe I'll find a game that isn't so script heavy to translate. The problem isn't that I don't know pointers or I don't know how to repoint, the problem is, is that with such a large script it is a headache to do manually and there's no one out there willing to make an editor for it.

Who knows? I might just quit this rom hacking thing and put my translating skills to better use. Maybe make a guide for it.

This is one of those impossible to do by yourself things.
 

metroid4life14

Well-Known Member
Member
Joined
Sep 13, 2009
Messages
308
Trophies
0
XP
63
Country
United States
No need to be an ass, poryhack. WataruKun has been putting a lot of work into this, and giving him shit for trying to help the community is NOT what we need.

I personally don't know any programming, but I'm sure you'll find someone to help you. Don't lose hope just yet!
 

Poryhack

Well-Known Member
Member
Joined
Oct 18, 2009
Messages
332
Trophies
0
Age
31
XP
242
Country
United States
All I'm saying is that his request was not very reasonable, and, judging by how he responded he doesn't disagree with me. So I fail to see how I was an ass...

If you're gonna kiss butt, at least do it right.
rolleyes.gif
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
219
Country
United States
Poryhack said:
All I'm saying is that his request was not very reasonable, and, judging by how he responded he doesn't disagree with me. So I fail to see how I was an ass...

If you're gonna kiss butt, at least do it right.
rolleyes.gif
How is it not reasonable?
From what I understand of coding, it's not a very complex app to write.

He's not asking for a full editor like NotePad++ or something like that, just a simple app that will allow him a WYSIWYG editor that can update pointers as well.
Both are fairly easy to code on their own, and shouldn't be too hard to combine the two.
 

metroid4life14

Well-Known Member
Member
Joined
Sep 13, 2009
Messages
308
Trophies
0
XP
63
Country
United States
All I'm saying is that WataruKun doesn't exactly get paid for what he does. He's taking his personal time to help out the community. The least he deserves is a bit of respect. If you call that "kissing ass," then so be it.
 

Poryhack

Well-Known Member
Member
Joined
Oct 18, 2009
Messages
332
Trophies
0
Age
31
XP
242
Country
United States
This is not disrespect:
Poryhack said:
I've been in your position but jeez... I've never had the gall to ask that a random stranger write a program for me. It just doesn't work that way. And then coming back three hours after the fact and pretending like it's a done thread? Do you honestly believe this place is overflowing with bored programmers that roam the forums at all hours of the night?

Nobody's gonna do anything unless they have an interest in this, and even then asking with the right attitude is a must.
K?
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
219
Country
United States
Skullcollector said:
Notepad++ is all I'm saying.
1). Not a game text editor, it's a plain text editor.
Many games need to have the data extracted and converted to plain text.

2). Wouldn't help with his problem: Pointers.
 

WataruKun

Rom translator.
OP
Banned
Joined
Sep 12, 2009
Messages
616
Trophies
0
Website
Visit site
XP
130
Country
United States
A simple text editor with that automatically repoints the text is all I'm trying to get. The pointers are only 1-byte. Unfortunately I don't have enough knowledge of programming to make something like that.

However, some real NICE person offered to make a text editor, so we'll see where that goes.

Point is, I've seen people due similar programs for much more complex games in a flash.

Seriously, if I knew how to program it probably wouldn't be that hard to make.
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
219
Country
United States
WataruKun said:
Seriously, if I knew how to program it probably wouldn't be that hard to make.
To be honest, I think coding the app to read the files will be the hardest part (and that's simple).
The WYSIWYG editor I believe is 'built in' to the coding, so you don't need any libraries for it (it's just read from file, display output, allow editing, allow writing to file), and the pointer would be the same, but with calculations for the new value I believe.
 

DarthNemesis

Well-Known Member
Member
Joined
Feb 19, 2008
Messages
1,210
Trophies
0
XP
260
Country
United States
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.
 

WataruKun

Rom translator.
OP
Banned
Joined
Sep 12, 2009
Messages
616
Trophies
0
Website
Visit site
XP
130
Country
United States
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.
So basically make a list of what each control code does?
 

DarthNemesis

Well-Known Member
Member
Joined
Feb 19, 2008
Messages
1,210
Trophies
0
XP
260
Country
United States
WataruKun said:
So basically make a list of what each control code does?
At a minimum, enough information to determine the number of bytes it takes up. Most are always the same length, but for the ones like 03 you need to know more about the format to figure that out.
 

azerty1

Well-Known Member
Member
Joined
Mar 22, 2009
Messages
160
Trophies
0
Age
28
Website
Visit site
XP
89
Country
Canada
WataruKun said:
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.
So basically make a list of what each control code does?

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.
 
General chit-chat
Help Users
    K3N1 @ K3N1: Here we go