Resource Names and Tags and Template ResRefs, oh my.

For toolset tutorials as well as question and answers.
Locked
User avatar
hollyfant
Staff Head on a Pike - Standards
Posts: 3481
Joined: Mon Oct 24, 2005 3:33 pm
Location: the Netherworl... lands! I meant the Netherlands.

Resource Names and Tags and Template ResRefs, oh my.

Post by hollyfant »

Okay, I should know all this. But it's really when you start to judge the work of others, it starts to dawn on you how much you don't know. So, eh... could I get a refresher course, or a recap?

Localised Name
If it's for a PC, the name comes in front, without a space, right? So:
{BobFigh}Super-duper-ueber Sword

Resource Name, Tag, Template ResRef I'm rather embarrassed to have to ask these basic questions, but if I'm vetting items I want to be absolutely sure I'm getting it right.

[edit] Moved to Toolsetting for the benefit of all builders. -Curmudgeon
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Re: Resource Names and Tags and Template ResRefs, oh my.

Post by AcadiusLost »

Display Name is what is shown as the item name- any text surrounded by { and } will be hidden from players, visible to DMs. Spaces don't matter, can be at the beginning, end, or middle of the name. "Ancient Elven Longsword {+1, cursed backbiter}" works, as does "{Joe Fighter} Special Helm". Also note that item names can be edited by PCs via the DMFI, so don't put anything too critical in there, it's mostly for easier identification of items from the DM creator list.

There is also a Display Name (when Identified) that goes with the "Identified?" field in properties. Loot that may be found and need ID'ing should have some generic name in Display Name, and the full one in (when Identified) with Identified = FALSE. Things to be sold in stores should be pre-identified, etc.

-------------------------------------------------------------

Tag doesn't have to be unique to the item; and dictates what unique scripts will run in conjunction with item events.

For Unique Power / Activate Item type things
tag = "exampleitemtag" means "Using" the item will call exampleitemtag.nss (not recommended, NWN1-style legacy handling)

The better convention is naming the script "i_exampleitemtag_ac.nss" for a script that will be automatically called when the item so tagged is Used.

Also important for items that need special script handling for OnEquip, OnUnEquip, OnAcquire, etc. Cursed items are one example, robes that apply special spiffy VFX are another. In these cases the script name convention works like "i_exampleitemtag_eq.nss" etc.

So... tags are their own thing, important for scripts. Making tag = resname is an acceptable default if you don't need to do anything special with it, though.

--------------------------------

Resource Name is like NWN1's ResRef: it's the actual name of the file that stores the blueprint information. Has to be unique per module (importing something with the same resname overwrites the previous copy). The Copy Blueprint -> Module command makes a copy of an existing blueprint, but appends a "0" to the end of the resname to make it unique. Incidentally, spotting a spare "0" at the end of your resname is a good indication that you've exported the wrong copy if you were trying to erf out a change in an existing blueprint for a Live mod. Also- when exporting (to make an ERF file for import), resources will be listed by Resname.

Server-specific items should have the server number prefixed to the resname, preferably as 3-digit rather than 2 "003_etc". PC items should ALSO have server specific prefix so we know where they came from, and so they group with other server specific items in the module contents listings (as opposed to getting lost amidst thousands of other resources when sorted alphabetically)

General ALFA items will get "abr_" prefixed to indicate that they are part of the base ALFA complement, as opposed to being part of a particular server. If a build team wants to edit these for their own purposes, they should switch out the resnames (and perhaps also the tags) to use the server number "009_" convention. Of course, if they are Unique Power items, this may break the scripting, so use caution with those.

-----------------------------

Template resref... beats me. Still haven't figured out what that one is for. I set it to the same as the Resource Name and generally otherwise ignore it.
Locked