Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

help with string IDs

The general place to discuss MOD''ing Freelancer!

Post Wed Mar 12, 2003 5:20 am

help with string IDs

I was bored and wanted to figure out where the best places to buy shields are, so I checked some stuff in the market files and got a list of bases of where to buy them. I then went through the string IDs for those bases in universe.ini to figure out where they are. It was going fine untiil (I'm using the instructions posted in this forum for getting strings from ID #'s...transfer to hex, first digit = DLL, next 3 + 1 = table #, last digit + 1 = index)

hi01_01_base: 196835 = 300E3 -> 3 00F 4 = nameresources.dll table 15 string 4 = planet crete
hi02_01_base: 196838 = 300E6 -> 3 00F 7 = nameresources.dll table 15 string 7 = liberty navy
hi02_02_base: 196839 = 300E7 -> 3 00F 8 = nameresources.dll table 15 string 8 = liberty security force
hi01: 196653 = 3002D -> 3 003 E = nameresources.dll table 3 string 14 = omicron alpha
hi02: 196654 = 3002E -> 3 003 F = nameresources.dll table 3 string 15 = omicron gamma

Last I checked, "Liberty Navy" and "Liberty Security Force" aren't planets, and Planet Crete (hi01_01 according to those strings) along with Tripoli Shipyard (one of the two unknowns) is in Omicron Gamma (hi02), not Omicron Alpha (hi01). With all these contradictions This is kinda confusing...I know one of the two unknowns is Tripoli Shipyard in Omicron Gamma, I'm too lazy to find the other one, but I'm not sure if I'm incorrectly using the method for converting string IDs or what. I'm not desperate to find these locations or anything, I'd just like to know how the game works in this respect and this isn't making sense. Any ideas?

Post Wed Mar 12, 2003 5:29 am

Check out this thread for list of bases.

http://www.lancersreactor.com/t/forum/t ... er&M=False

hope that is what your looking for

Post Wed Mar 12, 2003 5:41 am

Alright, so from that thread, I get

hi01_01_base = Planet Malta

hi02_01_base = Planet Crete
hi02_02_base = Tripoli Shipyard

which makes way more sense than Crete/Liberty Navy/Liberty Security force for those 3. I still don't know why I came up with the wrong string names using the method in my first post above, so if anyone can help me w/ that I'd appreciate it, thanks.

Post Wed Mar 12, 2003 5:47 am

Heh, nevermind, I'm an idiot, I figured it out. If anyone else has this problem...that specific string table in question only has 8 strings instead of 16 in it, and the indexes are distributed throughout that table's group ('that table' being table 15 in nameresources.dll) of 16 - i.e. instead of there being 16 strings from 224 to 239, there are only strings at index 224, 225, 227, 230, 231, 234, 238, and 239. When I was looking at them in reshacker, I was like "hmm, 8th string, let's look 8 strings down..." to the one at index 239, which is actually the 16th string in the table. Silly me. Even though it's only the 5th actual string in the table, the 8th index would be 223 + 8 = 231, which is Tripoli Shipyard which is what I should have gotten.

Post Wed Mar 12, 2003 8:37 am

Unfortunately, this doesn't help the ones I have trouble with:

Br01_hazard_buoy_1
ids_name = 261163 (0x3fc2b)
Translates to: 3, 4035, 11

But 4035 is:

STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
64550, "Docking Ring"
64551, "Asteroid Miner"
64552, "Gas Miner"
64553, "Storage Depot"
64554, "Navigation Buoy"
64555, "Hazard Buoy"
64556, "Weapons Platform"
64557, "Communications Satellite"
64558, "Mooring Fixture"
}

... so there is no #11.

Back to my manual fixup table. *sigh*

Post Wed Mar 12, 2003 11:54 am

Actually it does help with your problem. First of all, 261163 translates to index 12 in the table, not 11 (unless you start counting w/ 0)...but, anyway, that's not what's important. The last entry in table 4034 (which has a full 16 strings) is string # 64543, so the first one in table 4035 should be 64544. It's not that there is no #10, #11, #12, #13, etc...it's that there's no #1, #2, #3, #4, #5, or #6. The "first" string in that table (64550) is really the 7th entry (6th index counting from 0), which would put the string you're looking for as the sixth actually listed string in that table, 64555 ("Hazard Buoy", which naturally fits in Br01_hazard_buoy_1.

What are you doing w/ hazard buoys anyway? Heh

Post Wed Mar 12, 2003 1:54 pm

Ugh, my worst nightmare come true. I didn't even want to consider the case where the contents of one resource depended on the previous. It'd be easier if they just hashed the stupid thing by the numbers inside. Maybe I can get a formula or something to make it more accurate without poking around in two files for every lookup. (EDIT: See below.)


