The Dink Network

dat-file disentangler

December 14th 2010, 07:18 AM
anon.gif
shevek
Ghost They/Them
 
Hi,

I'm new here; I tried to create an account, but didn't get a confirmation mail so far.

Anyway, I'm using Debian GNU/Linux and freedink, which also includes dinkedit. Looking at the videos, this is a lot less impressive than the editor in Windows.

I'm mostly using the editor to cheat. If I get stuck somewhere, and need to reach a certain place, I want to look up from where I can get there. This can often be done by reading the scripts in the story directory, but sometimes I need to know where a certain object is located. For that, I want to be able to search such a thing.

The sort of search I want is "in which room is the object which links to the script with this name?"

For this reason, I wrote a script in Python which reads map.dat, dink.dat and hard.dat, and outputs a plethora of text files (and images, for hard.dat). Then I can simply search those files with normal tools ("grep" in particular).

I'm not (yet) into dmod-making, but if I am going to do that, I will want to reverse the script as well: after modifying the text files, it should be able to create the .dat-files from them. This is very useful for generating maps, I think. This part of the script is not implemented so far. However, if people want that I might do it sooner. If you know some python, nothing's stopping you to do it sooner, of course.

Here's a link:
http://a83-163-111-92.adsl.xs4all.nl/dink-split
You need to have Python installed to run it. Run it from the dmod-directory and it will create a directory named "split-out", in which all the created files are. This directory must not already exist; if it does it fails.

Please let me know what you think about this.

Thanks,
shevek
December 14th 2010, 07:33 AM
dinkdead.gif
Sounds good, don't have Python so can't check it at the moment but there is already a file that can do what I think you want

You can enter a script name into Sprite Replacer and will tell you the exact location of any sprite with that script attached, plus it does lots of other useful stuff.
December 14th 2010, 08:08 AM
anon.gif
shevek
Ghost They/Them
 
That looks like a tool with a similar goal indeed. I think for Windows-users, windinkedit plus SpriteReplacer may be more useful than this script.

Personally, I prefer to do most things with text files. This is normal (and therefore comfortable) for (older-time) *nix users like me. For this reason, there are many text-tools (automatic search, replace and edit with complex patterns and rules) available on the system. Without those tools, or without the skill to use them, I think my script isn't very useful. Anyway, I may be wrong about that and people may do things I didn't think of.
December 14th 2010, 08:25 AM
anon.gif
shevek
Ghost They/Them
 
For those who don't have Python installed, I've put the output of the script for "Cast awakening part one" at
http://a83-163-111-92.adsl.xs4all.nl/split-out/.
I intentionally didn't pack it up as a zip-file, because it's 28 MB and with my upload capacity that would hurt my network performance too much. If you want it all locally, download the dmod and run dink-split yourself.
December 14th 2010, 09:17 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Welcome aboard!

Cheating, huh? Well, it's good for learning how to make D-Mods. It's bad in case you want to have some fun playing.

Also, words of warning; we're a bit crazy here, so prepare yourself.
December 14th 2010, 09:39 AM
anon.gif
shevek
Ghost They/Them
 
IMO cheating is fine, but not all the time. Especially for english language jokes (like "what kind of bees make milk?") I, not being a native speaker, have no problem at all to get the answer without thinking of it myself. I want to try for some time, but I don't want to get stuck and be annoyed with it.

Of course this method of cheating (reading scripts and understanding what sort of data is in the game files) is also a very good preparation for dmod-making, which is a bonus.
December 16th 2010, 05:38 AM
fairy.gif
Someone
Peasant He/Him Australia
 
Cool tool, but seems like a slow way to do things. BTW the Windows version of the editor you are referring to is probably WinDinkEdit, which is actually a third party editor (the editor that comes with Dink is equivalent to the one that comes with FreeDink for Linux).
December 17th 2010, 07:31 PM
anon.gif
shevek
Ghost They/Them
 
Generating the hardness images is a bit slow, but it only takes a few seconds in total.

If you mean creating a dmod using text files would be slow, I fully agree. I wasn't planning to do that. It could be useful for certain generated actions, but most of the placement (of tiles and sprites) is still much easier with a normal room editor.

The idea is that you can use the editor normally, but look at the real code behind it when that is useful. Like the "view nonprinting characters" option in a word processor, or "view source" for a web page.
December 20th 2010, 05:52 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
This is great! Thanks for sharing it. I have given it a try with a few mods and I am very interested in it.

In case you don't know, the author of FreeDink is also in the process of porting WinDinkEdit using Python.
December 22nd 2010, 06:35 PM
anon.gif
shevek
Ghost They/Them
 
Just a minor note: the hardness parsing might be wrong, or at least not compatible with some dmods. When using the script on cloud castle 1, I needed to disable it to make it work (it said "invalid hardness" and aborted). I've just "fixed" this by not aborting, which should work as well (there was only one pixel with this invalid hardness value). So if you have this problem, just redownload the script and try again. It will still complain, but not abort.

The port sounds like a good idea. What I've seen of dinkedit doesn't really make it good enough to do serious work.