Exporting Artifical Girl 2 meshes

Someone asked how to import maps from AG2 to yuusha, so I decided to actually look into AG2. Previously I had already downloaded all of the tools I needed, so it was a matter of grabbing the game disc and getting the data files. It seems a little trickier than I had thought.

AG2 is pretty old, so it's not supported by SB3U. This means you won't be able to open the PP files using that. Fortunately, there is a tool called "IGFTool" which was developed awhile before SB3U came around which does recognize AG2 pp's.

So the first thing you have to do is get a copy of IGFTool. It's in (traditional) chinese, but regardless of language barriers all you have to do is click on the button on the left and select the PP file you want to open.

Then click the 3rd button from the left to select all files. Right-click on one of the files and choose the first option (that is to export). It will then ask you whether you want to export the files in the same directory as IGFTool. I would just hit yes for this prompt and the one after.

You will then see a new folder with the same name as the PP file. Inside, you'll see all of the files the tool just exported.

The .x files are the meshes you are interested in. They are stored inOBJM format, so you will need to use another tool to export them to MQO. This tool is called JS2Mesh. I would just get the latest one, which is 4.1 I believe.

Anyways so you open JS2Mesh and select your .x file, and if successful you should get a list of files in the window. Select all and export, and all of the meshes will now be in mqo format.

If that wasn't tricky, here is an even trickier part

If you open the mqo, you'll find that the faces don't show up. Even when all your materials are set up properly, the faces refuse to show up.

Open the mqo file in a text editor (ie: notepad++) and scroll all the way down until you see these kinds of lines:



There's an issue here: I don't think mqo files have that COL argument. Maybe it did in back in 2.3? Definitely don't see it in 2.4
To test my theory, I went and deleted them and then re-opened the file in metaseq. And guess what, the textures appeared properly.

So now the problem is, how are you supposed to fix all of these files? Well for starters, if you're using notepad++ or any other advanced text editor that supports regular expressions and find/replace all functions, then you could simply use this pattern

Find: COL.*)
Replace with:

(yes, that is empty)

Which will delete all lines that look like COL( .......... ), which would fix your problem.
But then you have to do this for hundreds of mqo's? Doesn't sound fun.

I am also lazy, so I will be writing a python script to remove all of these COL's for you. You would just have to drag your files over it and they should all be fixed. Unfortunately, I haven't gotten around to writing it yet, so if you're reading this right now and you don't see a download link, that is why.

Anyways that's how you export the meshes for AG2. Making a map out of it comes next...which is beyond tedious and you may not even want to do it. In fact, neither do I, but I will try to write some scripts that will hopefully make it easier in general.

EDIT: well, here it is: Download here

You will need python with the re (regular expression) module.

2 comments:

  1. Thank you SO much for all your help, and releasing a ready made .pp with all the AG2 maps. You have no idea how much I've wanted to use those maps, and you brushed it off like it was cake. You, sir, have my compliments of the day.

    Thank you :)

    ReplyDelete
  2. The maps will have to be brushed up though since I didn't do any finishing touches. Like re-positioning them so they start up at a "good" view (ie: not in a rock)

    ReplyDelete