import struct
data = open(r'C:\git\bt411\content\BTL4.RES', 'rb').read()
labOnly, maxID = struct.unpack_from('<ii', data, 4)
offs = struct.unpack_from('<%dI' % maxID, data, 12)
TN = {1: 'ModelList', 9: 'BoxedSolidStream', 10: 'VideoModel', 11: 'StaticAudioStream',
      15: 'GameModel', 16: 'Animation', 18: 'GaugeImageStream', 30: 'ExplosionTableStream'}
res = {}
for o in offs:
    if o == 0:
        continue
    rid, rt = struct.unpack_from('<ii', data, o)
    nm = data[o + 8:o + 40].split(b'\0')[0].decode('ascii', 'replace')
    res[rid] = (rt, nm)
print('total resources:', len(res), 'maxID:', maxID)
print('=== descriptor effect ids (26-31) + weapon explode (13) ===')
for i in [13, 26, 27, 28, 29, 30, 31]:
    r = res.get(i)
    print('  id=%3d' % i, ('type=%d(%s) name=%r' % (r[0], TN.get(r[0], '?'), r[1])) if r else 'ABSENT')
