PDA

View Full Version : Strange Problem with AFD files



blohmundvoss
November 18th, 2010, 11:35
I would be delighted if someone has an answer to the problem below but I'm posting it just to vent my frustration as much as anything.

Having recently discovered the joys of Scasmeditor, I have been tweaking the .afd files for Xavier's big East Asia airfields package, one of the must haves for any PTO. No criticism of the originals: I just like to have a consistent method for titling airfields so that I can find them quickly in the Menu in Free Flight. I have used BGLAnalyze to decompile the original afd.bgls, Scasmeditor to make the minor text changes and Scasm to recompile the .bgls. So far, so good.

I seem to have hit a maximum number of menu entries that didn't exist before; all of Xavier's fields were present in the menu in their original format.

1. Using my new versions, I cannot see the last few entries for Thailand or any of the entries for the USSR. Not only that, if I then activate another package of airfields in the Scenery Library I can't see them either.

2. If I turn the 'missing' airfields into a separate scenery package and activate them, I still can't see them in the Menu and I still can't activate any other airfields.

3. If I repeat no.2 - but deactivate the 'big' Xavier package first - the 'missing' entries do appear and so do any other airfield packages I add.

In other words, all the edited afd.bgls work individually but they won't work in total. I've tried:

- adding the 'missing' afd files to the 'Scenedb/afdfiles' directory (which holds the stock entries) but that will not work if the others are active

- deleting the relevant 'filelist' files, but that has no effect either

Given the time I spent editing the files I am reluctant to give up until I'm sure I'm not missing something. Any suggestions would be very welcome.

Many thanks
BuV

simonu
November 18th, 2010, 14:16
could be many things, when you compile the whole as one bgl is it the same size within a few bytes as the original. If not maybe scasm is crashing before it has finnished writing. Did you decompile it again and check the new source against the original
If the source is a large file check scasm buffer settings at the top of the file before the BGL header

Set( BUF 4096 )

kdriver
November 18th, 2010, 22:22
I've always had the same problem and assumed, like so many other things in CFS 2, there was a limit to the number of AFD files.

I also edit the names for the sake of consistency. If the new name is no longer than the original, I use frhed hex editor. This is much quicker than decompiling and reassembling the bgl, and the file size remains the same.

blohmundvoss
November 19th, 2010, 00:48
Ah! So I'm not the only one. That's encouraging - even if it's not the answer I would have liked!

Simonu - thanks for the tip. All the .bgls are tiny - c.1kb each - and when I checked the edited product it seemed fine but I'll have another look.

Kdriver - thanks for the tip about hex editor - I do have that installed but I usually find it too much of a jungle to fins what I'm looking for, whereas Scasmeditor displays something I can understand quickly. I will have another look, however.

p.s. one other thing I notice is that activating/deactivating these new afds produces some index files in the cfs2 root directory like the attached (viewed with Wordpad)

simonu
November 19th, 2010, 03:33
I do not think CFS2 has a limit on AFD entries, I am running a complete set of FS2K2 AFD which include all kinds of data that CFS2 can't use but they work fine. Your mention of files in CFS2 root being generated rings a bell. There are 4 Index files

ICAO_INDEX
INDEX_FILE <<<<<THIS ONE CONTAINS A LIST OF AFD entries, it probably assigns GUID numbers for use in the *_INDEX files
LAT_INDEX
STR_INDEX

I believe these files are generated if not present, so one could try moving them,
try this and see what happens

Add your new ADF as you want them
Shut down CFS2 and move those index file to a safe place just in case the following doesn't work.
Now restart CFS2 and see if those indexes are regenerated.
It should take CFS2 longer than normal to load, Like when you first run a new install.
Now I hope you will find your airbases as they should be.

kdriver
November 19th, 2010, 05:34
Simon,

I tried that three times and CFS 2 did not like it at all. It crashed before completing loading each time.

KD

simonu
November 19th, 2010, 08:25
I have tried this also and as predicted the INDEX files are rebuilt, however I was mistaken there are 5 files I didn't mention WAYPOINT_INDEX.

If you are getting a crash when doing this you might try a few more times, Take out the suspect AFD s and try again, using the old proccess of elimination to identify which file is causing your crash.

kdriver
November 20th, 2010, 05:37
I have 850 AFD files in my PTO alone. They are grouped into country scenery layers. I can activate any combination of layers, but a maximum of about 200 AFD entries only will show.

This is the same for my ETO and MTO which also have many hundreds of AFD files.

The index files regenerate OK as long as I don't have more than about 200 AFD files activated.