Author Topic: Modifying EoSD's Script  (Read 14091 times)

Sora Misaki

Modifying EoSD's Script
« on: May 29, 2009, 04:59:04 AM »
So, I more or less have no idea what I'm doing.

I'm trying to modify the script of EoSD to a sort of gag dub, mostly as a proof of concept project and because I'm extremely bored. I managed to extract the msgX.dat files with Brightmoon, but they seem corrupted or something, full of bizarre characters. Did I do something wrong? What's the basic format of these files?

Drake

  • *
Re: Modifying EoSD's Script
« Reply #1 on: May 29, 2009, 05:21:47 AM »
You can't open up msg.dat or anything of the sort using Brightmoon. That thing only works for the entire compiled dat file.

If you really want to get into editing hexadecimal values and the like, talk to Alice Margatroid.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sora Misaki

Re: Modifying EoSD's Script
« Reply #2 on: May 29, 2009, 01:31:01 PM »
Yeah, I noticed. I'm also having some trouble recompiling the dat file. I'm using "datpacker-5" or something, I'm not entirely sure what the name of it is, and it doesn't seem to do anything but just print out the help screen, no matter what parameters I give it.

dustyjo

Re: Modifying EoSD's Script
« Reply #3 on: May 29, 2009, 05:47:30 PM »
Yeah I tried opening the MSG files with a hex editor and all I saw in the strings was a bunch of gibberish.

Sora Misaki

Re: Modifying EoSD's Script
« Reply #4 on: June 01, 2009, 09:51:20 PM »
Yeah I tried opening the MSG files with a hex editor and all I saw in the strings was a bunch of gibberish.

I opened up the English-patched MSG files, and it looks like that's where the data is, but I can't figure out how to repack my files into a .dat. I tried using the python-based program off of the Touhou wiki too, but I can't wrap my head around it at all.

Re: Modifying EoSD's Script
« Reply #5 on: June 01, 2009, 11:15:25 PM »
if you really want to get into editing hexadecimal values and the like, talk to Alice Margatroid.

You know, I wish I could draw well so you could see the AMAZING image this sentence put into my head.
Quote from Myosotis:
"Marriage is a game you can't win. Also, no replay value and the level design is bullshit.

dustyjo

Re: Modifying EoSD's Script
« Reply #6 on: June 02, 2009, 03:25:03 AM »
I opened up the English-patched MSG files, and it looks like that's where the data is, but I can't figure out how to repack my files into a .dat. I tried using the python-based program off of the Touhou wiki too, but I can't wrap my head around it at all.

Yeah I was using the English patched ones too. Maybe it's some kind of encoding or something?

Re: Modifying EoSD's Script
« Reply #7 on: June 03, 2009, 04:20:12 AM »
Hey guys,

I cleaned up and packaged the MSG compiler I made for the PoFV translation, with source code.

http://www.mediafire.com/?mwznml2tznz

I don't know if it will work with EoSD, but it's worth a shot.

Basically, you run it from the command prompt like so:
Code: [Select]
msg -d pl00.msg pl00.txt
Open up the resulting text file "pl00.txt" and skim down through to see if you find any text.  You'll want to ignore and leave alone the lines starting with "ptr"  Those lines retain information on the original index table and are used to rebuild the text file into a msg file.

Here's an example of a msg text line:
Code: [Select]
msg 008C 10  0000 So far, this incident has been happening everywhere I've been without exception.You'll want to edit just the text and leave the numbers alone.

After you've made all the alterations you want, you run the program again like:
Code: [Select]
msg -p pl00.txt pl00.msg

Also some cool things I found out when I was playing with the PoFV dialogue:

Code: [Select]
msg 00BB 11  0000 0100000005000000If you find a line with type "11", it determines who's speaking and what their expression is.

The first set of 8 hex bytes tells us who's speaking. (01 for enemy/opponent almost always, 00 for player)
The second set of 8 hex bytes tells us that person's expression.

This is the list of expressions I came up with for PoFV.  Like I said before, I don't know if PoFV's msg and EoSD's msg are compatible, but it's worth a look.  You might have to map out your own set of expressions.

Quote
FFFFFFFF/8? = defeated
7 = surprised
6 = unngh, dizzy
5 = eyes closed/calm, provoking
4 = sweatdrop
3 = angry
2 = happy
1 = mouth open
0 = normal


Let me know how it works.

Drake

  • *
Re: Modifying EoSD's Script
« Reply #8 on: June 03, 2009, 05:37:10 AM »
Oh jesus this sounds hilarious to work with if I ever get bored enough.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

dustyjo

