Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,949 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

guard3

GAME.DTZ Python Scripts

Recommended Posts

guard3

Hello! :)

As some of you may know, I try to document GAME.DTZ for Vice City Stories. Info and converted resources can be found here.

I'm new to programming. I recently started learning Python 3, but I thought I could share what I've made. Note that I work with decompressed GAME.DTZ

 


PEDSTATS.DAT

 

 

#made by guard3import structimport binasciidtzpath = input('Enter file path ')with open (dtzpath, 'rb') as f:    f.seek(0x8C, 0)    offpedstat = f.read(4)    offpedstat = struct.unpack('<L', offpedstat)    offpedstat = ''.join(map(str, offpedstat))    offpedstat = int(offpedstat)    f.seek(offpedstat, 0)    x = 0    offset = offpedstat    for x in range (0, 42):        pedstatline = f.read(4)        pedstatline = struct.unpack('<L', pedstatline)        pedstatline = ''.join(map(str, pedstatline))        pedstatline = int(pedstatline)        offset += 4        f.seek(pedstatline, 0)        ID = f.read(4)        ID = struct.unpack('<L', ID)        ID = ''.join(map(str, ID))        ID = str(ID)        B = f.read(4)        B = struct.unpack('<f', B)        B = ''.join(map(str, B))        C = f.read(4)        C = struct.unpack('<f', C)        C = ''.join(map(str, C))        H = f.read(4)        H = struct.unpack('<f', H)        H = ''.join(map(str, H))           I = f.read(4)        I = struct.unpack('<f', I)        I = ''.join(map(str, I))           J = f.read(1)        J = struct.unpack('<B', J)        J = ''.join(map(str, J))        J = int(J)        f.seek(1, 1)        D = f.read(1)        D = struct.unpack('<B', D)        D = ''.join(map(str, D))        D = int(D)        E = f.read(1)        E = struct.unpack('<B', E)        E = ''.join(map(str, E))        E = int(E)        F = f.read(1)        F = struct.unpack('<B', F)        F = ''.join(map(str, F))        F = int(F)        G = f.read(1)        G = struct.unpack('<B', G)        G = ''.join(map(str, G))        G = int(G)        A = f.read(26)        A = ''.join(map(chr, A))        print(A, B, C, D, E, F, G, H, I, J, '#', ID)           x += 1        f.seek(offset, 0)

 

 

 


CULL.IPL

 

 

#made by guard3import structdtzpath = input('Enter file path ')with open (dtzpath, 'rb') as f:    f.seek(0x98, 0)    numcull = f.read(4)    numcull = struct.unpack('<L', numcull)    numcull = ''.join(map(str, numcull))    numcull = int(numcull)    f.seek(0x9C, 0)    offcull = f.read(4)    offcull = struct.unpack('<L', offcull)    offcull = ''.join(map(str, offcull))    offcull = int(offcull)    f.seek(offcull, 0)    x = 0    print('cull')    for x in range (0, numcull):        f.seek(0, 1)        LowX = f.read(2)        LowX = struct.unpack('<h', LowX)        LowX = ''.join(map(str, LowX))        LowX = int(LowX)        TopX = f.read(2)        TopX = struct.unpack('<h', TopX)        TopX = ''.join(map(str, TopX))        TopX = int(TopX)        LowY = f.read(2)        LowY = struct.unpack('<h', LowY)        LowY = ''.join(map(str, LowY))        LowY = int(LowY)        TopY = f.read(2)        TopY = struct.unpack('<h', TopY)        TopY = ''.join(map(str, TopY))        TopY = int(TopY)        LowZ = f.read(2)        LowZ = struct.unpack('<h', LowZ)        LowZ = ''.join(map(str, LowZ))        LowZ = int(LowZ)        TopZ = f.read(2)        TopZ = struct.unpack('<h', TopZ)        TopZ = ''.join(map(str, TopZ))        TopZ = int(TopZ)        flag1 = f.read(2)        flag1 = struct.unpack('<H', flag1)        flag1 = ''.join(map(str, flag1))        flag2 = f.read(2)        flag2 = struct.unpack('<H', flag2)        flag2 = ''.join(map(str, flag2))        centerX = (LowX + TopX)/2        centerY = (LowY + TopY)/2        centerZ = (LowZ + TopZ)/2        print(centerX, centerY, centerZ, LowX, LowY, LowZ, TopX, TopY, TopZ, flag1, flag2)           x += 1    print('end')

 

 

 


Color Data

 

 

#made by guard3import structdtzpath = input('Enter file path ')with open (dtzpath, 'rb') as f:    f.seek(0x90, 0)    offcarcols = f.read(4)    offcarcols = struct.unpack('<L', offcarcols)    offcarcols = ''.join(map(str, offcarcols))    offcarcols = int(offcarcols)    f.seek(offcarcols, 0)    x = 0    for x in range (0, 230):        f.seek(0, 1)        R = f.read(1)        R = struct.unpack('<B', R)        R = ''.join(map(str, R))        R = int®        G = f.read(1)        G = struct.unpack('<B', G)        G = ''.join(map(str, G))        G = int(G)        B = f.read(1)        B = struct.unpack('<B', B)        B = ''.join(map(str, B))        B = int(B)        print(R,',',G,',',B, '#',x)           x += 1

 

 

 


