VaultNetwork.netVault Network Boards
Author Topic: dat file writing [Locked]
kgober  1 star
Posts: 77
Registered:
so, I finally got around to finishing the code to support dat file writing.


1. go to http://acdev.cvs.sourceforge.net/acdev/DatUtils/WriteDat/bin/ and download WriteDat.exe

2. go to http://acdev.cvs.sourceforge.net/acdev/DatUtils/ReadDat/bin/ and download ReadDat.exe

3. go to http://acdev.cvs.sourceforge.net/acdev/AC.Utility/bin/ and download AC.Utility.dll

4. go to http://acdev.cvs.sourceforge.net/acdev/AC.DatFile/bin/ and download AC.DatFile.dll

5. put all four of those files in the same directory (it's ok for you to put them in your AC folder, or you can put them elsewhere, but I don't recommend that you put them on a network share unless you know how to set up .NET security policies / trusts / zones)

5. MAKE A BACKUP COPY OF THE DAT FILE YOU PLAN TO WORK ON! (e.g. client_portal.dat)

6. use ReadDat.exe to extract a file from the datfile (e.g. ReadDat -f client_portal.dat 0e00000e)

7. edit the file using your editor of choice

8. IF YOU DIDN'T MAKE A BACKUP COPY OF THE DAT FILE YOU PLAN TO WORK ON, DO IT NOW!

9. use WriteDat.exe to write the changed file back to the datfile (e.g. WriteDat client_portal.dat -f 0e00000e=newfile.bin)


yes, this procedure is cumbersome. no, I do not plan to do anything about it anytime soon.


-ken


p.s. these utilities require the .NET Framework v1.1. not v2.0, which is what Decal currently requires. but that's ok, you can put both 1.1 and 2.0 on the same computer (I have both on mine). if you don't have the 1.1 framework for whatever reason, get it and install it.
Sucamarto  2 stars
Posts: 297
Registered: 2001-5-15 21:56:53
Skins here we come

 

-----signature-----
Sucamarto's AC Heaven - http://acheaven.buwahaha.com
Sucamarto - (275) Bunny Master
Panumbriis Shadow - (275) - Sword,Cook,Alch,Tinker
Allegiance - Tasia the True
"May the seed of your loin be fruitfull in the belly of your woman" Neil
Lord_Anton  2 stars
Title: Wu Fez 4 Life!
Posts: 340
Registered: 2004-8-27 23:55:24
awesome.

 

-----signature-----
They can't deport us all
http://www.btnhboard.com/
Where's Waldorian?
kgober  1 star
Posts: 77
Registered:
take note, i have no idea what bmpswap used to do (specifically i don't know how it handled the fileid that's prepended onto the beginning of every file in portal.dat) but readdat and writedat do not make any special effort to add or remove this fileid. so if you have old tools that expect it to be gone, or automatically added it when writing a file, don't be surprised when readdat/writedat don't do dat.


oh, one more thing: when replacing a file, the new file does not have to be the same size as the old one. by size I mean the file size measured in bytes. also, you can write new files that didn't previously exist -- you are not limited to only using pre-existing file ids. but be warned: there is currently no way to *delete* new files once you've written them. the only way to get rid of them is to go back to using a backup copy of a datfile from before you added these new files.


-ken
sui101  1 star
Posts: 68
Registered:
In theory would this work for extracting the 10-12mb world map of Dereth? I'm currently using a converter that changes the new client_cell_1.dat file to the old school (pre-tod) Cell.dat file structure system so I can extract the map with older (pre-tod) programs. I would love it
Drakier  4 stars
Posts: 1,486
Registered:
in theory, if you knew how the reading of the dat worked for creating the map, then yes... you should be able to use these dat tools to read ANY file from ANY dat (ac tod format)... converting it to the proper data though might be a different thing however..


for example.. spelltable data is encoded AND stored in the dat file.. so it's not as simple as just extracting the data to get a working spelltable.. you have to alter the data AFTERWARD.. I believe the BMPs in the dat file are the same.. you have to go beyond just extracting the binary data, and convert it to the proper format for the BMP (or WAV for sound).
kgober  1 star
Posts: 77
Registered:
if the world map were contained in a single file within cell.dat, then yes, this tool would work.


however, the world map is (as far as i know) constructed by reading many smaller files, and putting all the data together. this tool will take care of the reading of those smaller files, but it doesn't know how to put all the individual landblock files together to make a single complete map.


so, you still need those older (pre-tod) programs in order to do the second part. and, because those older programs only work with the old cell.dat file structure, you still have to use CellConverter.exe. if you want to use CellConverter.exe with the newer AC.Utility.dll and AC.DatFile.dll, i've recompiled a new version of that as well, which you can also find on SourceForge (just browse to it, CellConverter is found in the same place as ReadDat and WriteDat).


-ken
sui101  1 star
Posts: 68
Registered:
Well I was hoping for an easier answer, but aren't we all hoping for those, LoL!!


Thanks for the sweet stuff though anyhow Kgober, as was said, this'll definately open some doors for people
Harbinger67
Posts: 5
Registered:
Heh, I can't get it to do anything. Mostly because I'm an idiot though.


So, I click the readdat thing and it brings up a dos window thing, then it goes away. Awesome. What am I not doing right?
kgober  1 star
Posts: 77
Registered:
all of the "DatUtils" are command-line tools. first open a Command Prompt window, then cd to the directory containing ReadDat or WriteDat, then run the commands from there.


-ken

VaultNetwork.net is an independently operated community forum and is not affiliated with, endorsed by, or technically based on IGN, GameSpy, FilePlanet, GameStats, or the former IGN/GameSpy Vault Network.
References to VaultNetwork.net mean this site/domain. VNBoards-style presentation is a visual homage only. By using this site, you agree to the forum rules.