DICE PACKS BUNDLE
Page 2 of 5 First 1234 ... Last
  1. #11
    Tnx for the tip. Didnt knew that!

  2. #12
    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.

  3. #13
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    Quote Originally Posted by Gamerman View Post
    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.
    Hi Gamerman. Most people make extensions to primarily meet their own needs. Why dont you crack open the two extensions and see if you can work out what/why they dont play nice together.

  4. #14
    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?

  5. #15
    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.

  6. #16
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    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.

    Quote Originally Posted by Gamerman View Post
    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.
    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.

    Quote Originally Posted by Gamerman View Post
    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?
    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.

    Quote Originally Posted by Gamerman View Post
    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.
    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!

  7. #17
    Quote Originally Posted by damned View Post
    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.
    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
    And the functions on the right of the equal are located in the script the above onInit() is called. For example ActionAttack.performRoll is replaced by the function manager_action_attack_performRoll.

    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.

  8. #18
    rob2e's Avatar
    Join Date
    Sep 2015
    Location
    Spokane, WA
    Posts
    1,423
    Blog Entries
    13
    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

  9. #19
    Quote Originally Posted by Gamerman View Post
    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.
    This has been my first implemented extension. I must admit I'm not using it anymore and I'm pretty sure there's a better way to implement it as Celestian suggests.

  10. #20
    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

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 Character Create Playlist

Log in

Log in