Welcome.
   My name is Nema Fakei; How may I help you?

The Phak

INI Editing

Introduction - Basic Syntax - Advanced Syntax - Declarations

General:
 Index
 Misc. Downloads

Emperor Modding Tutorials:
 Modding Overview
 INI Editing
 Texturing
 XAF Editing

External:
 Fed2k
 Dune Editing
 Westwood Studios

Contact:
 Nema Fakei

Introduction to ini files

There are now quite a few documents on the details of Emperor ini files, and what you can and can't do with them (they're in the Dune Editing Documents page). I'll just tell you the syntax and structure of the ini files.


Basic Syntax

Before using ini files, you need to know how they work. Each entry into an ini file consists of a header - a name for the entry, in square brackets - and a set of properties with values. An example section is Harkonnen Engineer's pistol, in the Emperor Rules file.
[HKEngineerGun]
Bullet = Pistol_B
ReloadCount = 45
TurretDisableIfUnitDeployed = TRUE
We can see the name of the section, telling us what the entry refers to. We can see each property of the gun - the bullet it uses, we are told is the Pistol Bullet, referenced to as Pistol_B - the name of the header for the pistol bullet entry. We are also told the reload value for the pistol - 45. Note that spaces can be inserted as the user pleases before and after the value of each property, and there is no effect on the validity of this property.


Advanced Syntax

When you look through the ini files, you realise that the format is a little more complicated. For example, the Harvester is built at a factory - but there are three factories. When there is more than one possible value for a property, commas are used to separate different values for the same property. Here is the entry.
PrimaryBuilding = HKFactory, ATFactory, ORFactory//can be built in any factory
Notice the two slashes after the values. This indicates a comment by the authors. Anything on that line after the comment will be ignored by the engine, so you can put whatever you like there, and the game will not care. However, while this is used by the Rules.txt and the Artini.txt files, other ini files, like Commonmusic.txt, use semicolons, for example:
; Atreides Skirmish themes
If in doubt, always check what is used in the file you are modifying.


Declarations

In order to add or remove objects, you also need to be aware of the general format of ini files. Usually, each ini file has a declarations section, each with one or more declarations entries. These have different functions, depending on the ini file they come from. You will notice, near the top of the Rules.txt file:
[HouseTypes]
Atreides
Ordos
Harkonnen
Ix
Tleilaxu
Fremen
Imperial //same as Sardaukar
Guild
Incidental //these are the story characters
This declarations section includes a list of all the houses and subhouses involved. The Rules.txt file contains other declarations entries, such as [ArmourTypes], [TerrainTypes], [ExplosionTypes], and [UnitTypes]. Many of the entries therein will be refered to later on. Without reference in the correct declarations entry list, an object (or value like armour) cannot exist, even if it has its own entry. Many will also have entries in the ArtIni.txt file, even if they are not mentioned in the rules file. Note that declarations can also have numbered lists, as follows:
[Groups]
0 = InvalidHouse
1 = Atreides
2 = Harkonnen
3 = Ordos
4 = HD
5 = CD1
6 = CD2
7 = CD3
8 = CD4
Declarations can also have other uses.
[LocalDefaults]
Group = HD InvalidHouse
Volume = 80
You can see that this entry in the Commonmusic.txt file sets default values for all entries below it: the default volume (as a percentage of the game settings volume) for all Skirmish music is set to 80, and the music is found on the Hard Disc (as opposed to CD), and does not belong to any house. In each individual entry, this can be changed - for example, Atreides music has that same property with the value Atreides HD.
The final type of declaration is the declaration of the ini files themselves. The game engine refers to most of them, but the ini files also refer to other ini files. An example of this is found in the Music.txt file.
#include "AtreidesMusic.txt"
This tells the game to iclude the entries in the AtreidesMusic.txt file as well as those in the Music.txt file itself.


<|> Nema Fakei

All trademarks acknowledged. Material is not necessarily for public use; any illegal activity is not condoned by the author, even if is implied or supplied by information contained in this site. UK laws apply. The author is not responsible for losses as a result of this website or its contents.  This site may contain information unchecked by the author; again, no responsibility can be accepted for any losses incurred on the use of this site or any sites mentioned here.

Hosted by www.Geocities.ws

1