Feats

From NWN1 Custom Content Guide

Jump to: navigation, search

Contents

[edit] Overview

In order to go about gracing the community with our own customized feats, we must first understand how they differ from the 3E feats and how the entire system works.

[edit] The NWN Feats System

In NWN, feats are more than just the vague abilities that are selectable in paper and pen (PnP).

Feats in NWN constitute an entire system that interact with and affect all other subsystems in the engine: races, classes, spells, items, creatures.. They have the most robust and configurable system of prerequisites and other settings of all the customizable subsystems within the game.

What's the significance of all that? Since examples speak louder than lectures, picture this: (train of thought derailed.. put something here)

Feats are all indexed within feat.2da which, along with spells.2da, is one of the largest 2DA files containing the most number of settings. Every feat has an entry under a featID.

[edit] Categories

Many D&D features are implemented in NWN as feats.

  • Feats (of course..)
  • Class-specific Abilities
  • Racial Abilities

Behaviorally, feats can be classified in several different types as well:

  • Activated Feats
  • Automatic Feats
  • Passive Feats
  • Placeholder Feats

[edit] Activated Feats

These feats represent any sort of useable abilities which are many of them, as well as all racial, special, and class-specific abilities. In terms of implementation, they not only require a feat entry, but a corresponding spells.2da entry, and a "spell" script which executes performing whatever it is the feat does. You can find out how to add activated Radial Feats here.

[edit] Automatic Feats

These feats represent abilities or traits that alter their behavior depending on circumstances but are not actively selectable or at all controllable by the player's user. (So far as we know, these are _hardcoded_.)

Why? Unlike activated feats, these have no clear method of attaching an nwscript to execute and alter behavior.

[edit] Passive Feats

These are generally traits and attributes that are always and constantly on. A halfling's bonus to saves, weapon focus/specialization bonuses, and so on are always on.

(Of all the _hardcoded_ candidates, these seem to be the MOST hardcoded.)

Why? These seem to be implemented in the combat engine. Implementing our own in such a manner would require getting our hands on the cold, hard source code. And since we're not BioWare, alas...

Edited 11/14/04 by Swiftbow: Though it is does seem to be impossible to hardcode weapon focus and specialization with feats alone, it IS possible to mimic these abilities with placeholder feats and clever scripting using OnItemEquip and OnItemUnEquip. This method uses permanent supernatural local variables attached to the weapon's holder whenever he equips the item. I have successfully tested this system with custom items in my own mod. (We may continue to say, alas, though, because there does not seem to be a scripting method to adjust critical hit range through a placeholder improved critical feat. Curse it all!)

[edit] Placeholder Feats

These are feats that are literally nothing more than prerequisites and their entries. They have no scripts attached nor combat engine alterations attached to them. Examples of these are weapon and armor proficiency feats.

Essentially, whatever the "magic" of the feat is and wherever it is implemented, it is not tangibly tied to the feat entry itself other than simply referring to the featID.

The weapon and armor proficiencies are "implemented" as requirements in baseitems.2da. In order to use the kukri baseitem, you need to have the Exotic Weapon Proficiency feat. To a limited extent, custom proficiency feats can be made by simply creating the feat entries as placeholders and setting their FeatIDs as prerequisites in baseitems.2da.

Why do we bother attempting to categorize these any further if they are all hardcoded? Because they may *not* really be hardcoded. Perhaps their implementation is simply escaping our attention due to our assumptions or because we simply look in all the wrong places. Perhaps there in the ultimate observance of these different types of feats, there are no such things as Passive or Automatic feats and they are also just empty placeholders where the feat "magic" is implemented somewhere we simply never looked. Likely a long shot, but never stop looking....

[edit] Acquiring the Feat

More than just choosing to take the feat, what the feat is for and how it is acquired will dictate whether other 2DA files must be edited to fully implement the feat and make it available to wherever it is needed.

In addition, making a feat as a possible Bonus Feat item property would require adding it to the iprp_feats.2da file.

[edit] How to script a Feat

Essentially, any feat that's not an activated feat needs to be ingeniously scripted. There is no 'trigger' or 'impact' script, as with spells. You simply need to check for all conditions in your module where the feat would come into play.

Say, you've added a feat called "Wealthy" to feat.2da. This feat will give the player some extra gold when they level up, 'cause we're just that nice in this module! It's row 2001, which is it's id. We've also put it's 'Constant' value in the 2DA file as FEAT_WEALTHY. Just because you've set a constant value in the 2DA file doesn't allow you to reference the feat in scripts as FEAT_WEALTHY. You need to make a nice include script with something like this:

const int FEAT_WEALTHY = 2001;

Now, when you #include that script, you can simply use GetHasFeat(FEAT_WEALTHY) instead of GetHasFeat(2001). Makes the scripts so much prettier, don't it?

Now, we know we want the feat to come into play when the player levels up, so we edit our OnLevelUp() script in our module, and add something like the following:

#include "my_feats"
...
if (GetHasFeat(FEAT_WEALTHY, GetPCLevellingUp()))
{
    GiveGoldToCreature(GetPCLevellingUp(), 250 * GetHitDice(GetPCLevellingUp()));
}

That's it! We've just created our own feat that actually works! Woohoo!

Of course, there are many more ways of making custom feats through scripting, some far more sophisticated than this. Experimenting is the best tool. Scripting is your friend.

[edit] Radial Feats

See Feats: Radial Feats


Main_Page | Feats

Personal tools