I've been working on a crude nohrio program to import and export data (enemies, heroes, attacks, items, textboxes) to csv files. It's totally generic, working by inspecting the fields of the lump's dtype, but there weren't any other interesting lumps to handle (aside from shop items, but nohrio can't memmap .stf directly because of the odd length).
What I learnt is that this is totally the wrong approach, and it needs to be rewritten. You really need to write lump-specific code which knows how to handle things like enumerations, off-by-ones, arrays that are split into two pieces, and the like. I think nohrio itself should know what's in a data field, rather than just the dtype. For example, I even had to recognise strings by their dtype. My eventual goal for nohrio is to do better, and wrap all lumps in classes (preferably ndarray subclasses) to cleanup the interface. So little of this code has any use, aside from the csv handling/escaping functions. However, just as I finished, I discovered that Python actually has a module for CSV files. That's to be expected, but I didn't even think to look. I did however fix several nohrio bugs and implement missing functionality, though. http://gitorious.org/~tmc/nohrio/tmc/commits/rpgbatch _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