What are you doing w/ hazard buoys anyway? Heh


I've written a Perl script to parse the INI files in systems. It's building a big hash of the entries for the universe with their names. Once I have that, I can generate trade-lane names. After that, I can make a down-to-the-meter path to find the best $/m trade-route based on route positions. And, of course, automatic list of where equipment is sold. The advantage here being that it can be run on a modded game and still be accurate, so people can get an overview of their changes.


EDIT:
Apparently there is a formula. For example, the Hazard Buoy was "4035, 11". The entry is '64555, "Hazard Buoy"'. It happens to be that (4035 - 1) * 16 + 11 = 64555

Likewise, your wrong examples were:

hi01_01_base: 196835 = 300E3 -> 3 00F 4 = nameresources.dll table 15 string 4 = planet crete
So (15 - 1) * 16 + 3 = 227. By looking in resource 15, there is '227, "Planet Malta"'.

hi01: 196653 = 3002D -> 3 003 E = nameresources.dll table 3 string 14 = omicron alpha
Has (3 - 1) * 16 + 13 = 45. And in resource 3, '45, "Omicron Alpha"'

No incrementing of the last digit in this method.

Edited by - George on 12-03-2003 14:38:31

Post Wed Mar 12, 2003 6:30 pm

george...what file are you getting that stringtable from?

Post Wed Mar 12, 2003 7:23 pm

I used Resource Tuner and exported every DLL to text files so my script could parse them. The files end up looking like: "project/dll_name/resource_type/resource_number.ext" where ".ext" is 'rc' for strings (STRING) and 'res' for html (HTML).

Post Wed Mar 12, 2003 8:50 pm

I figured it out!! ok here's the formula:

id # to hex gives you 5 digits.
hex 1 = .dll location
hex 234 = (convert to dec), lets call this number A
hex 5 = (convert to dec), lets call this number B

A+1 = table number
id # = 16A+B

examples
-----------
Beryllium = 261609 = 3FDE9 = 3, 4062, 9
Table #= 4062 + 1 = 4063
ID # = 16 (4062) + 9 = 65001

Hazard Buoy = 261163 = 3FC2B = 3, 4034, 11
Table #= 4034 + 1 = 4035
ID # = 16 (4034) + 11 = 64555

Li01_01_base = 196766 = 3009E = 3, 9, 14
Table #= 9 + 1 = 10
ID # = 16 (9) + 14 = 158
= Planet Manhattan

Hi01_01_base = 196835 = 300E3 = 3, 14, 3
Table #= 14 + 1 = 15
ID# = 16 (14) + 3 = 227
= Planet Malta

YAY! make sense? George yours is 4034, not 4035.

Post Wed Mar 12, 2003 9:07 pm

we know that 3 = nameresources.dll, what do the others point to?

thanks



Edited by - unseth on 12-03-2003 21:30:01

Post Wed Mar 12, 2003 10:52 pm

If you look in the Freelancer.ini file you will see the resource dll's being referenced. In this list the nameresources.dll is the third in the list is this just chance?

Post Wed Mar 12, 2003 11:19 pm

actually you might be on to something. I was hacking around some descriptions and found the values in infocards.dll.

So far I know these for a fact:

1= infocards.dll
3 = nameresources.dll

and they both fit in with that. So perhaps

1= infocards.dll (verified)
2 = misctext.dll
3 = nameresources.dll (verified)
4 = equipresources.dll
5 = offerbriberesources.dll
6 = misctextinfo2.dll

i'll have to check to see if the others match up as well.

Post Wed Mar 12, 2003 11:30 pm



id # to hex gives you 5 digits.
hex 1 = .dll location
hex 234 = (convert to dec), lets call this number A
hex 5 = (convert to dec), lets call this number B

A+1 = table number
id # = 16A+B



Looks good. It matches what I posted right above except I had to subtract the 1 back out of A in the id# formula because I kept the incremented A from checking the table number.

As far as the DLL location reference numbers, those were already confirmed in the original thread that spawned the hex conversion. It's been lost in the traffic on the board. And since I've run a script over every .ini file in systems/, I'm fairly confident in the DLL order.

Post Thu Mar 13, 2003 1:11 am

i started to program a c/c++ tool that reads the values from the uncompressed shiparch.ini and reads the shipname and the infotext (well if i could get past the damn unicode *sick*) from the dlls. its just an example how to do it in c/c++. its not of great use, but if you want take a look:

http://dev.grossangriff.de/viewtopic.php?p=45

Edited by - __kreischweide on 13-03-2003 01:13:36

Return to Freelancer General Editing Forum