Eight steps backward, seventeen steps forward, two more backward (or something like that) ...
I have been struggling with a mysterious bug that caused the editor to crash at "random" occasions. What was making things worse was that Delphi wouldn't give me any indication of where the error occured in my program. Finally I had to decide to just rewrite huge parts of the code and see what would happen ... I even had to cut out the subwindow feature and display the pictures in the main window instead.
After the dust had settled, I found not only that the crashes had disappeared, but also that the editor could read much more .ILB files than ever before! I've tried most of the files and many are read correctly, such as:
- All unit files (as far as I can tell)
- All faces files
- All structures files (tower, guild, mine, etc)
- Almost all places files (dungeon, monster lair)
- Most altars (altar of lightning, etc)
- Some terrain (water, ice, rocks, etc) - couldn't find grass, wasteland etc though
- Some city files (only human cities found so far)
- Some magic effects (like storms)
- Pictures in the campaign story book
- User interface parts (like menus) - pretty useless but fun nevertheless

- Probably some more that I forgot in all the excitement
Being able to read these is almost equal to being able to write them: I just have to write the code ... (which is almost completed).
Unfortunately, when I then tried to re-add the subwindows, there was a new error (although not half as bad as the first one) so for now I'm stuck with using the main window. But, all in all, I think I made quite some progress this weekend.
Now, as for this week's trivia:
Quoted from badman69mt:
You know how when you extract the sprite frames from the ILB, they come out in BMP format? Well, I was wondering, does the background color of the picture matter? And if so, would it be possible to change the format from a 1 layered BMP to a 2 layered PSD(Photoshop). The first layer being the background layer, the second being anything on top of it.
As I don't have the .PSD file format description, I have no idea of how to implement this. But there's an easy workaround for this: just select all background coloured pixels (there's a menu item for this, but I don't know which one off the top of my head) and press 'delete'. Then (if you wish) add a new layer containing your favourite background colour and put it behind the first one.
Quoted from LordOfMaps:
Well every thing works good but I think that you need to make it so that the user can pick what color will be the transparent color. Oh and please make so that it can read ushadow.
You'll love me for this: the editor now automagically finds the correct background colour in your .BMP file when it converts it to unit graphics (taking the upper left pixel colour as the background colour). Also, ushadow.ilb is read correctly now.
SmurfHero - Leader of the Smurf race