AgnTools

From FSDeveloper Wiki
Jump to: navigation, search

AgnTools is the combined name for two autogen related tools: agn2txt and txt2agn. The first is a decompiler to turn FSX AGN files into a readable TXT file. The second is the compiler to do the reverse step. This allows developers to make small changes to their AGN, without using the Annotator tool from the SDK.

Getting AgnTools

Prerequisites

Microsoft .NET Framework version 2.0

Installation

At this moment AgnTools is still under development, but a beta version is already available. Please be aware that this version might have bug left. You can download the latest development release here.

The development release also contains other tools that I made, like ModelConverterX. Just unzip all of these tools to a folder of your choice. That's all the installation.

Usage

Both tools are command line applications, which means that you get best results if you run them from the command prompt.

agn2txt

agn2txt decompiles a AGN file into a readable text file. The tool takes one argument, the AGN filename to decompile. For example:

 agn2txt 003110300100212an.agn

It will then write the readable text to the screen. If you want to capture the output to a TXT file you can redirect the output to such a file. For example:

 agn2txt 003110300100212an.agn > 003110300100212an.txt

txt2agn

txt2agn compiles a TXT file back into an AGN file. The tool takes two arguments, the TXT file you want to compile and the folder in which the AGN file should be created. For example:

 txt2agn 003110300100212an.txt myscenery\texture

TXT format

This section describes the format used in the text files that are processed by agn2txt and txt2agn. If you want to make changes to the TXT file, make sure to follow the syntax described here. The format matches the binary AGN format relatively closely, so the AGN format description might provide further reference information.

Each line starts with the name of the type of autogen object. Below all possible types are described, including the additional parameters they might have.

Location

Specifies the name of the LOD square that the autogen applies to.

Version

Specifies the version of the autogen. Always 1091777331 for FSX.

AGNBuildingHeight

The distribution of the building hieghts for generic autogen buidlings. This command has four parameters:

  • Percentage of objects with 1-2 floors (range 0.0-1.0)
  • Percentage of objects with 3-5 floors (range 0.0-1.0)
  • Percentage of objects with 6-8 floors (range 0.0-1.0)
  • Percentage of objects with 9-12 floors (range 0.0-1.0)

AGNGenericBuilding

Defines an autogen generic building. This command has 7 parameters:

  • GUID of the roof
  • Position X
  • Position Y
  • Direction X
  • Direction Y
  • Offset X
  • Offset Y

AGNGenericBuildingTexture

Defines the texture used for generic autogen buildings. This command has 1 paramater:

  • Texture name (without extension)

AGNLibraryObject

Defines an autogen library object. This command has 7 parameters:

  • GUID of the object
  • Position X
  • Position Y
  • Direction X
  • Direction Y
  • Offset X
  • Offset Y

AGNPolyBuilding

Defines an autogen polygonal building. This command has two parameters and a list of vertices:

  • Building type GUID
  • Extrusion width

And then for each vertex of the polygon:

  • Position X
  • Position Y

The first and last vertex of the polygon should be the same.

AGNPolyVegetation

Defines an autogen polygonal vegetation. This command has one parameters and a list of vertices:

  • Vegetation type GUID

And then for each vertex of the polygon:

  • Position X
  • Position Y

The first and last vertex of the polygon should be the same.

AGNRectangularVegetation

Defines autogen rectangular vegetation. This command has 5 parameters:

  • Vegetation type GUID
  • Position X
  • Position Y
  • Offset X
  • Offset Y

AGNRectangularVegetationFS9

Defines autogen rectangular vegetation in FS9 style. This command has 4 parameters:

  • Position X
  • Position Y
  • Offset X
  • Offset Y

AGNRowHouse

Defines an autogen row house. This command has 6 parameters:


  • Position X
  • Position Y
  • Direction X
  • Direction Y
  • Offset X
  • Offset Y

AGNRowHouseTexture

Defines the texture used for row houses. This command has 1 paramater:

  • Texture name (without extension)

AGNVegetationDefFS9

Defines the vegetation definition used for AGNRectangularVegetationFS9. This command has 8 parameters:

  • Vegetation class 1
  • Vegetation class 2
  • Percentage of vegetation class 1
  • Maximum density
  • Minimum height of vegetation class 1
  • Maximum height of vegetation class 1
  • Minimum height of vegetation class 2
  • Maximum height of vegetation class 2

Support

If you have any problems while using the program or if you have suggestions and other feedback to improve the tool, please let me know. You can either contact me directly or visit the Autogen subforum at FSDeveloper.com.

User license

(c) 2011 SceneryDesign.org / Arno Gerretsen

This software program is distributed without charge to other addon developers. Redistribution of the original ZIP file is allowed. You are NOT allowed to sell this software program or ask money for its distribution. Special effects created with this software program can be used in commercial scenery projects if you wish.

The copyright and any intellectual property relating to this program remain the property of the author.

The software distributed in this way may represent work in progress, and bears no warranty, either expressed or implied.