-
May 31st, 2024, 23:11 #1
Advice on how to package change to CoreRPG.pak lua file into an extension
Hi all,
I have been working on some great advice from Trenloe on building a 'fairly' simple change to how effects are presented in the combat tracker.
Basically, Trenloe created a great extension to sort the combat tracker effects windowlist alphabetically and I would like to add a corresponding change to the pipe delimited list of unexpanded effects. I have the code change to be implemented but it is in manager_effect.lua in CoreRPG.pak (it is a one liner even).
How do I go about packaging a change to manager_effect.lua into an extension so that the method affected can be applied to any ruleset without being overwritten should that package get changed by the powers that be? How does one keep up with any changes to the base pak file so that higher level changes can be absorbed? Is there a way to specify changes in an extension at the method level? How does the community monitor changes to core functionality that would supersede custom changes?
Secondly, is it advisable to make the change an option and if so, how would that be performed (my change is in function manager_effect.lua(getEffectsString()))?
Many thanks to all for educating me on these processes!!!
Cheers!Last edited by secors; May 31st, 2024 at 23:19.
-
June 1st, 2024, 01:54 #2
Sometimes you have to replace the whole script or the whole function. Other times you can use super to modify a much smaller amount.
-
June 1st, 2024, 02:38 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 21,027
For global scripts, as an example to replace EffectsManager.getEffectsString function; you could write an extension with a tag like this:
Code:<script name="EffectManagerMyOverride"> function onInit() EffectManager.getEffectsString = getEffectsString; end function getEffectsString(nodeCTEntry, bPublicOnly) ... your code here ... end </script>
Code:<script name="EffectManagerMyOverride"> local _fnOrigGetEffectsString; function onInit() _fnOrigGetEffectsString = EffectManager.getEffectsString; EffectManager.getEffectsString = getEffectsString; end function getEffectsString(nodeCTEntry, bPublicOnly) local sResult = _fnOrigGetEffectsString(nodeCTEntry, bPublicOnly); ... your code here ... return sResult; end </script>
Regards,
JPG
-
June 1st, 2024, 06:04 #4
Thanks JPG. Great example.
Based on that work, I was able to extend the functionality to both the expanded effects list [from Trenloe] and the collapsed effects string in the combat tracker [refactoring getEffectsString].
There is a small disconnect between the two sets when ordering strings that are identical in all but [letter] case.
-
June 5th, 2024, 00:30 #5
Slightly tweaked version
Please let me know what you think!
Cheers
-
June 5th, 2024, 03:17 #6
Psst.. I think you should put it on forge
My First Mod PFRPG - Feats Extended, focusing on PF1e Feats and Racial Traits automation. It is open to community assistance** accidentally deleted, If anyone grabbed a copy, PLEASE let me know**. Here is the forum Link.
40+ PF1e Extensions & Modules I use, with links.
PF1E Coding Effects - Spreadsheet
Discord: Morenu
-
June 5th, 2024, 14:05 #7
Thread Information
Users Browsing this Thread
There are currently 4 users browsing this thread. (0 members and 4 guests)
Bookmarks