Thread: 5E - Remove all foes with 0 HP
-
October 20th, 2017, 20:07 #11
- Join Date
- Mar 2016
- Posts
- 41
Tnx for the tip. Didnt knew that!
-
December 29th, 2017, 04:28 #12
- Join Date
- Sep 2015
- Posts
- 6
I like the extension, but it seem to doesn't work with High Templar's GAP theme (https://www.fantasygrounds.com/forum...E-Theme-FG-GAP).
Perhaps you can work together to get it compatible.
-
December 29th, 2017, 04:52 #13
-
December 29th, 2017, 05:07 #14
- Join Date
- Sep 2015
- Posts
- 6
If I knew advanced LUA coding, and was as familiar with both extensions as either extensions' own developers, I'd give it a shot
But GAP theme looks like it makes massive changes that break something in the standard CT radial dial setup, since the extension works with everything else.
Considering the GAP developer often works with other extension developers to improve compatibility, suggesting two experts touch base makes perfect sense.
Frankly, it"s less than helpful for me to create yet another fork. The goal is to work together, and help everyone's extensions to work better together. If I can help out both developers improve their extensions for better inter-compatibility - so much the better.
Since you have suggested it - why not volunteer to teach a LUA development class on Fantasy Grounds College?
-
December 31st, 2017, 00:13 #15
- Join Date
- Sep 2015
- Posts
- 6
For what it's worth, it looks like you can hack the load order to get the Warrior-Priest's "5E - Remove all foes with 0 HP" extension to function with High Templar's theme extensions, by adding a <loadorder> tag after the <ruleset> tag inside the <properties> block of the the "extension.xml" file, and setting it higher than theme extension's load order.
For example:
<properties>
<name>Remove 0HP NPCs</name>
<version>1.0.0</version>
<author>st4lk3r87</author>
<description>Allows hosts to delete from combat tracker NPCs with 0HP</description>
<ruleset>
<name>5E</name>
</ruleset>
<loadorder>821</loadorder>
</properties>
That said - I'd also be curious about the answer to Warrior-Priest's original question about why he needs to include a copy of "template_ct.xml" in his extension, even though he only modifies the "ct_menu.lua" script.
From what I can see, the extension modifies the "onInit()" in the "ct_menu.lua" to add / register some additional menu items to the "Delete from Tracker" menu (e.g. "registerMenuItem") at initialization, tweaks the behavior of the existing menu selection function to support the new options (onMenuSelection), and overrides the "clearNPCs" function to implement the new options.
To do this, a full copy of the entire "ct_menu.lua" (with the above modifications) is included in the extension, as well, as full copy of the "template_ct.xml" (which is not changed at all).
How could this be tightened up, and duplicative script / template files removed from the extension?
For example - could some sort of "merge" be used?
Could a partial snippet of "Lua" script with just the extra changes be included and somehow invoke the normal ruleset script (since not everything in the base "ct_menu.lua" script needs to changed/over-ridden)?
And why does the current implementation require inclusion of another duplicate copy of the "template_ct.xml"?
Perhaps someone with more experience on Lua scripting under the FG architecture / object / ruleset model could weigh in and help explain how the script could be optimized and made simpler, and explain the reason for the current odd extra "template_ct.xml" dependency situation in the present implementaton.
-
December 31st, 2017, 00:57 #16
Good work Gamerman
I would thnk in most cases that a Full Theme (as the GAP theme is) would want to load before other items that change functionality and not appearance so the load order is a good idea. You would probably want to have both extensions have a load order specified so that there is a consistent behaviour.
The more code that is included the more likely a future ruleset will break an extension so minimising included code is always a good idea. In many cases (especially first (second, third, fourth...) attempts at an extension/ruleset involve a lot of trial and error and learning and best practice is not yet understood so you may find superfluous code being used.
Test in two ways - use a coding tool to compare the two files and confirm they are the same - if they are the same comment out the include line in the extension and retest.
Merging works on XML files for windowclass and other named objects/definitions. They must have a name for you to merge on them. Not everything is always named (unfortunately). Merging doesnt (afaik) work on LUA files. In the past you always had to include the while LUA file and just change what you needed to but there was a discussion between Moon Wizard and Dulux_Oz (from memory) a year or so ago about being able to replace individual functions only.
Keep playing with it. You will find it both rewarding and frustrating as you go - sometimes in equal measure and sometimes not!
-
December 31st, 2017, 01:25 #17
It is possible to replace specific function. I started doing it with the AdvancedEffects extension.
Code:function onInit() CombatManager.setCustomAddPC(addPC); CombatManager.setCustomAddNPC(addNPC); --CoreRPG replacements ActionsManager.decodeActors = decodeActors; -- 5E effects replacements EffectManager5E.checkConditionalHelper = checkConditionalHelper; EffectManager5E.getEffectsByType = getEffectsByType; EffectManager5E.hasEffect = hasEffect; -- used for 5E extension ONLY ActionAttack.performRoll = manager_action_attack_performRoll; ActionDamage.performRoll = manager_action_damage_performRoll; PowerManager.performAction = manager_power_performAction; -- option in house rule section, enable/disable allow PCs to edit advanced effects. OptionsManager.registerOption2("ADND_AE_EDIT", false, "option_header_houserule", "option_label_ADND_AE_EDIT", "option_entry_cycler", { labels = "option_label_ADND_AE_enabled" , values = "enabled", baselabel = "option_label_ADND_AE_disabled", baseval = "disabled", default = "disabled" }); end
There were some bits of this that were slightly hinky but for the most part it works. It just gets a bit burdensome if you are replacing a lot and might just be better to just replace the entire .lua script.---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
September 5th, 2018, 09:26 #18
This is really cool, but what about undead fortitude?
rob2e - Join me on Discord!
Become a Patron!
Follow me on the Twitters
Come watch the Twitches... twitch.tv/rob2e
Also my YouTube Channel
Available on the FORGE
My Dungeon Master's Guild Material
-
September 5th, 2018, 13:19 #19
-
September 11th, 2018, 15:59 #20
- Join Date
- Jan 2017
- Posts
- 312
I’m just curious. But is there a way to make it so If a creature reaches zero hit points it is automatically deleted and I don’t have to worry about it?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks