proxeeus / world_forge

3D Zone editor (spawns / grids) for EQEmu, based on panda_zonewalk.
1 stars 0 forks source link

line 244, in createAlphaBMP (pixel,) = struct.unpack('<b', bm[pixel_index:pixel_index+1]) struct.error: unpack requires a string argument of length 1 #1

Open thalic opened 5 years ago

thalic commented 5 years ago

I got you project almost working on Windows 10. It loads, all Libs are found but then:

... WLDFile load complete. zone loading placeable objects 2 s3dfile: nro_2_obj.s3d S3DFile load complete. WLDFile loading nro_2_obj.wld from S3D container processing version 1 WLD file WLDFile load complete. zone loading character s3dfile: nro_chr.s3d S3DFile load complete. WLDFile loading nro_chr.wld from S3D container processing version 1 WLD file WLDFile load complete. preloading textures preloading textures for container: objects preloading textures for container: nro_obj Adding animated sprite to master list FIRE1_SPRITE Adding animated sprite to master list FIRE1_SPRITE Adding animated sprite to master list FIRE1_SPRITE preloading textures for container: nro_chr Traceback (most recent call last): File "D:\eqone\tools\world_forge\worldforge.py", line 884, in world.load() File "D:\eqone\tools\world_forge\worldforge.py", line 746, in load self.loadZone(zone_name, basepath) File "D:\eqone\tools\world_forge\worldforge.py", line 728, in loadZone error = self.zone.load() File "D:\eqone\tools\world_forge\zone.py", line 430, in load self.preloadTextures() File "D:\eqone\tools\world_forge\zone.py", line 284, in preloadTextures self.preloadWldTextures(wld_obj) File "D:\eqone\tools\world_forge\zone.py", line 265, in preloadWldTextures self.tm.loadTexture(name.lower(), wld_container) File "D:\eqone\tools\world_forge\gfx\texture.py", line 176, in loadTexture img = self.createAlphaBMP(texfile, texname) File "D:\eqone\tools\world_forge\gfx\texture.py", line 244, in createAlphaBMP (pixel,) = struct.unpack('<b', bm[pixel_index:pixel_index+1]) struct.error: unpack requires a string argument of length 1

thalic commented 5 years ago

Workaround:

    for i in range(0, npixels):
        try:
            (pixel,) = struct.unpack('<b', bm[pixel_index:pixel_index+1])            
        except Exception:
             pass   
        rgba = palette[pixel] | -16777216    # set alpha to fully opaque
        img += struct.pack('<i', rgba)
        pixel_index += 1

It only happens with "HD" Textures from P99, no errors with original rof2.