STAR TREK 2d20
  1. #1

    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>

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  2. #2
    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

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    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>
    ...
    ...
    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
    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.

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  5. #5
    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>

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  6. #6
    Morning,

    Getting closer to completion. This will be a large module over 250+ NPC types in multiple districts in Magnimar. Almost all the NPCs are in. I discovered that I may have forgotten about Grump and Wald and perhaps one or two of the Sandpoint NPCs mentioned early on during the second module of the ROTRL AP. After I finish making all my tokens and re-link them and QC each module I will add those NPCs.

    Then coding and removal of the token images from the module, which will be replaced by blanks. This module may be useful in ROTRL or Shattered Star APs.

    As I dive into ROTRL 3 module I may have to make a small Village of NPCs from that is mentioned in that module.

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

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