First off, you cannot use the &itArtificialPlasma; format for UNIDs in the debug console.
That format gives an error;
Code: Select all
(typGetProperty &itArtificialPlasma; 'name)
Line 1: Mismatched open parenthesis
The 'unvEntity' function will convert UNIDs in that format (we'll call them ENTITY UNIDS for reasons explained further down) to decimal UNIDs which can be used in the debug console.
Code: Select all
(unvEntity "itArtificialPlasma")
16629
So to get the name of &itArtificialPlasma; in the debug console we would use one of these two examples;
Code: Select all
(typGetProperty (unvEntity "itArtificialPlasma") 'name)
case of artificial plasma
(typGetProperty 16629 'name)
case of artificial plasma
Easy. But wait, there's more!
There is a third format for UNIDs as well. Hex UNIDs (short for hexadecimal UNIDs).
Hexadecimal can also be known as 'base 16' numbering. (Decimal is 'base 10').
Hex numbers have the format '0x00000000' and use the 'numbers' 0 to 10 and A to F. Yes, that's right, in hex numbering A, B, C, D, E and F are numbers. Search for an explanation on the web if you are not sure how this works.
There are two methods to find the hex UNID.
If you search the 'Transcendence_Source' folder for itArtificialPlasma you will find it in HumanSpaceVol1.xml.
The code is:
Code: Select all
<!ENTITY itArtificialPlasma "0x0000405F">
The ENTITY UNID is itArtificialPlasma and the hex UNID equivalent is 0x0000405F.
Or you can use a function called 'mathDecToHex' (supplied by NMS and so useful that it is now included in the game code).
Code: Select all
(mathDecToHex 16629)
0x405F
(typGetProperty 0x405F 'name)
case of artificial plasma
So we have three different ways of saying the same thing.
ENTITY UNID - &itArtificialPlasma;
Decimal UNID - 16629
Hex UNID - 0x0000405F
You can use any of these formats when writing code and the computer will happily accept them. (it's only in the debug console that the ENTITY UNID won't work).
But why so many options?
Because we are humans, not machines. Computers love using base 16 and can run with only the hex UNID format.
But as humans we are used to reading names and using decimal numbers. So the other two formats are included for our convenience. 'itArtificialPlasma' is a lot easier to understand and remember than 0x0000405F.