FG Spreadshirt Swag
  1. #1
    dellanx's Avatar
    Join Date
    Sep 2015
    Location
    Chicago, IL
    Posts
    968

    Need help filtering or excluding table data

    Morning,

    I am trying to create multiple tables to sort NPCs in by location. Lets say Location A in Table A: 01, 02..etc. Location B in Table B: 01, 02, 03, etc.

    Untitled.jpg

    Splitting the tables works, but the sort does not filter out unlisted NPCs.
    Code:
    			<lists static="true">
    		<npcs_byalibasterlocation >
    			<recordtype type="string">npc</recordtype>
    			<source type="string">npc</source>
    			<columns>
    				<column1>
    					<name type="string">name</name>
    					<width type="number">200</width>
    				</column1>
    			</columns>
    			<groups>
    				<group1>
    					<field type="string">alibastercharacter</field>
    				</group1>
    			</groups>
    					<grouporder type="string">01|02</grouporder>
    			<notes type="formattedtext">
    				<p><b>*</b> These NPCs and their companions are to augment 'The Rise of the Runelords Adventure Path Module 1 - Burnt Offerings' and may be used for the entire campaign as deemed by the GM.</p>
    			</notes>
    		</npcs_byalibasterlocation >
    
    		<npcs_bynayoslocation >
    			<recordtype type="string">npc</recordtype>
    			<source type="string">npc</source>
    			<columns>
    				<column1>
    					<name type="string">name</name>
    					<width type="number">200</width>
    				</column1>
    			</columns>
    			<groups>
    				<group2>
    					<field type="string">nayoscharacter</field>
    				</group2>
    			</groups>
    					<grouporder type="string">01|02|03</grouporder>
    			<notes type="formattedtext">
    				<p><b>*</b> These NPCs and their companions are to augment 'The Rise of the Runelords Adventure Path Module 1 - Burnt Offerings' and may be used for the entire campaign as deemed by the GM.</p>
    			</notes>
    		</npcs_bynayoslocation >
    	</lists>

  2. #2
    dellanx's Avatar
    Join Date
    Sep 2015
    Location
    Chicago, IL
    Posts
    968
    The question is, how do I handle empty string:
    <alibastercharacter type="string"></alibastercharacter>
    That relates to:

    <groups>
    <group2>
    <field type="string">nayoscharacter</field>
    </group2>
    </groups>
    <grouporder type="string">01|02|03</grouporder>
    Because I don't won't this NPC to show up.

    Thanks

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,923
    You can't do that using the grouped list fields - not without writing an extension to create a custom grouped list that has a custom filter to not display NPC records with blank fields.

    The best you can do is hard code all of the creatures in the list. This is how it's done in the PF Bestiary 1.

    For example, the "Monsters by Type" are setup as:

    Code:
            <npcs-by-type>
              <listlink type="windowreference">
                <class>reference_colindex</class>
                <recordname>npclists.npc-by-type</recordname>
              </listlink>
              <name type="string">Monsters by Type</name>
            </npcs-by-type>
    And the npclists.npc-by-type data is a big long list of each creature:

    Code:
        <npc-by-type>
          <description type="string">Monsters by Type</description>
          <groups>
            <typeaberration>
              <description type="string">Aberration</description>
              <index>
                <aboleth>
                  <link type="windowreference">
                    <class>npc</class>
                    <recordname>reference.npcdata.aboleth</recordname>
                  </link>
                  <name type="string">Aboleth</name>
                </aboleth>
                <choker>
                  <link type="windowreference">
                    <class>npc</class>
                    <recordname>reference.npcdata.choker</recordname>
                  </link>
                  <name type="string">Choker</name>
                </choker>
                <chuul>
                  <link type="windowreference">
                    <class>npc</class>
                    <recordname>reference.npcdata.chuul</recordname>
                  </link>
                  <name type="string">Chuul</name>
                </chuul>
    ...
    ...

    FG Con 16 FG Online RPG Convention - Friday April 16th Sunday 18th, 2021.

    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!

  4. #4
    dellanx's Avatar
    Join Date
    Sep 2015
    Location
    Chicago, IL
    Posts
    968
    Quote Originally Posted by Trenloe View Post
    You can't do that using the grouped list fields - not without writing an extension to create a custom grouped list that has a custom filter to not display NPC records with blank fields.

    The best you can do is hard code all of the creatures in the list. This is how it's done in the PF Bestiary 1.
    I see, thank you.

  5. #5
    dellanx's Avatar
    Join Date
    Sep 2015
    Location
    Chicago, IL
    Posts
    968
    Quote Originally Posted by Trenloe View Post
    You can't do that using the grouped list fields - not without writing an extension to create a custom grouped list that has a custom filter to not display NPC records with blank fields.

    The best you can do is hard code all of the creatures in the list. This is how it's done in the PF Bestiary 1.
    I was able to solve it. Looking at the the PF Bestiary 1 module gave me a clue. The problem was that both Table were sharing the same Source npc. When I changed the source to npc0 and npc1 that fixed it.

    Fixed.jpg

    Code:
    	<library>
    		<rtesttest static="true">
    			<categoryname type="string"></categoryname>
    			<name type="string">rtesttest</name>
    			<entries>
    				<npc0>
    					<librarylink type="windowreference">
    						<class>reference_groupedlist</class>
    						<recordname>lists.npcs_byalibasterlocation</recordname>
    					</librarylink>
    					<name type="string">NPCs by Alibaster District Location</name>
    					<recordtype type="string">npc</recordtype>
    				</npc0>
    
    				<npc1>
    					<librarylink type="windowreference">
    						<class>reference_groupedlist</class>
    						<recordname>lists.npcs_bynayoslocation</recordname>
    					</librarylink>
    					<name type="string">NPCs by Nayos District Location</name>
    					<recordtype type="string">npc</recordtype>
    				</npc1>
    
    			</entries>
    		</rtesttest>
    	</library>
    Code:
    </npc0>
    .
    .	
    </npc0>
    <npc1>
    .
    .
    </npc1>
    Code:
    			<lists static="true">
    		<npcs_byalibasterlocation >
    			<recordtype type="string">npc</recordtype>
    			<source type="string">npc0</source>
    			<columns>
    				<column1>
    					<name type="string">name</name>
    					<width type="number">200</width>
    				</column1>
    			</columns>
    			<groups>
    				<group1>
    					<field type="string">alibastercharacter</field>
    				</group1>
    			</groups>
    					<grouporder type="string">01|02</grouporder>
    			<notes type="formattedtext">
    				<p><b>*</b> These NPCs and their companions are to augment 'The Rise of the Runelords Adventure Path Module 2 - Magnimar - Alibaster District and may be used for the entire campaign as deemed by the GM.</p>
    			</notes>
    		</npcs_byalibasterlocation >
    
    		<npcs_bynayoslocation >
    			<recordtype type="string">npc</recordtype>
    			<source type="string">npc1</source>
    			<columns>
    				<column1>
    					<name type="string">name</name>
    					<width type="number">200</width>
    				</column1>
    			</columns>
    			<groups>
    				<group2>
    					<field type="string">nayoscharacter</field>
    				</group2>
    			</groups>
    					<grouporder type="string">01|02|03</grouporder>
    			<notes type="formattedtext">
    				<p><b>*</b> These NPCs and their companions are to augment 'The Rise of the Runelords Adventure Path Module 2 - Magnimar - Nayos District and may be used for the entire campaign as deemed by the GM.</p>
    			</notes>
    		</npcs_bynayoslocation >
    	</lists>

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Fantasy Grounds Fridays Pre

Log in

Log in