2DFX

 

 

#made by guard3import structdtzpath = input('Enter file path ')with open (dtzpath, 'rb') as f:    f.seek(0x54, 0)    num2dfx = f.read(4)    num2dfx = struct.unpack('<L', num2dfx)    num2dfx = ''.join(map(str, num2dfx))    num2dfx = int(num2dfx)    f.seek(0x58, 0)    off2dfx = f.read(4)    off2dfx = struct.unpack('<L', off2dfx)    off2dfx = ''.join(map(str, off2dfx))    off2dfx = int(off2dfx)    f.seek(off2dfx, 0)    x = 0    print("2dfx")    for x in range (0, num2dfx):        f.seek(0, 1)        B = f.read(4)        B = struct.unpack('<f', B)        B = ''.join(map(str, B))        C = f.read(4)        C = struct.unpack('<f', C)        C = ''.join(map(str, C))        D = f.read(4)        D = struct.unpack('<f', D)        D = ''.join(map(str, D))                f.seek(4, 1)        E = f.read(1)        E = struct.unpack('<B', E)        E = ''.join(map(str, E))        F = f.read(1)        F = struct.unpack('<B', F)        F = ''.join(map(str, F))        G = f.read(1)        G = struct.unpack('<B', G)        G = ''.join(map(str, G))        H = f.read(1)        H = struct.unpack('<B', H)        H = ''.join(map(str, H))        I = f.read(4)        I = struct.unpack('<L', I)        I = ''.join(map(str, I))        I = int(I)        if I == 0:            L = f.read(4)            L = struct.unpack('<f', L)            L = ''.join(map(str, L))            M = f.read(4)            M = struct.unpack('<f', M)            M = ''.join(map(str, M))            N = f.read(4)            N = struct.unpack('<f', N)            N = ''.join(map(str, N))            O = f.read(4)            O = struct.unpack('<f', O)            O = ''.join(map(str, O))            Q = f.read(1)            Q = struct.unpack('<B', Q)            Q = ''.join(map(str, Q))            R = f.read(1)            R = struct.unpack('<B', R)            R = ''.join(map(str, R))            S = f.read(1)            S = struct.unpack('<B', S)            S = ''.join(map(str, S))            P = f.read(1)            P = struct.unpack('<B', P)            P = ''.join(map(str, P))            T = f.read(4)            T = struct.unpack('<L', T)            T = ''.join(map(str, T))            J = f.read(4)            J = struct.unpack('<L', J)            J = ''.join(map(str, J))            J = int(J)            if J == 505552:                J = '"coronastar"'                        K = f.read(4)            K = struct.unpack('<L', K)            K = ''.join(map(str, K))            K = int(K)            if K == 639680:                K = '"shad_exp"'            f.seek(8, 1)            print(x, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)        elif I == 1:            J = f.read(4)            J = struct.unpack('<L', J)            J = ''.join(map(str, J))            K = f.read(4)            K = struct.unpack('<f', K)            K = ''.join(map(str, K))            L = f.read(4)            L = struct.unpack('<f', L)            L = ''.join(map(str, L))            M = f.read(4)            M = struct.unpack('<f', M)            M = ''.join(map(str, M))            N = f.read(4)            N = struct.unpack('<f', N)            N = ''.join(map(str, N))            f.seek(20, 1)            print(x, B, C, D, E, F, G, H, I, J, K, L, M, N)        elif I == 3:            K = f.read(4)            K = struct.unpack('<f', K)            K = ''.join(map(str, K))            L = f.read(4)            L = struct.unpack('<f', L)            L = ''.join(map(str, L))            M = f.read(4)            M = struct.unpack('<f', M)            M = ''.join(map(str, M))            N = f.read(4)            N = struct.unpack('<f', N)            N = ''.join(map(str, N))            O = f.read(4)            O = struct.unpack('<f', O)            O = ''.join(map(str, O))            P = f.read(4)            P = struct.unpack('<f', P)            P = ''.join(map(str, P))            J = f.read(4)            J = struct.unpack('<L', J)            J = ''.join(map(str, J))            f.seek(12, 1)            print(x, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)                    else:            f.seek(40, 1)            print(x, "Hello")        x += 1    print("end")

 

 

Share this post


Link to post
Share on other sites
guard3

Hello again!

http://www.mediafire.com/file/sm4k5mpvsw422c9/ipl.py

I'm rewriting my scripts cause they're horrible and... they lack writing to file! Now that I got that right, I thought of uploading IPL for the time being, the rest is in the works. Note that you need Python 3.6 to run this thing. Enter the path of decompressed GAME.DTZ (drag n' drop works too), then the path of the folder you want the ipl files to be generated in (it must be something like C:/blah/blah/ don't forget the slash at the end) This is intended for VCS, but I thing the way I've written it allows for LCS IPL too.

Share this post


Link to post
Share on other sites
George Costanza

Locked on request

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.