Player Resource Consortium


Author Topic: Quick and Dirty Weapons of Legacy Guide  (Read 1813 times)

0 Members and 1 Guest are viewing this topic.

April 12, 2022, 10:29:33 AM

To add a Weapon of Legacy to the PRC, you'll need several things:
  • A compiling PRC and PRC SVN repository. There's already guides out there on this, so I'll assume you have it.
  • A competent text editor. I use Textpad. This will edit all files mentioned.
  • 2das: wol_items, feat, spell, iprp_feat, cls_feat_allBaseClasses (look in DevNotes)
  • scripts: wol_m, wol_t, wol_sla in scripts
  • includes: prc_template_con in includes
  • prc_consortium.tlk.xml
  • UTI: the actual in-game item

Note this will be a high level guide going over the basic work path. It assumes functioning knowledge of the PRC and NWN Scripting

For me, step one is always the wol_items.2da. Copy an existing item, add yours to the bottom, and fill out the lines (leave the TLK numbers blank for now). Resref is the resref of the item (the .UTI file). Slot is the inventory slot that the item will equip to. Area and Waypoint can be ignored. Cost and Least/Lesser/Greater are all given in the sourcebook, it's just copying those numbers over.

Next is wol_t_itemname.nss, first of the scripts. Note that everything here is what would cause the script to fail. So a minimum base attack bonus of +3 or greater is written as

Code: [Select]
    if(3 > GetBaseAttackBonus(oPC))
After this I do wol_m_itemname.nss. This is the script that does the heavy lifting. Note that all WoL use standard formats, so look around until you find an existing wol_m script that matches (or almost matches, sometimes a few things need to be moved a level), and use that as a template to build from. In general, poke around the other wol_m scripts to see how all the various features are added.

The final script is wol_sla_itemname.nss. This controls all the activated abilities for a particular WoL. Again, always start by copying from an existing wol_sla. If it's just casting a spell, follow existing formats. For unique abilities, there's plenty of examples to follow from as well.

This is a good time to do the item. Make the item in the toolset, making sure the resref is set to what is in wol_items.2da and the tag is the tag in wol_m and wol_sla. We just want to the raw .uti file, which can be snagged via the Temp0 method with the toolset open.

On to the TLK - At this point the coder should know how many entries they need for the TLK. They always need WoL name & description, and then feat name + description for each activated ability defined in wol_sla. At this point, feel free to update wol_items.2da with the WoL name and description.

Feat is next. As always, copy from existing feat entries, making sure to update names & descriptions with the new TLK entries, and grabbing the appropriate icon. Also adjust whether the feat targetselfs, and the UseAction column on the end. Casting spells and free actions do not use an action, everything else does, in general.

Spells follows, again copying from existing spell and ability entries. Update the TLK with the name (same the associated feat), spells don't need descriptions for WoL.

At this point, make sure to link spells.2da and feat.2da using the spellid column (feat.2da) and the featid column (spells.2da).

Copy all the feats into iprp_feat.2da at the bottom of the WoL section.

At this point, open prc_template_con in the includes and fill out all the necessary constants. These should be drawn from the names put into wol_m and wol_sla, and should match with the entries in spells.2da for the SLAs and iprp_feats for the IPFEAT constants.

The final step is updating cls_feat_allBaseClasses with the feats added to feat.2da. You will need to run update_all_base_classes.bat from the main PRC folder after this file is updated.

At this point, a full compile should hopefully see everything working. If not, debug away.

When submitting, only submit the files mentioned above - we don't need all of the updated base class 2das.

That is not dead which can eternal lie.
And with strange aeons even death may die.