ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Help:Values

From ModEnc
Revision as of 14:08, 6 March 2007 by Renegade (talk | contribs) (Reverted edits by CnCVK (Talk); changed back to last version by Renegade)
Jump to navigation Jump to search
Incomplete
This page is not complete yet. For example, there are still Locomotors and probably other value types. If you are familiar with this topic, please help us by expanding this page.


When referring to possible values in flag-headers, ModEnc contributors often use programming or mathematic terms to describe the values you can add.

If you are not familiar with these terms, this page should give you an idea about what these different data types stand for and what values TD, RA, TS, RA2 and YR would accept as such.

Signed/Unsigned

For flags expecting numbers, this prefix tells you whether you can use negative values or not - "sign" refers to the minus and imaginary plus in front of numbers. If a value is marked "unsigned", it doesn't accept signs, and therefore you cannot use negative values (as you'd have to apply a sign, minus, to make it negative).

Signed == Positive and negative values
Unsigned == Positive values only

Integers

Theoretically, all natural numbers, their negatives, and zero. According to pd, the actual programming data type used by the games is often signed long integer, with a notable exception being ExtraLight, which only uses integer; the difference is the maximum size of the number they can hold:

Signed long values can be any integer (mathematically) from -2147483648 to 2147483647.
Integer values, the programming data type, can "only" be mathematical integers from −32768 to 32767.

Floating Point Values

Or "floats", for short, are basically real numbers, 3.141592654 (Pi) for instance.
Technically, one would have to differ between floats and doubles (double-precision floating point values), though as INI flags, there is no noticeable difference. Something special about this value type is that - if your value is between 0 and 1/-1 - you can leave out the 0 before the dot.
So RechargeTime=0.01 would result in the same as RechargeTime=.01.

An example for a float INI tag is the RechargeTime tag.

Bytes

In very rare cases, the game (assuming YR) does only accept bytes as a value.
Bytes are comparatively small numbers, which often have values less than 20.
Usually, these bytes are unsigned.

While
unsigned bytes can be any integer (mathematically) from 0 to 255,
signed bytes go from -128 to 127.

An example using this type is the CloakRadiusInCells tag.

Boolean values

A boolean value is a "yes" or "no" value, usually stored as 0 or 1 ("no" or "yes") in a byte.

In the INIs, no matter what some people think, it does not matter whether you type yes, true or 1 - if the value is one of those three, it will be considered "yes", otherwise, it will be considered "no".
So you could just as well go ahead and type e.g. "Capturable=no way!" and it would work just fine.

An example INI flag would be Radar=yes/no.

Strings

Strings are simply put texts. On ModEnc, this data type is often followed by a restriction, like "String (names of animations)". Adhere to these restrictions, or get ready for the consequences.

Colors

Colors are nothing but a list of 3 bytes (see above), seperated by a comma (example: SovietLoad=0,235,255). There are two color formats (in TS, RA2 and YR):

RGB

The most common way to clearly represent a color is in the RGB format.
It consists of 3 bytes which represents the amount of the basic colors in this order: red, green, blue.
The RGB format is used, for instance, on the RadColor tag.

HSB

HSB appears more rarely than RGB.
The 3 bytes represent hue, saturation and brightness.
TS, RA2 and YR have a unique HSB format which does not work the same way as e.g. the HSB format in MS Paint does.
There is no clear algorithm yet that can convert Westwood's HSB format to RGB or vice versa (BobingAbout created a pretty exact one, a conversion tool was available and will be available again soon).
This unique HSB format is used in the [Colors] section.

CLSIDs/Locomotors

Commonly seen as Locomotors, CLSIDs are also used for AI Generals, for example. They are in registry format.

An example would be the ship locomotor, {2BEA74E1-7CCA-11d3-BE14-00104B62A16C}.

POINT3D

Coordinates in leptons(1/256th of a cell).
The 3 signed integers represent X, Y and Z.
An example for a POINT3D INI tag is the ExitCoord tag.