How do I determine what tier a material is from this:
int nCurrentMaterial = GetItemMaterialType (oItem);
There are 7 tiers so I want to get a number between 1 and 7.
Also, with the DLC, how does star metal figure into the tier sequence (is it 8?)?
Determining item material type tier
Débuté par
Talonforge
, févr. 09 2010 06:59
#1
Posté 09 février 2010 - 06:59
#2
Posté 09 février 2010 - 07:07
The materialstypes.xls shows an ID column int (0 to 21) and NameStrRef (370973 to 370992). Does the above function return one of those values? and if so which one?
#3
Posté 09 février 2010 - 07:59
The ID returned by GetItemMaterialType() are not related to materialtypes.xls first sheet (materialrules) but to the second sheet : materialtypes. Which means that, unless you're into acrobatics, there's no direct relation between the ID returned and the tier because the 2DA table isn't sorted by tiers and the ID aren't necessarily consecutive. For example, here are my constants for the metal armor ID :
const int PHAE_MAKE_IRON_ARMOR = 1;
const int PHAE_MAKE_GREYIRON_ARMOR = 2;
const int PHAE_MAKE_STEEL_ARMOR = 8;
const int PHAE_MAKE_VERIDIUM_ARMOR = 4;
const int PHAE_MAKE_REDSTEEL_ARMOR = 5;
const int PHAE_MAKE_SILVERITE_ARMOR = 3;
const int PHAE_MAKE_DRAGONBONE_ARMOR = 6;
Note the steel at ID 8 for instance.
The same goes for pretty much every materialtype in the sheet. So if you want to link material type ID to the actual tier, you can query the Material column in the materialtypes sheet and use that value. (with -7 for woods and -14 for leather)
As in :
int iMakeID = GetItemMaterialType(oItem); // assuming oItem is a bow hence of wood
int iTier = GetM2DAInt(TABLE_MATERIAL_TYPES, "Material", iMakeID) -7;
PrintToLog(GetName(oItem)+" tier : "+IntToString(iTier));
const int PHAE_MAKE_IRON_ARMOR = 1;
const int PHAE_MAKE_GREYIRON_ARMOR = 2;
const int PHAE_MAKE_STEEL_ARMOR = 8;
const int PHAE_MAKE_VERIDIUM_ARMOR = 4;
const int PHAE_MAKE_REDSTEEL_ARMOR = 5;
const int PHAE_MAKE_SILVERITE_ARMOR = 3;
const int PHAE_MAKE_DRAGONBONE_ARMOR = 6;
Note the steel at ID 8 for instance.
The same goes for pretty much every materialtype in the sheet. So if you want to link material type ID to the actual tier, you can query the Material column in the materialtypes sheet and use that value. (with -7 for woods and -14 for leather)
As in :
int iMakeID = GetItemMaterialType(oItem); // assuming oItem is a bow hence of wood
int iTier = GetM2DAInt(TABLE_MATERIAL_TYPES, "Material", iMakeID) -7;
PrintToLog(GetName(oItem)+" tier : "+IntToString(iTier));
Modifié par Phaenan, 09 février 2010 - 07:59 .
#4
Posté 09 février 2010 - 08:20
Ahh I see how that works now.
Thanks Phaenan!
Thanks Phaenan!





Retour en haut






