1. #1

    SWADE - Missing Group filter for Individual Item Lists

    Would it be possible to either add group filters to the Item tables or have the Item filter selected in the main Item table automatically apply to the table views? This would allow us to have custom item tables for particular settings.

    More info
    When we select any of the individual item buttons (Item, Armor, Melee, Ranged, Vehicle) from the top of the Items screen we see handy table views showing all of the Items of that particular type; however there are no group filters to these views, also the group filter we set on the main Items screen does not apply to the table views.

    What this means is that if you have a modified item list or items with the same name from different settings, we get duplicate items it the table views which cannot be filtered or removed without removing the modules. It also means that if we are playing a particular campaign (for example fantasy) our weapons lists, and items are cluttered with modern and futuristic items, which again cannot be easily removed.

  2. #2
    Maybe I'm just missing something. Please see attached image Duplicate Items.png

    As an example I have two different maces in the items list - One Listed under Medieval (SWADE) and the other under Hammers & Maces (Hellfrost). They are not identical, as a mace is twice as expensive in Hellfrost. I'm filtering my Items list to only show the Hellfrost Players Guide items and it shows one Mace, but there is no filter applied (or available) on the Melee Weapons tab.

    What I'd like to do is set up my own Item List, and make only that available to the players but I'd also like to share the SWADE and Hellfrost players guide. If I create my own list, there will be 3 maces. Filtering would be the next best thing but does not help when looking at the tables (such as melee weapons...)

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,403
    The "Melee Weapons" table is specifically designed to show all items of that type - there's no filtering as standard.

    You could create your own "grouped list" (as it's referred to in FG) or maybe modify the standard filter on that grouped list - via an extension.

    But this is all FG code - if you're willing to have a look, go to scripts\data_library_sw.lua in the SavageWorlds.pak ruleset file. Search for "weapon_grouped_title_meleeweapon" to get to the section where the melee weapon grouped list is defined. Note that there's a filter defined in:
    Code:
    aFilters = { 
    	{ sCustom = "item_ismeleeweapon" }
    Which, via the setCustomFilterHandler at the bottom of that file, runs the isMeleeWeaponItem function - maybe you could look at changing that filter in an extension? You could overwrite that function in the LibraryDataSW pacakge using some code such as this:
    Code:
    function onInit()
    	LibraryData.setCustomFilterHandler("item_ismeleeweapon", myMeleeWeaponFilter)
    end
    
    function myMeleeWeaponFilter(vRecord, vDefault)
    	-- Change to whatever you need to do your filter
    	local sTraitType = vRecord and DB.getValue(vRecord, "traittype")
    	return isWeaponItem(vRecord, vDefault) and StringManager.equals(sTraitType, "Melee") and not isVehicularItem(vRecord, vDefault)
    end
    Edit: you could probably use this API call to determine which module the record comes from: https://www.fantasygrounds.com/refdo....xcp#getModule with something like the following (I haven't tested this, so syntax might not be 100% correct):
    Code:
    function myMeleeWeaponFilter(vRecord, vDefault)
    	local sTraitType = vRecord and DB.getValue(vRecord, "traittype")
    	return LibraryDataSW.isWeaponItem(vRecord, vDefault) and StringManager.equals(sTraitType, "Melee") and not LibraryDataSW.isVehicularItem(vRecord, vDefault) and vRecord.getModule() == "Module name I want to filter on"
    end
    Last edited by Trenloe; May 14th, 2019 at 19:48.


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,403
    I've made a quick extension using the code I mentioned above - see attached.

    I don't have any Hellfrost modules, so I've guessed (based off the screenshots on the store page) that the module name is "Hellfrost Players Guide" - you can change in the extension if you need to. I've left some debug code that writes to the FG console the name of the module for each item the filter checks - open the console using the \console chat command and you'll be able to see the exact name of the module for each item record the filter is checking.
    Attached Files Attached Files


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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!

  5. #5
    Superb Trenloe, worked straight out of the gate. Will review and see how to extend to the Item, Armor, Ranged and Vehicle lists - but this is really excellent!

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,403
    Quote Originally Posted by Miglefin View Post
    Superb Trenloe, worked straight out of the gate.
    Woo hoo!


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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
    Your comments were great, this is the first time I've tried anything like this and I was able to modify also to filter for the ranged weapons and vehicular weapons. The Item and Armor lists look like a different format, so give them a shot later.

  8. #8
    Hi Trenloe it looks like it works for all lists with the attached modified Ext file. Which just basically repeats what you had done for the weapons list for the item, armour, ranged and vehicular weapons lists. SW Grouped Item Lists Filter.ext

    Thinking about it, the easier more flexible solution would be for the group (Category) drop down list at the top of the main Item window to automatically filter all of the item lists to the same Group as per the following screenshot. Sorted by main item group.png

    This would not restrict the players from selecting something from another list, but even in the EXT version they can select from any item from the main Item list.

    I think it would be useful to code all sub-tables (Powers by Rank, Edges by Type, Races by Racial Abilities, Vehicles by Group, as well as Items by Item/Armor/Melee/Ranged/Vehicles) to be sorted the categories selected on the main tables.
    Last edited by Miglefin; May 14th, 2019 at 23:34.

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
  •  

Log in

Log in