Chapter Two: Fundamental Unit Statistics Introduction to DAT files In short, DAT files (found in the arr\ directory in the MPQs) are the basic blueprints that decide how to put together the rest of the files in the MPQ. They decide what statistics what unit gets, which graphic to associate with which unit, what behavioral patterns each unit has, which sounds have what properties, what order to place the campaign maps in, what the properties of each weapon are, what the properties of each "order" are, and basically all other "high-order" construction decisions that are not handled by the data and code in the EXE. Each DAT file is composed of many different objects of the same type (units, weapons, sounds, sprites, orders, etc.). Each object in a DAT file is given a set of variables which control its specific properties. For example, each unit has variables which control how many hit points it has, whether it has shields or not, what sprite it should use, etc. While programs like Arsenal III will display mnemonic descriptions and values for each variable an object has (e.g., all the sprites have names, whether a unit has a certain "flag" activated is represented by a check box) you should remember that DAT files really contain nothing more than numbers. Each number in a specific variable field is representative of a certain property (e.g., the number that is associated with the unit sprite in units.dat is actually a "pointer" or reference to an object in sprites.dat, and any text that you may find available in the Arsenal III menus is most likely to be just a line reference to a TBL file, which actually contains the text). It is also important to remember that the objects in a DAT file are ordered, that is, each have a specific entry number associated with them that can not be changed. For example, the units.dat object that is originally the Terran Marine unit is entry number 0 (the first entry) in units.dat, the Terran Ghost is entry number 1 (second entry), etc. Arsenal III does sort the units into categories so you can find them easier (terran units together, neutral units together, etc.) but that does not alter what order they actually are in within the DAT itself. Arsenal III displays the entry number of each object in a DAT file in the lower right-hand corner. The first DAT files that will be addressed are units.dat and weapons.dat, since they are probably the easiest to deal with and they hold the more popular variables to be tweaked. As you probably guessed, units.dat contains the primary variables for each unit object and weapons.dat contains the variables for each weapon. While weapons.dat does control every property of a "weapon", units.dat does not control every property of what most would consider a full "unit." In particular, it does not control the command buttons each unit gets or specifics like whether it can train other units or not, spawn larva, etc. That stuff is controlled by the EXE and will be dealt with by Stargraft. Think of the objects in units.dat as more of the "outer shell" of primitive unit outlines defined loosely in the EXE. |
Copyright (c) 1999-2000 Jeffrey Pang.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the
Free Software Foundation with no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
[an error occurred while processing this directive]