Re: Modifying EoSD's Script
« Reply #9 on: June 03, 2009, 06:12:42 PM »
IT WORKS




With MoF at least, I can't find any MSG files in the EoSD .dats...
« Last Edit: June 03, 2009, 07:24:14 PM by dustyjo »

Quintafeira12

Re: Modifying EoSD's Script
« Reply #10 on: June 04, 2009, 10:00:07 PM »
That's not EoSD... -.-

But I guess you're forgiven for making a zombie joke!

I think Rufus might have just made a program that will ensure a whole lot of Touhou, the abridged series to spawn on youtube.

Drake

  • *
Re: Modifying EoSD's Script
« Reply #11 on: June 04, 2009, 10:52:07 PM »
I have an idea.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

dustyjo

Re: Modifying EoSD's Script
« Reply #12 on: June 04, 2009, 11:07:05 PM »
That's not EoSD... -.-

I know, I can't find the MSG files.

Drake

  • *
Re: Modifying EoSD's Script
« Reply #13 on: June 04, 2009, 11:41:39 PM »
I found them, but they're all in hex. The program works, but the text remains unchanged. Well, at least slapping it in replace_files doesn't do anything. Changing it will require getting into where the temp stuff is stored.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sora Misaki

Re: Modifying EoSD's Script
« Reply #14 on: June 09, 2009, 07:11:32 PM »
IT WORKS
[awesome]
With MoF at least, I can't find any MSG files in the EoSD .dats...

In EoSD, it's stored in msg[number].dat, not a .msg. How did you manage to repack the data into a .dat file? I can't figure that part out.

dustyjo

Re: Modifying EoSD's Script
« Reply #15 on: June 10, 2009, 02:30:55 AM »
In EoSD, it's stored in msg[number].dat, not a .msg. How did you manage to repack the data into a .dat file? I can't figure that part out.

I used the MoF/SA tools from Drake's thread.


Sora Misaki

Re: Modifying EoSD's Script
« Reply #16 on: June 10, 2009, 06:28:16 AM »
Okay, I'm finally starting to catch onto this stuff. I managed to repack the DAT using some advice from that thread, and now I'm up to here.

I found them, but they're all in hex. The program works, but the text remains unchanged. Well, at least slapping it in replace_files doesn't do anything. Changing it will require getting into where the temp stuff is stored.

What's odd is that when I slapped in a corrupted msg1.DAT file to see what would happen (read: left the wrong file in the folder before packing), the game gave me a blank box that it wouldn't let me scroll past, so changing that file has to have some effect.

How is the music stored in EoSD? I can only find MIDIs and POSes. Is the latter a compressed form of WAV? And, for that matter, how do I get at these mythical temp files I must change?

dustyjo

Re: Modifying EoSD's Script
« Reply #17 on: June 10, 2009, 10:20:20 AM »
My EoSD has the music in a separate folder called "BGM".

Sora Misaki

Re: Modifying EoSD's Script
« Reply #18 on: June 10, 2009, 08:44:54 PM »
My EoSD has the music in a separate folder called "BGM".

Oh, lolz, I thought that was just a sound rip that came included with my copy or something. Yeah, just replacing files works for the music at least. If only the script were that simple.

Drake

  • *
Re: Modifying EoSD's Script
« Reply #19 on: June 10, 2009, 10:09:10 PM »
You can replace files by putting them in a folder called replace_files. This folder is temporary and is what the English patch uses to keep it's files in. When you run the patch, it checks the temp folder, and then it checks for any others. It finds the new folder and replaces all the files in there.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sora Misaki

Re: Modifying EoSD's Script
« Reply #20 on: June 10, 2009, 11:15:54 PM »
You can replace files by putting them in a folder called replace_files. This folder is temporary and is what the English patch uses to keep it's files in. When you run the patch, it checks the temp folder, and then it checks for any others. It finds the new folder and replaces all the files in there.

Ah, but that would be too easy!

I've been manually depacking and repacking the DATs with my changed msg1.dat, and that doesn't replace the messages like you'd expect it to. I presume there's some sort of temp folder that the game uses that I can't/don't know how to edit?

UPDATE: Managed to change the track names as well. They're in the stageX.std files near the beginning. Now, if I could just get this to work right with EoSD, I'd be able to change the music looping.
« Last Edit: June 12, 2009, 10:01:33 PM by Sora Misaki »

Sora Misaki

Re: Modifying EoSD's Script
« Reply #21 on: June 26, 2009, 01:34:58 PM »
Bump with victory!

I have no idea how this actually worked. I changed the msg1.dat, repacked it, and booted up the game, but the changes were only visible on a different computer from the one I'd done the modifications on. Weird.