[Modding Reference] - Modding FAQ

Discussion in 'PC Mods' started by ZephyrWarrior, Oct 16, 2015.

  1. ZephyrWarrior

    ZephyrWarrior Got Your Back

    -------------------------
    -------------------------
    Logistics
    -------------------------
    -------------------------

    Q:
    Everyone seems to be talking about xml files and win.bmd files, but I cant find any! All I see are pak files!
    A: Don't panic, the xml and win.bmd files are compressed in pak format for distribution. There are a number of tools to help with your file editting:
    -State of Decay Extraction Tools
    https://forums.undeadlabs.com/threads/state-of-decay-extraction-tools.34609/
    -QuickBMS With Custom Script
    http://quickbms.aluigi.org
    http://forums.nexusmods.com/index.php?/topic/2809544-year-one-pak-files/
    Code:
    # ZIP files (alternative way) 0.1
    #   get end of directory and parses central directory
    # script for QuickBMS http://quickbms.aluigi.org
    
    goto -0x16
    idstring "PK\x05\x06"
            get disk_num        short
            get disk_start      short
            get central_entries short
            get central_entries short
            get central_size    long
            get central_offset  long
            get comm_len        short
            getdstring comment  comm_len
    
    for i = 0 < central_entries
        goto central_offset
        idstring "PK\x01\x02"
            get ver_made        short
            get ver_need        short
            get flag            short
            get method          short
            get modtime         short
            get moddate         short
            get crc             long
            get comp_size       long
            get uncomp_size     long
            get name_len        short
            get extra_len       short
            get comm_len        short
            get disknum         short
            get int_attr        short
            get ext_attr        long
            get rel_offset      long
            getdstring name     name_len
            getdstring extra    extra_len
            getdstring comment  comm_len
        savepos central_offset
    
        goto rel_offset
        idstring "PK\x03\x04"
            get ver             short
            get flag            short
            get method          short
            get modtime         short
            get moddate         short
            get crc             long
            get comp_size       long
            get uncomp_size     long
            get name_len        short
            get extra_len       short
            getdstring name     name_len
            getdstring extra    extra_len
            savepos offset
    
            if method == 0
                Log name offset uncomp_size
            else
                if method == 8
                    ComType zlib
                elif method == 1
                    ComType unshrink
                elif method == 6
                    ComType explode
                elif method == 9
                    ComType deflate64
                elif method == 12
                    ComType bzip2
                elif method == 14
                    ComType lzmaefs
                elif method == 13
                    ComType XMemDecompress
                elif method == 21
                    ComType XMemDecompress
                elif method == 64
                    ComType darksector
                elif method == 98
                    ComType ppmd
                elif method == 99
                    print "this script doesn't support AES encryption"
                    cleanexit
                else
                    print "unsupported compression method %method%"
                    cleanexit
                endif
                CLog name offset comp_size uncomp_size
            endif
    next i
    
    -State of Decay Tools
    https://forums.undeadlabs.com/threads/state-of-decay-tools-sod-tools-revised-release.45544/
    -XML2BMD
    https://forums.undeadlabs.com/threads/xml-compiler-is-ready.37276/

    -------------------------

    Q: This XML code makes my head hurt, is there an easier way to do this?
    A: Not really, yet anyways. Some files are compatible with Microsoft Excel but aren't imported properly due to lack of schema. I'm personally developing some tools to aid in this as well.

    -------------------------

    More to come :)
     
    tobu24 likes this.

Share This Page