Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Metal Wolf Chaos *.msg files

Need help translating games in other languages? Have your language problems solved here.
Post Reply
SonofUgly
beginner
Posts: 21
Joined: Sat Feb 25, 2012 2:43 pm
Has thanked: 6 times
Been thanked: 2 times

Metal Wolf Chaos *.msg files

Post by SonofUgly »

Wondering if anyone could make a tool for these, convert them to and from a basic text form like:

Code: Select all

000013EF - Result
000013F1 - Clear Time
...
They seem pretty simple, and a lot like Rockstar's gxt/gxt2 language files.
A couple of sample files: http://www.mediafire.com/file/2r6h9s1b3 ... amples.rar

Here's the basic idea, from what I can tell: http://i.imgur.com/3n8YkoA.png
The part there that I'm not sure about I think might be junk data - nothing like that in the bigger files, and seems inconsistent.
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: Metal Wolf Chaos *.msg files

Post by WRS »

edit - here is a better one to parse all files 8)

Code: Select all

struct head
{
  uint strings;
  uint un_1; // 0
  uint un_2; // 0
  uint un_3; // 0
};

struct data
{
  int id;
  uint offset;
};

head hdr;

local int num;
local int i;
local string str;

num = (ReadUInt(FTell()+4)-16) / sizeof(data);

data body[num];

for(i=0;i<num;++i)
{
  if(body[i].id > 0 && body[i].offset != 0)
  {
    str = ReadString(body[i].offset);
    Printf("%08X - %s¥n", body[i].id, StringToWString(str, CHARSET_JAPANESE));
  }
}
gives
00072BF0 - 赤き箱を探し出し
00072BF1 - 全て打ち砕くべし
00072C04 - よくぞ成し遂げた
with m037.msg
Useful tool links:
SonofUgly
beginner
Posts: 21
Joined: Sat Feb 25, 2012 2:43 pm
Has thanked: 6 times
Been thanked: 2 times

Re: Metal Wolf Chaos *.msg files

Post by SonofUgly »

Awesome, thanks.
Anyway to run it in reverse?

Also turns out 1 (just 1... of course) file is slightly different, and the output is missing strings. File: http://www.mediafire.com/file/kf2zcxoatfq7nns/menu.msg and output: http://pastebin.com/AkXA9PLx.
Didn't go through it thoroughly, but I can see that at least "000702EF - GAME 2" is missing. And I was wrong about the first 8 bytes being byteswapped.
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: Metal Wolf Chaos *.msg files

Post by WRS »

SonofUgly wrote:Also turns out 1 (just 1... of course) file is slightly different, and the output is missing strings.

Didn't go through it thoroughly, but I can see that at least "000702EF - GAME 2" is missing
yeah this file is a problem. there are no flags to control how large the 'data info' structure should be.

here is an update - uncomment the #define on line 1 to for menu.msg

Code: Select all

//#define MENU_MSG

struct head
{
  uint strings;
  uint un_1; // 0
  uint un_2; // 0
  uint un_3; // 0
};

struct data
{
  int id;
  uint offset;

#ifdef MENU_MSG
  uint unknown;
#endif
};

struct str
{
  string c;
};

head hdr;

local int num;
local int i;

num = (ReadUInt(FTell()+4)-16) / sizeof(data);

data body[num];

for(i=0;i<num;++i)
{
  if(body[i].offset != 0)
  {
    FSeek(body[i].offset);
    str cstr <bgcolor=0xffccee>;

    if(WStrlen(cstr.c)>0 || body[i].id > 0)
    {   
      Printf("%08X - %s\n", body[i].id, StringToWString(cstr.c, CHARSET_JAPANESE));
    }
  }
}
Useful tool links:
Post Reply