Page 5 of 9 First ... 34567 ... Last
  1. #41
    Is this functionality going to be merged into the Vitality/Improved Criticals combo extension as well? If not,is there a way to take advantage of this new update and still use vitality?

  2. #42
    Quote Originally Posted by sjbehindthescreen View Post
    My group is liking the ImprovedCritical extension, thanks Theogeek!

    I did notice that in 5e the "half" and "max" modifiers didn't work right (er, at all) when this mod was loaded. With a bit of copy-paste and a few edits I added a branch to check for those 2 descriptions and then set the damage roll to maximum on the die/dice, or half the maximum when those modifier buttons are selected. Lua is pretty straightforward thankfully.

    If someone wants to make or use the same mods, let me know.
    OK.. Maybe I'm missing something, but even with my extension disabled, the MAX modifier doesn't seem to work. When I select the "Critical" button, it rolls critical damage, but when I select "Max" or "Critical" AND "Max" it doesn't Max it.

    With or without my extension enabled, Half works fine.

    Is the MAX modifier broken?
    Last edited by TheoGeek; March 2nd, 2019 at 22:04.

  3. #43
    Quote Originally Posted by paladiusdarkhelm View Post
    Is this functionality going to be merged into the Vitality/Improved Criticals combo extension as well? If not,is there a way to take advantage of this new update and still use vitality?
    I don't plan on adding this support only because I didn't write the combo extension. I am more than happy to let trembot_89 add this though if he wants. I'm sure either one of us could update that extension.

  4. #44
    Quote Originally Posted by TheoGeek View Post
    OK.. Maybe I'm missing something, but even with my extension disabled, the MAX modifier doesn't seem to work. When I select the "Critical" button, it rolls critical damage, but when I select "Max" or "Critical" AND "Max" it doesn't Max it.

    With or without my extension enabled, Half works fine.

    Is the MAX modifier broken?
    I just tested it with no extensions loaded, MAX works just fine. 2D6+2 MAX CRITICAL returned 4x 6s for a total of 26 damage. 2d6+2 MAX returned 2x 6s for a total of 14 damage.

    EDIT:
    With just your extension loaded, MAX does not work at all. That is because your mod replaces the onDamageRoll function (which handles MAX) in manager_action_damage.lua.
    Last edited by deer_buster; March 3rd, 2019 at 08:21.
    aka Laendra

    Discord: Laendra#9660
    Ultimate license (FGC/FGU)
    Current Timezone : Central (CDT) (GMT -5)
    Playtime: Prefer 8pm Central, or later
    Playing: Starfinder on Tuesday evenings
    DCI: 3317036507
    Organized Play: 2369539

  5. #45
    If you replace your existing ImprovedCritical code with this, it should work fine...NOTE: It does not have the changes from anything after v3 of your extension...

    Code:
    function ImprovedCritical(rSource, rRoll)
    	-- Handle max damage
    	local bMax = rRoll.sDesc:match("%[MAX%]");
    	local bCrit = rRoll.sDesc:match("%[CRITICAL%]");
    	if bMax then
    		for _,vDie in ipairs(rRoll.aDice) do
    			local sSign, sColor, sDieSides = vDie.type:match("^([%-%+]?)([dDrRgGbBpP])([%dF]+)");
    			if sDieSides then
    				local nResult;
    				if sDieSides == "F" then
    					nResult = 1;
    				else
    					nResult = tonumber(sDieSides) or 0;
    				end
    				
    				if sSign == "-" then
    					nResult = 0 - nResult;
    				end
    				
    				vDie.result = nResult;
    				if sColor == "d" or sColor == "D" then
    					if sSign == "-" then
    						vDie.type = "-b" .. sDieSides;
    					else
    						vDie.type = "b" .. sDieSides;
    					end
    				end
    			end
    		end
    	end
    	if bCrit then
    		for _,vDie in ipairs(rRoll.aDice) do
    			local sSign, sColor, sDieSides = vDie.type:match("^([%-%+]?)([dDrRgGbBpP])([%dF]+)");
    			if sDieSides then
    				local nResult = vDie.result;
    				if sDieSides == "F" then
    					nResult = 1;
    				else
    					if sColor ~= "g" and sColor ~= "G" then
    						nResult = tonumber(sDieSides) or 0;
    					end
    				end
    				
    				if sSign == "-" then
    					nResult = 0 - nResult;
    				end
    				
    				vDie.result = nResult;
    			end
    		end
    	end
    	
    	decodeDamageTypes(rRoll, true);
    end
    aka Laendra

    Discord: Laendra#9660
    Ultimate license (FGC/FGU)
    Current Timezone : Central (CDT) (GMT -5)
    Playtime: Prefer 8pm Central, or later
    Playing: Starfinder on Tuesday evenings
    DCI: 3317036507
    Organized Play: 2369539

  6. #46
    Yeah, the MAX modifier works fine with my extension enabled (as of the update I made last night - v 1.6), and it also works when my extension is not loaded at all.

    However, when my extension is loaded but disabled (via the settings option), it executes this code ...

    ActionsManager.registerPostRollHandler("damage", onDamageRoll);

    ... which I believe is the default handler. At that point, my extension does not execute (as evidenced by some debug code I add) at all, and damage works normally then, but MAX stops working. HALF continues to work.

    Any clues there?

  7. #47
    Quote Originally Posted by TheoGeek View Post
    Yeah, the MAX modifier works fine with my extension enabled (as of the update I made last night - v 1.6), and it also works when my extension is not loaded at all.

    However, when my extension is loaded but disabled (via the settings option), it executes this code ...

    ActionsManager.registerPostRollHandler("damage", onDamageRoll);

    ... which I believe is the default handler. At that point, my extension does not execute (as evidenced by some debug code I add) at all, and damage works normally then, but MAX stops working. HALF continues to work.

    Any clues there?
    Yeah, you are trying to call a function that isn't defined in your scope....use ActionsManager.registerPostRollHandler("damage", ActionDamage.onDamageRoll);
    aka Laendra

    Discord: Laendra#9660
    Ultimate license (FGC/FGU)
    Current Timezone : Central (CDT) (GMT -5)
    Playtime: Prefer 8pm Central, or later
    Playing: Starfinder on Tuesday evenings
    DCI: 3317036507
    Organized Play: 2369539

  8. #48
    Quote Originally Posted by deer_buster View Post
    Yeah, you are trying to call a function that isn't defined in your scope....use ActionsManager.registerPostRollHandler("damage", ActionDamage.onDamageRoll);
    DOH! That'd do it!

    It works now. I'll be uploading a new version soon.

    Thanks!

  9. #49

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    135
    I just got to looking at the recent changes, including how you added options for this mod. You sir, are freaking amazing. I love the customization of this mod!

  10. #50
    Thanks Theogeek, for updating. I like the more verbose text in the chatlog, and now Critical and Max work perfectly. But the 5e HALF modifier button doesn't work for me whether I load the extension or not. Weird.

    What results do you see? An example from my chatlog:


    [DAMAGE] Claw [HALF] [TYPE: slashing (2d6+7=16)]


    (that's 2d6 roll of 6 and 3)

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in