FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    Effects Sort Order

    Is anyone aware of a method or extension that allows the effects on PCs/NPCs on the combat tracker to be sorted alphabetically.

    Perhaps there is a simple setting somewhere already? I cannot work out how it works. Whenever I place effects, where it appears in the list seems truly random...

    I run a 3.5 game and the characters (and some NPCs) have 30-40 effects on them. :-)

  2. #2
    Morenu's Avatar
    Join Date
    Mar 2020
    Location
    Pennsylvania, USA
    Posts
    563
    I am unaware of any but would love that too.

    I do have a link to a thread with a few options for PF1e note lines and alphabetize option in the actions tab
    My First Mod PFRPG - Feats Extended, focusing on PF1e Feats and Racial Traits automation. It is open to community assistance. Here is the forum Link.

    40+ PF1e Extensions & Modules I use, with links.

    PF1E Coding Effects - Spreadsheet

    Discord: Morenu

  3. #3

    possible mod?

    Quote Originally Posted by Morenu View Post
    I am unaware of any but would love that too.

    I do have a link to a thread with a few options for PF1e note lines and alphabetize option in the actions tab
    I also have been trying to find a feature that does this.

    !!Disclaimer: while I am a software engineer, both lua and the FG code base are new to me, so I could be way off in the following analysis. I have tried to run the one line code change below but I am having trouble managing the revved CoreRPG.pak to get it to work. (Perhaps those proficient in such things are monitoring this thread and could render some advice. Fully open to suggestions to aid my understanding here.)

    Looking at the EffectManager code (manager_effect.lua), it appears that there is some effect sorting happening but it does not look like it is using the effect descriptive elements, only some database specific element(?). Note also, that there might be another method that yields the effect summary string that is different than the list, since the summary does not list effects whose status is 'off' or 'skip' - no indication yet on that aspect. The line in bold is my suggested addition.

    function getEffectsString(nodeCTEntry, bPublicOnly)
    local aOutputEffects = {};

    -- Iterate through each effect
    local aSorted = {};
    for _,nodeChild in ipairs(DB.getChildList(nodeCTEntry, "effects")) do
    table.insert(aSorted, nodeChild);
    end
    table.sort(aSorted, function (a, b) return DB.getName(a) < DB.getName(b) end);
    for _,v in pairs(aSorted) do
    local sEffect = EffectManager.getEffectString(v, bPublicOnly);
    if sEffect ~= "" then
    table.insert(aOutputEffects, sEffect);
    end
    end

    table.sort(aOutputEffects); -- this is probably the table that needs to be sorted

    return table.concat(aOutputEffects, " | ");
    end

  4. #4
    Quote Originally Posted by secors View Post

    table.sort(aOutputEffects); -- this is probably the table that needs to be sorted
    Has anyone been able to test this to see if it works. I would but I do not seem to have the file "manager_effect.lua"?

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,529
    Quote Originally Posted by AndyGJFantasyG View Post
    I would but I do not seem to have the file "manager_effect.lua"?
    It's in the CoreRPG ruleset, which most rulesets are layered on top of.
    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!

  6. #6
    Added the string. It works in that it sorts the condensed version of the effects.

    However how can I sort the expanded list?

    I've tried putting in some table.sorts where I think it could work but it doesn't seem to.

  7. #7
    Yes, that is the question. I don't know where the expanded CT effects gui gets/presents its data.

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,529
    Quote Originally Posted by AndyGJFantasyG View Post
    However how can I sort the expanded list?
    The expanded effects list is a windowlist, which has sortby properties: https://fantasygroundsunity.atlassia...260/windowlist

    Try the attached extension as an example of CT effects alphabetical sorting.
    Attached Files Attached Files
    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!

  9. #9
    Seems to work...well done.
    Screenshot 2024-05-30 164958.png
    Last edited by AndyGJFantasyG; May 30th, 2024 at 16:51.

  10. #10
    Makes it much easier to spot the duplicates.

    Thank you so much.
    Last edited by AndyGJFantasyG; May 30th, 2024 at 16:59.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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
  •  
5E Product Walkthrough Playlist

Log in

Log in