XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Tue Oct 17, 2017 6:33 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Metal Wolf Chaos *.msg files
PostPosted: Thu Sep 29, 2016 5:31 am 
Offline
beginner

Joined: Sat Feb 25, 2012 2:43 pm
Posts: 20
Has thanked: 6 times
Have thanks: 1 time

Wondering if anyone could make a tool for these, convert them to and from a basic text form like:
Code:
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/2r6h9s1b3d2hfr6/MWC_msg_samples.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.

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: Metal Wolf Chaos *.msg files
PostPosted: Fri Oct 28, 2016 12:33 am 
Offline
ultra-veteran
ultra-veteran

Joined: Fri Nov 06, 2009 12:13 am
Posts: 588
Has thanked: 66 times
Have thanks: 126 times
edit - here is a better one to parse all files 8)

Code:
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

Quote:
00072BF0 - 赤き箱を探し出し
00072BF1 - 全て打ち砕くべし
00072C04 - よくぞ成し遂げた


with m037.msg

_________________
Useful tool links:


Top
 Profile  
 
 Post subject: Re: Metal Wolf Chaos *.msg files
PostPosted: Fri Oct 28, 2016 9:53 am 
Offline
beginner

Joined: Sat Feb 25, 2012 2:43 pm
Posts: 20
Has thanked: 6 times
Have thanks: 1 time
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.


Top
 Profile  
 
 Post subject: Re: Metal Wolf Chaos *.msg files
PostPosted: Fri Oct 28, 2016 11:08 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Fri Nov 06, 2009 12:13 am
Posts: 588
Has thanked: 66 times
Have thanks: 126 times
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:
//#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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group