• Welcome to Freedom Reborn Archive.
 

.dat to .txt?

Started by Boalt92, June 21, 2007, 11:05:56 PM

Previous topic - Next topic

Boalt92

Are there any commands or utilities that would read the .dat and print to a text file?

The FFedit window is small, and id like a list of characters, fx, objects etc that i can either print or squeeze into a single window.

Not a major issue, I was just wondering if there is an easy way to do it.

Thanks in advance.

B92

stumpy

The datfiles module makes that pretty easily doable.

What specifically to you want to do?

If you just want a list of the names of something from a particular control panel, then you can do that easily enough from the game console. (See the tech FAQ for how to open the console, etc.)

For example, to print out a list of the FFEdit character names, enter
import datfiles
itemnames = datfiles.Campaign_ReadCharacters().keys()
itemnames.sort()
for item in itemnames: print item


If you want to print the FX names
import datfiles
itemnames = datfiles.Campaign_ReadFX().keys()
itemnames.sort()
for item in itemnames: print item


If you want to print the object names
import datfiles
itemnames = datfiles.Campaign_ReadObjects().keys()
itemnames.sort()
for item in itemnames: print item


And so on. Each of those is the same except for which datfiles particular function is called in the second line.

All the stuff printed to the console will be available in the script.log (and you can cut and paste it into Word, etc. for whatever your purposes are).

Boalt92

that's it exactly.

sometimes i ez script on my palm device and it's helpful to have templates, powers, etc. on a text file.

thanks

B92