View Full Version : Effects Sort Order
AndyGJFantasyG
May 26th, 2022, 08:49
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. :-)
Morenu
June 14th, 2022, 15:03
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
secors
March 30th, 2023, 17:39
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
AndyGJFantasyG
May 20th, 2024, 11:36
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"?
Trenloe
May 20th, 2024, 15:51
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.
AndyGJFantasyG
May 30th, 2024, 15:36
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.
secors
May 30th, 2024, 15:42
Yes, that is the question. I don't know where the expanded CT effects gui gets/presents its data.
Trenloe
May 30th, 2024, 15:55
However how can I sort the expanded list?
The expanded effects list is a windowlist, which has sortby properties: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645260/windowlist
Try the attached extension as an example of CT effects alphabetical sorting.
AndyGJFantasyG
May 30th, 2024, 16:48
Seems to work...well done.
60963
AndyGJFantasyG
May 30th, 2024, 16:52
Makes it much easier to spot the duplicates.
Thank you so much.
secors
May 31st, 2024, 16:32
Yes, thank you Trenloe. That does indeed sort the CT expanded effects including reordering new ones as you type!!!
How hard would it be to combine this with the sorting of the collapsed effects string - the one that is pipe delimited??
Cheers!
Trenloe
May 31st, 2024, 16:38
How hard would it be to combine this with the sorting of the collapsed effects string - the one that is pipe delimited??
If someone's got that side of the code working it should be pretty straightforward for them to combine it with the extension.
secors
May 31st, 2024, 17:27
Thanks for the input. Unfortunately, I am uncertain how to add the code change to manager_effect.lua into your extension. I thought there was a guide showing how to do this but seem to recall that extensions to code in the core could be overwritten?
Advice?
Trenloe
May 31st, 2024, 17:34
Advice?
Sorry, I'm really busy today and don't have time to delve into this. Maybe someone else will help, or you could search the forums for overriding scripts.
secors
June 5th, 2024, 00:26
https://www.fantasygrounds.com/forums/showthread.php?81576-Advice-on-how-to-package-change-to-CoreRPG-pak-lua-file-into-an-extension
secors
June 8th, 2024, 17:15
This has been released as a free extension on Forge (https://forge.fantasygrounds.com/shop/items/1794/view). It is called CT Effect Ordering. I will monitor this forum for advice and maintenance.
Cheers
Morenu
June 9th, 2024, 00:12
First off, THANKS! for putting it in forge
Issues / opinions
- "bought it", updated, not seeing it in my extension list for a PFRPG world. I do not see it in my ext folder (assume you have it vaulted) so I can't check what ruleset(s) you have it set to. I do not see it in 5e, corerpg, pfrpg either... I DID do a FGU update after buying it... so not sure whats up
- Your forum link in the Forge page leads nowhere
- Suggest you set the install location to Data if you do not mind people looking at the code (I could verify if it is actually downloaded and check the ruleset setting if it is data)
- Suggest you put edit the first forum post and put the forge link there.
- Suggest you go into the manage item tab and for category, add ALL the rulesets it should work on so it searches better
:)
Trenloe
June 9th, 2024, 00:40
Issues / opinions
- "bought it", updated, not seeing it in my extension list for a PFRPG world. I do not see it in my ext folder (assume you have it vaulted) so I can't check what ruleset(s) you have it set to. I do not see it in 5e, corerpg, pfrpg either... I DID do a FGU update after buying it... so not sure whats up
It's available to all rulesets as Feature: CT Effects Alpha Ordering
- Suggest you set the install location to Data if you do not mind people looking at the code (I could verify if it is actually downloaded and check the ruleset setting if it is data)
It is in the FG modules data directory - it's called "Effects Alpha Ordering.ext"
I've already reached out directly to @secors about creating a thread for this and linking to that in the Forge item.
Morenu
June 9th, 2024, 01:17
Odd. Will check again, but i looked for feature: ct…. Before and Nothing. So its on my end for some reason
secors
June 9th, 2024, 14:19
First off, THANKS! for putting it in forge
Issues / opinions
- "bought it", updated, not seeing it in my extension list for a PFRPG world. I do not see it in my ext folder (assume you have it vaulted) so I can't check what ruleset(s) you have it set to. I do not see it in 5e, corerpg, pfrpg either... I DID do a FGU update after buying it... so not sure whats up
- Your forum link in the Forge page leads nowhere
- Suggest you set the install location to Data if you do not mind people looking at the code (I could verify if it is actually downloaded and check the ruleset setting if it is data)
- Suggest you put edit the first forum post and put the forge link there.
- Suggest you go into the manage item tab and for category, add ALL the rulesets it should work on so it searches better
:)
Hey Morenu,
I double checked - it is Location: Data, Category: Core, and Type: Core Rules in Forge. And the link comes right to this forum.
I was able to install it under two accounts successfully though I only checked 5E ruleset campaigns.
As Trenloe notes, it is listed as 'Feature: CT Effects Alpha Ordering'.
I will attempt to add the forge link to the first forum post though it was not my post originally.
Cheers
secors
June 9th, 2024, 14:31
Ok, so there is an issue with the forum link after all. It works just fine if I cut and paste the URL into the browser but as Morenu noted it goes to some generic location when selected from the store.
Investigating.
Trenloe
June 9th, 2024, 23:39
Ok, so there is an issue with the forum link after all. It works just fine if I cut and paste the URL into the browser but as Morenu noted it goes to some generic location when selected from the store.
Investigating.
You can right click on the link and copy it - which gives: https://www.fantasygrounds.com/forums/showthread.php?https://www.fantasygrounds.com/forums/showthread.php?73915-Effects-Sort-Order
So the Forge is adding https://www.fantasygrounds.com/forums/showthread.php? to the front of what is entered, this is eluded to in the Forge Manage Item field - i.e. this exact URL pre-pending string is shown above the forum thread field. This is a good way to stop spam links.
To link to the new forum thread you've created, just add 81634-CoreRPG-CT-Effect-Ordering in the field, nothing else.
secors
June 10th, 2024, 13:21
...
To link to the new forum thread you've created, just add 81634-CoreRPG-CT-Effect-Ordering in the field, nothing else.
Got it. Now waiting on the long pending approval process, which is on the order of days right now. Updates are very slow at this rate.
Thanks for your assistance yet again.
Cheers
Retch
June 10th, 2024, 15:43
Update went through BTW. the forum link works.
I just cleared my Extensions, modules and vault folders and running a fresh update...
Trenloe
June 10th, 2024, 19:30
Got it. Now waiting on the long pending approval process, which is on the order of days right now. Updates are very slow at this rate.
It's slower for your first couple of Forge entries as they need to review the entries. Plus, I believe the reviewers don't work weekends.
Retch
June 11th, 2024, 13:11
Update went through BTW. the forum link works.
I just cleared my Extensions, modules and vault folders and running a fresh update...
Fixed...
Resetting the folders did nothing, so I just went into forge, into my inventory, and then disabled and hid this extension. then I went into the hidden tab and enabled and unhid this extension. then I updated FGU again and it was there.
Yay
Morenu
June 11th, 2024, 13:37
Fixed...
Resetting the folders did nothing, so I just went into forge, into my inventory, and then disabled and hid this extension. then I went into the hidden tab and enabled and unhid this extension. then I updated FGU again and it was there.
Yay
oops those 2 posts by Retch were me (I deal with my DMs account - my brother- to take care of the groups extensions and I forgot to switch over to my account). but issue fixed
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.