Skip to content

How do I add a feat that has no IP_CONST_FEAT_*

TerrorbleTerrorble Member Posts: 169
edited September 2021 in Builders - Scripting
So I want to add Player Tool 3. I do this. I can access it from the radial menu - it works.
        object oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipPTOOL3 = ItemPropertyBonusFeat(IP_CONST_FEAT_PLAYER_TOOL_03);
        IPSafeAddItemProperty(oSkin,ipPTOOL3,0.0f,X2_IP_ADDPROP_POLICY_IGNORE_EXISTING,FALSE,FALSE);

But I now want to add the Purple Dragon Knight feat Oath of Wrath, but it has no IP_CONST_FEAT_.

So I open iprp_feats.2da and add this entry:
Row Name Label Cost Feat Index
83 111720 FEAT_PDK_WRATH 1 1083

Save it, add it to my hak.

Doing this allows me to choose Oath of Wrath as a Bonus Feat to add within the toolset item editor. Of course, it doesn't provide an IP_CONST_FEAT_WRATH to use in ItemPropertyBonusFeat().

So I do ItemPropertyBonusFeat(83) - refer to the line in iprp_feats.2da since I think that's what those constants refer to anyway.

But that didn't add the feat to the skin.

Guidance, please. Thanks


P.S.
If I make an armor and add Oath of Wrath to it in the toolset and equip it in-game, the feat shows up on my character sheet but not in the radial menus where I can use it.

*********************EDIT***********************

I've found a workaround that adds the feats via CLS_FEAT_FIGHT.2da

To the bottom of that I add:
359 FEAT_PDK_WRATH 1083 3 2 1
360 FEAT_PDK_INSPIRE_1 1085 3 2 1

(I'm not sure if it matters, but in feat.2da I set ALLCLASSESCANUSE to 1 for both of these feats.)

It gives the feats to the fighter at level 2 for free and they show in the radial menus!

The downside is, I have fighters choose a path (Duelist, Mage Knight, Soldier) at level 2 and the Duelist uses the Oath of Wrath feat and the Soldier uses the Inspire feat. So regardless of which path you choose both feats are in your radial menu. It's ugly, but I scripted x3_s2_pdk_inspir/wrath to send a message to the player if they can't use the feat.

I'm still hoping to figure out how to add the feats as item properties to the skin via scripting.
Post edited by Terrorble on

Comments

  • KamirynKamiryn Member Posts: 74
    Last row in my iprp_feats.2da is 62. To add FEAT_PDK_WRATH I would add a line

    63 111720 FEAT_PDK_WRATH 1 1083

    IP_CONST_FEAT_* are not required. You can always replace the constant with the row number (that's what the script compiler will do anyway).
  • TerrorbleTerrorble Member Posts: 169
    Thanks, Kamiryn.

    Confirming that this is the right approach caused me to try adding the feat in a new mod using my hak - which does add it to the skin and the feat shows on the character sheet. (I'll figure out what my mod is doing to the skin/its properties later.) But there's no option to use the feat in any of the radial menus.

    What controls what radial menu something shows up in?
  • KamirynKamiryn Member Posts: 74
    edited September 2021
    I think for feats to show up on the radial menu for a PC they need an entry in the cls_feat_xyz.2da for at least one of the PC's classes. See the PLAYER_TOOL_XY feats as an example, they appear in all the base classes cls_feat_xyz.2da files. There's a 99 in column 'GrantedOnLevel' so the feats aren't given automatically.
  • ProlericProleric Member Posts: 1,282
    If ALLCLASSESCANUSE is set to 1 in feat.2da, it's not necessary to change the cls_feat*.2da files.

    The Player Tools are a good example of feats that shows up in the Class Feats radial menu, as noted by the OP. If you use one of those lines of feat.2da as a template for the new feat, changing only those fields which need to change, it should work.
  • TerrorbleTerrorble Member Posts: 169
    Kamiryn wrote: »
    I think for feats to show up on the radial menu for a PC they need an entry in the cls_feat_xyz.2da for at least one of the PC's classes. See the PLAYER_TOOL_XY feats as an example, they appear in all the base classes cls_feat_xyz.2da files. There's a 99 in column 'GrantedOnLevel' so the feats aren't given automatically.

    This works. I allowed my module OnEnter to add Oath of Wrath and Inspire Courage to all PCs no matter their classes. It adds to them all, but the only ones who have the feats available in the radial menu are those with fighter levels (and PDK levels I'm sure but I didn't test any of those). It does appear that feats need to be in cls_feat_xyz to be useable in the radial menu.

    Thank you both.
  • ProlericProleric Member Posts: 1,282
    My bad - I overlooked the fact that the player tools are already in the cls_feat*.2da files. Bioware must have done that in 1.69.
  • GenisysGenisys Member Posts: 37
    edited September 2021
    It's a lot tons of work to add the missing feats....

    I did this a long time ago, but I don't remember where I put the work.. :/
Sign In or Register to comment.