Help:Values: Difference between revisions
m Value types moved to Help:Values: This one's way more detailed and just needs to push to the "help" direction |
After the move earlier, now the re-write/unification --> POINT3D needs information about the measurement scale used. |
||
Line 1: | Line 1: | ||
{{BigHorizontalBar|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. | |||
==[http://en.wikipedia.org/wiki/Signedness Signed/Unsigned]== | |||
{{tocright}} | |||
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<br> | |||
Unsigned == Positive values only | |||
==[http://en.wikipedia.org/wiki/Integer Integers]== | |||
Theoretically, all natural numbers, their negatives, and zero. According to pd, the actual programming data type used by the games is often [http://en.wikipedia.org/wiki/Long_integer signed long integer], with a notable exception being [[ExtraLight]], which only uses [http://en.wikipedia.org/wiki/Integer_%28computer_science%29 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'''.<br> | |||
'''Integer''' values, the programming data type, can "only" be mathematical integers from '''−32768''' to '''32767'''. | |||
==[http://en.wikipedia.org/wiki/Floating_point Floating Point Values]== | |||
Or "floats", for short, are basically '''[http://en.wikipedia.org/wiki/Real_number real numbers]''', 3.141592654 (Pi) for instance.<br> | |||
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.<br> | |||
So RechargeTime=0.01 would result in the same as RechargeTime=.01. | |||
==Bytes== | An example for a float INI tag is the [[RechargeTime]] tag. | ||
==[http://en.wikipedia.org/wiki/Byte Bytes]== | |||
In very rare cases, the game (assuming [[YR]]) does only accept bytes as a value.<br> | In very rare cases, the game (assuming [[YR]]) does only accept bytes as a value.<br> | ||
Bytes are comparatively small numbers, which often have values less than 20.<br> | |||
Bytes are | |||
Usually, these bytes are unsigned. | Usually, these bytes are unsigned. | ||
Line 27: | Line 35: | ||
'''signed''' bytes go from '''-128 to 127'''. | '''signed''' bytes go from '''-128 to 127'''. | ||
An example using this type is the [[CloakRadiusInCells]] tag. | |||
==[http://en.wikipedia.org/wiki/Truth_value 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"'''.<br> | ||
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. | |||
An example | |||
==[http://en.wikipedia.org/wiki/String_%28computer_science%29 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. | |||
== | ==[http://en.wikipedia.org/wiki/LSD#Sensory.2Fperception Colors]== | ||
Colors are nothing but a list of 3 bytes (see above), seperated by a comma (example: [[SovietLoad]]=0,235,255). | 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]]): | There are two color formats (in [[TS]], [[RA2]] and [[YR]]): | ||
===RGB=== | ===[http://en.wikipedia.org/wiki/RGB RGB]=== | ||
The most common way to clearly represent a color is in the RGB format.<br> | The most common way to clearly represent a color is in the RGB format.<br> | ||
It consists of 3 bytes which represents the amount of the basic colors in this order: '''red''', '''green''', '''blue'''.<br> | It consists of 3 bytes which represents the amount of the basic colors in this order: '''red''', '''green''', '''blue'''.<br> | ||
The RGB format is used, for instance, on the [[RadColor]] tag. | The RGB format is used, for instance, on the [[RadColor]] tag. | ||
===HSB=== | ===[http://en.wikipedia.org/wiki/HSV_color_space HSB]=== | ||
HSB appears more rarely than RGB.<br> | HSB appears more rarely than RGB.<br> | ||
The 3 bytes represent '''hue''', '''saturation''' and '''brightness'''.<br> | The 3 bytes represent '''hue''', '''saturation''' and '''brightness'''.<br> | ||
Line 81: | Line 64: | ||
This unique HSB format is used in the [<tt>[[Colors]]</tt>] section. | This unique HSB format is used in the [<tt>[[Colors]]</tt>] section. | ||
==CLSID== | ==[http://en.wikipedia.org/wiki/CLSID CLSIDs/Locomotors]== | ||
Commonly seen as [[Locomotor]]s, 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== | ==POINT3D== | ||
Line 90: | Line 73: | ||
The 3 bytes represent '''X''', '''Y''' and '''Z'''.<br> | The 3 bytes represent '''X''', '''Y''' and '''Z'''.<br> | ||
An example for a POINT3D INI tag is the [[ExitCoord]] tag. | An example for a POINT3D INI tag is the [[ExitCoord]] tag. | ||
[[Category:INI Flags]] | [[Category:INI Flags]] | ||
[[Category:General Editing Information]] |
Revision as of 19:05, 15 August 2006
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.
The 3 bytes represent X, Y and Z.
An example for a POINT3D INI tag is the ExitCoord tag.