diff options
author | Treeki <treeki@gmail.com> | 2011-03-12 23:17:12 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-03-12 23:17:12 +0100 |
commit | 7d4e4c0b34a613dd3c0220475ae4e448197522c1 (patch) | |
tree | 4f5cee367de3fdef4f9a7c84af59ffe76a2bb1c3 /setgen.py | |
download | kamek-7d4e4c0b34a613dd3c0220475ae4e448197522c1.tar.gz kamek-7d4e4c0b34a613dd3c0220475ae4e448197522c1.zip |
initial commit. now I can start playing with stuff!
Diffstat (limited to 'setgen.py')
-rw-r--r-- | setgen.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/setgen.py b/setgen.py new file mode 100644 index 0000000..e627066 --- /dev/null +++ b/setgen.py @@ -0,0 +1,22 @@ +import struct + +names = {} +names['PATH'] = '/Maps/forest/pathdata.bin' +names['3D00'] = '/Maps/forest/base.brres' + +header = struct.pack('>4sI', b'MSet', len(names)) +entrydata = b'' +stringtable = b'' +currentoffset = 8 + (8 * len(names)) + +for key,path in names.items(): + entrydata += struct.pack('>4sI', key.encode('Shift-JIS'), currentoffset) + + encpath = path.encode('Shift-JIS') + stringtable += encpath + stringtable += b'\0' + currentoffset += len(encpath) + 0 + + +open('SMGoldwood.fileset', 'wb').write(header + entrydata + stringtable) + |