Building Item Property Descriptions from 2das/Talk table?
dimecoin
Member Posts: 15
See screen shot (highlighted yellow): https://i.imgur.com/Rsu2kXN.png
I'm trying to build those strings for the ItemProperties from 2da/tlk.
I found the GameStrRef in itempropdef.2da which gives me the Base Property names, but having troubles finding and referencing the SubTypeProperties descriptions.
For example the GameStrRef has "Armor Bonus vs:", but don't know where to find the "Piercing" and "+1 (AC Armor modification)" string references (I have the int values of both parameters).
I'm trying to build those strings for the ItemProperties from 2da/tlk.
I found the GameStrRef in itempropdef.2da which gives me the Base Property names, but having troubles finding and referencing the SubTypeProperties descriptions.
For example the GameStrRef has "Armor Bonus vs:", but don't know where to find the "Piercing" and "+1 (AC Armor modification)" string references (I have the int values of both parameters).
0
Comments
The first part you've featured out for yourself already.
For the second part look at column 'SubTypeResRef'. If the item property has a subtype that column holds the name of a 2da file. Look at that file and in Column 'Name' you'll find the 2nd part of the name. Row number is of course the subtype.
Third and fourth part are slightly more difficult to get:
The third parameter a item property can have is Param1Value. If you look at 'itempropdef.2da' you'll see a column 'Param1ResRef'. Usually this column is empty as most item properties don't have that parameter. If it's not empty it holds a number. Now look at the 'iprp_paramtable.2da'. That 2da-file has a column 'TableResRef' which holds the name of another 2da-file. Row number is the number from 'itempropdef.2da' (well actually it's not always that number because there are item properties where that number depends on the subtype (and then the subtype 2da-file has a column 'Param1ResRef') so it would be best to use GetItemPropertyParam1() to get the number - unfortunately however GetItemPropertyParam1() does not work for dynamically created item properties). Now look at that 2da-file (the one you've found in 'iprp_paramtable.2da'). That file has a column 'Name' and this column holds the strref for the third part. Row number is Param1Value (you can get that using GetItemPropertyParam1Value()).
For the fourth part look at 'itempropdef.2da' again. It also has a column 'CostTableResRef'. If the item property has costtablevalue that column holds a number >0. Now look at 'iprp_costtable.2da'. Using the number from 'itempropdef.2da' you can get the fourth 2da-file in column 'Name'. Looking at that 2da-file you'll find the fourth strref in column 'Name', row number is the costTableValue (GetItemPropertyCostTableValue()).
[edit]Just realized that third and fourth part are mixed up: costtable is supposed to be third and param1 is fourth.[/edit]
And that's all
Fwiw, dimecoin, I wrote a little tool to "de/compile" tlk files to text so I could store them in git. I suspect it only works on Linux although it might be able to be tweaked to build on windows. You can find it here and on github.
These are all the vanilla IPs:
https://gist.github.com/mtijanic/54a85e2e455b90e7b3a0f8d23823dcab
And here is the code used to generate it:
https://gist.github.com/mtijanic/153271e463918c52a252893a623bbfdc
(requires Liareth's nwn tools: https://github.com/Liareth/NWNFileFormats )