Item Properties, how to get the full item property information
Mermut
Member Posts: 44
GetItemPropertyType only gets 'some' of the item property information
For example, it will tell you if a sword has ITEM_PROPERTY_ENHANCEMENT_BONUS
How do I tell if it is +1, +2, +5, etc via scripting?
Neither GetItemPropertyParam1 nor GetItemPropertyParam1Value provide any useful information in this case.
Note: I do not want 'just' enhancement value, I'm only using it as an example. I want to be able to get the 'quality' of any item property via scripting.
For example, it will tell you if a sword has ITEM_PROPERTY_ENHANCEMENT_BONUS
How do I tell if it is +1, +2, +5, etc via scripting?
Neither GetItemPropertyParam1 nor GetItemPropertyParam1Value provide any useful information in this case.
Note: I do not want 'just' enhancement value, I'm only using it as an example. I want to be able to get the 'quality' of any item property via scripting.
0
Comments
*hides trout behind my back as I nonchalantly walk up to the devs for a 'chat'*
SubType, CostValue, Param1 are all possible sub-properties of any particular itemproperty Type.
Which sub-property contains which information is best left up to the lexicon. Use the link for your property within the table here and the description should specify which sub-properties are applicable.
You can actually also tell by looking at itempropdef.2da, which might list either
SubTypeResRef: the name of the 2da full of subtypes
CostTableResRef: The row number in iprp_costtable.2da which lists which the name of the .2da for cost values
Param1ResRef: which lists the row number in iprp_paramtable.2da which lists the name of the .2da for param1 values..... except when it doesn't because it's only sometimes used, mainly in OnHit effects.
... So if you were thinking it was unclear before....
I wanted to know the if an existing itemproperty was an ability bonus
GetItemPropertyType() == ITEM_PROPERTY_ABILITY_BONUS
Which ability is it?
GetItemPropertySubType() == 2 (2 is constitution according to iprp_abilities.2da)
This also tells me things like which damage type a weapon had or which damage type an immunity was to.
How big is the CON bonus?
GetItemPropertyCostTableValue() == 3 (the bonus is +3 according to iprp_bonuscost.2da... though this one was obvious without referencing the table)
I also used this to know:
how much damage of a type was being done/how much damage immunity was on armor/how much regen/massive crits/etc
So I need to create a system that can take an item and determine which property at what power level to figure where each item 'fits'.
It looks like I'm going to have to start by making a big reference table and go from there.
Odd that it is SOOO convolted to figure out exactly what an item 'has' on it via scripting.
If it's that easy, please give me an example..
I'm looking to make a function or set of functions that can take in any item and, to start at least, put out a human readable list of exact properties of the item(s).
https://forums.beamdog.com/discussion/comment/1117101/#Comment_1117101
And it's really not that hard... once you know how it works that is
Thanks, I'll take a look.
And it's true, most things aren't hard, once you know how they work