![]() |
![]() |
||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||
|
Tutorial: A GFF to TXT File Conversion Program Intended Audience: NOTICE: This tutorial is to give software developers an example of how to use the Generic File Format (GFF). The source code provided is unsupported; compile and run at your own risk. Please refer to the For Developers FAQ and the NWN End User License Agreement (EULA) for more information. PurposeI would like to keep my individual module resources checked into a source code control system but I would prefer to store them as text files instead of binary files since that allows me to do comparisons between versions much easier. Since most of the game's resources are stored using the GFF, I need a way to convert a file from it to text. The text output should follow the XML-like format outlined below, with appropriate values inserted between each tag. Each <STRUCT> element would mirror a GFF Struct, containing <FIELD> elements for each GFF Field that the Struct contains. <STRUCT> Command-LineThe program's command line should look like this: gff2txt [gff filename] [txt filename]
Program ArchitectureOnce again, I am only creating a quick and dirty utility, so I'm not going to spend time creating a fully fleshed out GFF class. However, I will create a few helper functions to reduce code duplication. Class DefinitionsNone. C Source CodeTo view or download the C Source Code you need to be logged into your BioWare Community Account. If you don't have an account you can sign up for a free BioWare Community Account. Extra Credit1. Complete the Program There are a few things left to do to complete this program:
2. Remove the Extraneous Parameter Since we always want the name of the output text file to resemble the name of the GFF resource, always having to supply its name is a bit of a waste (and error prone). Modify the program so that the name of the output text file is based on the name of the given GFF file. 3. Combine ERF / GFF Techniques Using the information from this tutorial and Tutorial 1, write a single program that parses a given module, converting gff resource types to text files that are stored in the given directory. This will make it much more convenient to extract the data for the purposes of checking them into source control.
|
||||||||||||||||||||||||||||||||
|
|
||
|
Multiplayer Games at Neverwinter Connections
|
||
|
Buy Premium Modules
|
||
|
4,828,578 BioWare Users:
|
||