Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Categories

Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Item Properties, how to get the full item property information

MermutMermut 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.

Comments

  • DazDaz Member Posts: 99
    You can use GetItemPropertyCostTableValue() to get enhancement value.
    itemproperty ipEnhance = ItemPropertyEnhancementBonus(5);
    
    PrintInteger(GetItemPropertyCostTableValue(ipEnhance));
    

    dunahan
  • MermutMermut Member Posts: 44
    Ugh.. so I need to cross reference 2 different 2da file to figure out the actual item property and it's quality to find the actual properties of a given item

    *hides trout behind my back as I nonchalantly walk up to the devs for a 'chat'*

  • WilliamDracoWilliamDraco Member Posts: 156
    ...There's three sub-properties.
    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....

  • TerrorbleTerrorble Member Posts: 108
    You may know this all by now, but most of the info I needed for creating an enchanting table only used a few functions. I add this post because just last month I was asking the same thing and the in-game toolset descriptions of these functions aren't overly helpful.


    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

    dunahan
  • MermutMermut Member Posts: 44
    I'm working on a custom ILR system for a PW...
    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.

  • meaglynmeaglyn Member Posts: 97
    It's really not that hard...

  • MermutMermut Member Posts: 44
    meaglyn wrote: »
    It's really not that hard...

    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).

  • KamirynKamiryn Member Posts: 45
    edited May 2020
    Not so long ago I've posted a function that gets an item property's name/description:

    https://forums.beamdog.com/discussion/comment/1117101/#Comment_1117101

    And it's really not that hard... once you know how it works that is :D

    Post edited by Kamiryn on
    dunahan
  • MermutMermut Member Posts: 44
    Kamiryn wrote: »
    Not so long ago I've posted a function that gets an item property's name/description:

    https://forums.beamdog.com/discussion/comment/1117101/#Comment_1117101

    And it's really not that hard... once you know how it works that is :D

    Thanks, I'll take a look.
    And it's true, most things aren't hard, once you know how they work ;)

    dunahan
Sign In or Register to comment.