my adm <-> dat converter

Forum for discussing the Torchlight mod toolset.

my adm <-> dat converter

Postby dengus » Fri Oct 30, 2009 11:54 am

Since editing the adm files in notepad was turning out to be rather inconvenient, I made a converter that converts either way between the two formats.

It's command-line, and usage is simple: just pass it the filename of the file to convert as the only argument. It will add or remove .adm from the input filename to produce the output filename, depending on if you passed it a dat or adm file.

I tested with converting and replacing a few of the files in Pak.zip, and it seems to work just fine, thought I don't guarantee anything.

I included the source code in case anyone is interested.

edit: I updated it to fix a couple minor issues and made it use CRLF instead of just LF for newlines, so that notepad can read it correctly.

http://rapidshare.com/files/300890118/tldat-2.zip
Last edited by dengus on Sun Nov 01, 2009 4:34 am, edited 1 time in total.
dengus
 
Posts: 22
Joined: Fri Oct 30, 2009 11:10 am

Re: my adm <-> dat converter

Postby Rick » Fri Oct 30, 2009 11:56 am

Hah, good timing. I just finished writing my own. Guess I'll hold off on posting it then. :)
Rick
 
Posts: 5
Joined: Fri Oct 30, 2009 11:53 am

Re: my adm <-> dat converter

Postby SilverD » Fri Oct 30, 2009 11:56 am

You guys are awesome, thanks so much!
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege, reserved only for those who try.
SilverD
 
Posts: 156
Joined: Sat Oct 03, 2009 12:22 am
Location: Network packet

Re: my adm <-> dat converter

Postby Rick » Fri Oct 30, 2009 11:57 am

Oh another thing to clarify, not all ADMs are DATs. There are quite a few .ANIMATION.ADM, the format is the same, just a different extension.
Rick
 
Posts: 5
Joined: Fri Oct 30, 2009 11:53 am

Re: my adm <-> dat converter

Postby PuceMoose » Fri Oct 30, 2009 3:42 pm

Thanks for doing this! I'm eager to begin poking around in some files since the editor release date has not been nailed down for sure yet.
User avatar
PuceMoose
 
Posts: 82
Joined: Thu Oct 22, 2009 2:44 pm
Location: Tennessee

Re: my adm <-> dat converter

Postby Csimbi » Fri Oct 30, 2009 4:50 pm

Nice, thanks, but it does not compact the files properly (decode one, encode it and compare with the original).
Csimbi
 
Posts: 26
Joined: Thu Oct 29, 2009 9:43 am

Re: my adm <-> dat converter

Postby throumbas » Fri Oct 30, 2009 6:22 pm

You dont need to convert the files in adm for the game to use them.

Anyway this is pretty nice, one annoyance tho is that the text is continuous with no breaks, which makes it really tough to read in editors.

edit: nevermind this only happens in notepad for some reason
throumbas
 
Posts: 49
Joined: Wed Oct 28, 2009 10:20 am

Re: my adm <-> dat converter

Postby Rick » Fri Oct 30, 2009 8:32 pm

throumbas wrote:You dont need to convert the files in adm for the game to use them.

Anyway this is pretty nice, one annoyance tho is that the text is continuous with no breaks, which makes it really tough to read in editors.

edit: nevermind this only happens in notepad for some reason
Notepad doesn't support unix line endings is why, you can hack his code to do \r\n instead of just \n to fix that.
Rick
 
Posts: 5
Joined: Fri Oct 30, 2009 11:53 am

Re: my adm <-> dat converter

Postby Vis » Sat Oct 31, 2009 8:27 am

Can you post a sample command line using this so I know the format?
Vis
 
Posts: 149
Joined: Sat Oct 24, 2009 9:11 am

Re: my adm <-> dat converter

Postby dengus » Sat Oct 31, 2009 4:38 pm

Vis wrote:Can you post a sample command line using this so I know the format?


Actually, it's easiest if you just extract the tldat.exe somewhere and choose "Open with" on the .adm file then browse to the extracted tldat.exe. That way, you can just unzip Pak.zip and double click the .adm files to convert them to .dat.

But a sample command-line anyhow is tldat.exe SPIDER.DAT.adm
dengus
 
Posts: 22
Joined: Fri Oct 30, 2009 11:10 am

Re: my adm <-> dat converter

Postby hillin » Sun Nov 01, 2009 1:50 am

