Infocard numbers
-
I’ve noticed while trying to set up new infocards that the game looks for certain numbers in certain DLLs, in order of how they’re loaded. I’m wondering what the system there is. How many numbers are available per DLL, and what number ranges correspond to each one.
I want to do all new entries for everything (names, infocards, rumors, et cetera) instead of overwriting vanilla entries where possible, but it’s hard to plan out a logical system for numbering if I don’t even know how the game determines what goes where.
Any help would be very much appreciated.
-
Infocards and names are standard Windows resources. Infocards use the HTML resource (23 in the old Resource Hacker) and names use the String Table. This allows 65536 (i.e. 16 bits) of each type. However, sometimes HTML has precedence over string, so it’s best to use separate numbers. The number of the DLL in Freelancer.ini’s [Resources] section (with 0 being resources.dll) is multiplied by 65536 (i.e. shifted 16 bits to the left) and combined with the resource entry number to form the number found in the ini files. For example, Planet Manhattan is 196766 - convert to hex and it’s 0x3009e, so now you can see it’s the third entry in [Resources] and resource number 0x9e = 158. This can be done with ResID:
C:\contrib\games\Freelancer>resid -f 196766 NameResources#158 (S): Planet Manhattan
-
Adoxa, that’s very helpful. Thank you.
-
Bear in mind that there’s some “special” ids names to handle, too. Specifically, look at how the faction ids names are handled, as well as zone names (for nebulae and asteroid fields). If they’re not in the right place with the right naming patterns, they won’t show up in certain circumstances, such as mission descriptions.
I’m sure I’m forgetting a few other special cases.