• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

agn2txt error

Horst18519

Moderator
Resource contributor
Messages
2,385
Country
germany
EDIT: Very sorry, I guess I made a mistake.

But while we're at it: Would it be possible that agn2txt and txt2agn would be able to handle batch files?
It would be very nice if one could specify a folder and the tool processes all agn files in that folder into txt files with the same name and vice versa.
 
Last edited:
Hi Thorsten,

You could easily write a batch file to do so. Something like:

Code:
for %%f in (*.agn) do agn2txt %%f > %%~nf.txt

I haven't tested the code, so hopefully I made no mistakes :).
 
Trying to recompile them back to agn after working on my files, I get an annotator crash though.
If I'm not mistaken, the GUID for those default buildings (B) in the annotator is just zeros. If I convert an agn file that only include those into txt, it only shows that 0 GUID. But converting back into agn, the Annotator crashes if I try to load the file.

Code:
Location 011221002313332
GenericBuildingTexture Default
RowHouseTexture Default
BuildingHeights 0.5 0 0 0
VegetationClasses 0 0
VegetationDensity 0 0
VegetationHeights 0 0 0 0
AGNGenericBuilding {00000000-0000-0000-0000-000000000000} 0.458309173583984 0.213910102844238 0.104186654090881 0.994557738304138 0.00976680312305689 0.00976562593132257
AGNGenericBuilding {00000000-0000-0000-0000-000000000000} 0.394828796386719 0.223678112030029 0.22505210340023 0.974346697330475 0.00976336374878883 0.00976562593132257
AGNGenericBuilding {00000000-0000-0000-0000-000000000000} 0.375299453735352 0.288132667541504 -0.223803460597992 -0.974634289741516 0.00976243987679482 0.00976562593132257
AGNGenericBuilding {00000000-0000-0000-0000-000000000000} 0.394828796386719 0.201217174530029 0.891104221343994 -0.453798562288284 0.00977214518934488 0.00976562593132257
AGNGenericBuilding {00000000-0000-0000-0000-000000000000} 0.337213516235352 0.315473079681396 0.874702513217926 -0.484660178422928 0.0097667658701539 0.00976562593132257
AGNGenericBuilding {00000000-0000-0000-0000-000000000000} 0.288386344909668 0.199262142181396 0.291270434856415 0.956640720367432 0.00976363010704517 0.00976562593132257
 
Let me check, I made some changes recently to support FS2004 format as well. Maybe I broke some things.
 
Hi Thorsten,

Since I don't have your photo scenery, I tried it with one of my files. But I get no crash in Annotator after I decompile with agn2txt and then recompile with txt2agnx.
 
Arno, could you please try once more and confirm this: Is it possible to compile AGNGenericBuilding {00000000-0000-0000-0000-000000000000} objects without crashing the Annotator?

I did another try, deleted all my autogen, just placed 3 single buildings (B) and saved. Decompiled to txt (those buildings are always those 00000... generic buildings), then immediately compiled back to agn, loaded the resample again in the Annotator - and it crashed.
 
Hi Thorsten,

Ok, I'll try like you did. Make a agn file with annotator, decompile, recompile and load again.
 
Hi Thorsten,

I just tried it again. Started with an area without autogen. Added some buildings. Then decompile with agn2txt. Then recompiled with txt2agnx. Annotator still likes the new AGN file after that.

Are you sure you are using txtagnx? The old txt2agn should be removed since the tools also support FS2004 AGN files.
 
Now that explains some things. Sorry, I didn't see that txt2agnx, I'll try that one instead.
 
Hopefully that works. When I tried txt2agn the tool itself crashed.
 
Arno, I have to bring this up again.
Unfortunately, it still doesn't work for me, even with the txt2agnx.exe. If I place one simple default building, or if I "agn2txt" and "txt2agn" again a file that includes default buildings or just vegetation rectangles, the annotator crashes each time.
I also notice how the size of the agn file increased a bit when I did this with a file containing a default house, but when I did it with a file that only contained vegetation rectangles, the size dropped to half. Is that to be expected?
 
Hi Thorsten,

The size should not change normally. Can you send me your two files for testing?

Send from my phone using Tapatalk, so excuse the short sentences and possible typos
 
Hello Arno,

now that we solved the issue (as usual the culprit was at the front end...) I still struggle to batch-job files.

For decompiling I use this batch line: (example file "033B2an1.agn")

for %%f in (*.agn) do agn2txt.exe %%f > %%~nf.txt
That gives me txt files with correct names. But if I recompile back with the following line:
for %%f in (*.txt) do txt2agnx.exe %%f .
I get a file called "033B2aan.agn". If I process several files at a time, I only get this one file, so the naming seems to be wrong. How does the line have to read to get correct file names?
 
Hi Thorsten,

You are working with landclass autogen I think if I see the names. Until now I have only tested with photorealistic autogen files, I think that explains why the location (name) is to correct. Let me check that.
 
Hi Thorsten,

I fixed the bug, so in the development release of tomorrow it should work fine.
 
Back
Top