FG Spreadshirt Swag
  1. #1

    Adding custom feat metadata to filters

    I'm trying to figure out what the logic is for populating the four filter drop-down controls in the Feats window with custom archetypes and traits. I'm creating a module that will contain new custom feats that have new archetypes and traits, and I would like the players to be able to filter on the archetypes and traits in those new feats. Just creating the feats and then exporting the feats doesn't seem to do the trick by itself.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    From the data_library_pfrpg2.lua feats record setup:

    Code:
    		aCustomFilters = {
    			["Trait"] = { sField = "traits", fGetValue = getFeatTraitValue },
    			["Class Level"] = { sField = "level", sType = "number", fGetValue = getFeatLevelValue },
    			["Feat Level"] = { sField = "level", sType = "number" },
    			["Archetype"] = { sField = "archetype", sType = "string" },
    So the "Archetype" filter just uses the "archetype" string field in the feat record.

    "Trait" uses custom code to setup the trait filters - these are set in GameSystem.traitTypeFilter and also have the names of ancestry and class records added at the start of the campaign or when a module is opened/closed. Basically, any custom ancestries or classes manually added won't be in the filter until a campaign restart or a module is loaded (which triggers the trait filter refresh code).
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    So here's what the start of my feats section looks like in my module's client.xml after exporting:

    Code:
    	
    <feat>
    	<category name="Zeitgeist Player's Guide" baseicon="0" decalicon="0">
    		<id-00001>
    			<effectsbenefits type="formattedtext">
    				<p>You gain negative resistance equal to half your level (minimum 1) and you gain a +1 circumstance bonus to saves against death, fear and negative effects.</p>
    			</effectsbenefits>
    			<level type="number">1</level>
    			<level_applied type="number">0</level_applied>
    			<locked type="number">0</locked>
    			<name type="string">Deathless Calm</name>
    			<shortbenefits type="string">Negative resistance and bonus to saves</shortbenefits>
    			<special type="formattedtext">
    				<p></p>
    			</special>
    			<traits type="string">DEVA</traits>
    		</id-00001>
    This particular feat is not an archetype, so just considering traits for this example. When I start up the campaign that has this module open, I do not see Deva (or DEVA, not sure which is correct) show up in the drop down list of traits.

  4. #4
    Does my module need to actually modify GameSystem.traitTypeFilter? I didn't think modules could execute scripts.

  5. #5
    More info, in this case Deva is a heritage only, it is not an ancestry. So there isn't a corresponding entry under <race> or <reference.races>. That's probably the issue? Let me try creating a new race and see if that fixes things.

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    The ruleset is specifically coded *not* to display every single possible trait in the trait filter, this would take forever and no one would use it because the list would be too long.
    Last edited by Trenloe; December 11th, 2020 at 18:46.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by darrenan View Post
    More info, in this case Deva is a heritage only, it is not an ancestry. So there isn't a corresponding entry under <race> or <reference.races>. That's probably the issue? Let me try creating a new race and see if that fixes things.
    Most feats in standard PF2 don't have a heritage name as a trait, unless it's a versatile heritage. Versatile heritages have to be added to GameSystem.traitTypeFilter which can only be done through code - i.e. an extension.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #8
    It is a versatile heritage which probably doesn't merit an extension for just that little bit of functionality.
    Filling in the archetype field for all the archetype feats was what was missing there, so problems (mostly) solved. Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in