hi dengus, thanks for this tool. it works great when I'm trying to convert an adm file into a dat file, however, when I finished modifying the dat file and attempt to convert it back, there is an encoding problem occuring. the dat file is ucs-2 encoded, which supports CJK(Chinese, Japanese and Korean) characters, but when I place the adm file which I have just converted back into a mod pack, all CJK chars are showing incorrect in the game, the 2-byte CJK chars are shown as 2 splitted latin chars (e.g. a char, 0x7684 in unicode, is shown as 2 chars in code 0x76 and 0x84). I am wondering if this is caused by the convert tool or it is the game it self reads the adm file in that way. I looked into the source of your tool and got no idea.
thanks a gain.
hillin
 
Posts: 12
Joined: Fri Oct 30, 2009 12:23 am

Re: my adm <-> dat converter

Postby Csimbi » Sun Nov 01, 2009 2:00 am

I do not think it's the tool.
It appears that there is no real unicode support in the game.
Have a look at these older threads here:
viewtopic.php?f=6&t=2811
and here:
viewtopic.php?f=6&t=2718
Csimbi
 
Posts: 26
Joined: Thu Oct 29, 2009 9:43 am

Re: my adm <-> dat converter

Postby hillin » Sun Nov 01, 2009 2:05 am

Csimbi wrote:I do not think it's the tool.
It appears that there is no real unicode support in the game.
Have a look at these older threads here:
viewtopic.php?f=6&t=2811
and here:
viewtopic.php?f=6&t=2718


Yeah I have read those posts. I believed the game supports unicode because it could handle most unicode chars in the .layout files correctly (except for the color formatted ones, I think it's because the regular expression don't support unicode). Maybe they just don't read the .dat.adm files in a proper way.
hillin
 
Posts: 12
Joined: Fri Oct 30, 2009 12:23 am

Re: my adm <-> dat converter

Postby dengus » Sun Nov 01, 2009 4:42 am

I tested with a few Unicode characters, and confirmed that my tool correctly stores them in the .adm file (it pretty much does a byte-for-byte copy). But there's really no need to use my tool to convert them back into .adm files, it's better to put .dat files in the mods directory rather than modifying Pak.zip, and then the game will make the .adm files itself.

I believe they're fixing some Unicode support in the next patch?
dengus
 
Posts: 22
Joined: Fri Oct 30, 2009 11:10 am

Re: my adm <-> dat converter

Postby Daviex » Sun Nov 01, 2009 8:10 am

Hi, i use that program and all ok.

You can't modified that convert all file on one folder? thanks
Daviex
 
Posts: 4
Joined: Sun Nov 01, 2009 4:04 am

Re: my adm <-> dat converter

Postby mysteriono » Sun Nov 01, 2009 8:54 pm

it just flashes for a sec and closes when i try to use it, any help?
mysteriono
 
Posts: 6
Joined: Sun Nov 01, 2009 8:49 pm

Re: my adm <-> dat converter

Postby dengus » Mon Nov 02, 2009 4:57 am

Daviex wrote:Hi, i use that program and all ok.

You can't modified that convert all file on one folder? thanks


Try this - viewtopic.php?f=20&t=2985
dengus
 
Posts: 22
Joined: Fri Oct 30, 2009 11:10 am

Re: my adm <-> dat converter

Postby hillin » Mon Nov 02, 2009 6:33 am

dengus wrote:I tested with a few Unicode characters, and confirmed that my tool correctly stores them in the .adm file (it pretty much does a byte-for-byte copy). But there's really no need to use my tool to convert them back into .adm files, it's better to put .dat files in the mods directory rather than modifying Pak.zip, and then the game will make the .adm files itself.

I believe they're fixing some Unicode support in the next patch?


I didn't know the game could make the .adm files automatically. Hope the unicode problem will be fixed soon. Thanks a lot.
hillin
 
Posts: 12
Joined: Fri Oct 30, 2009 12:23 am

Re: my adm <-> dat converter

Postby Olympic » Mon Nov 02, 2009 7:28 am

Nice work man! :)
User avatar
Olympic
 
Posts: 9
Joined: Tue Oct 27, 2009 5:26 am

Re: my adm <-> dat converter

Postby theduke » Mon Nov 02, 2009 9:06 am

mysteriono wrote:it just flashes for a sec and closes when i try to use it, any help?


having the same issue, windows 7 ultimate
theduke
 
Posts: 113
Joined: Sun Jun 14, 2009 7:01 pm

Next

Return to Torchlight Mod Discussion

Who is online

Users browsing this forum: No registered users and 3 guests