1. #1
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,038
    Blog Entries
    7

    DCC RPG Dice Tower Bug for Dice Swap Desktop Buttons

    I am having a little trouble working out a fix for a DCC RPG ruleset bug involving the dice tower. The ruleset has desktop buttons similar to ADV/DIS for the 5E ruleset, only the DCC buttons increase/decrease the primary die rolled instead of adding a second d20. If you press the +1D button and roll a d8, the dice roll will change to a d10. If this is rolled in the dice tower, the die does not change, but the rRoll data DOES appear to change the die appropriately.

    Clearly, I am missing something about how dice tower rolls work. Any help is appreciated. I posted the "dice swap" script files for a basic die roll from the desktop...

    scripts/manager_action_general.lua
    Code:
    function onInit()
    	ActionsManager.registerModHandler("dice", modRoll);
    end
    
    
    function modRoll(rSource, rTarget, rRoll)
    	if #(rRoll.aDice) == 1 then
    		ActionsManager2.encodeDiceSwap(rRoll);
    	end
    end
    scripts/manager_actions2.lua
    Code:
    function encodeDiceSwap(rRoll)
    	if ModifierStack.getModifierKey("PLUS1D") then
    		rRoll.aDice[1] = GameSystem.increaseActionDie(rRoll.aDice[1]);
    		rRoll.sDesc = rRoll.sDesc .. " [+1D]";
    	end
    	
    	if ModifierStack.getModifierKey("PLUS2D") then
    		rRoll.aDice[1] = GameSystem.increaseActionDie(rRoll.aDice[1]);
    		rRoll.aDice[1] = GameSystem.increaseActionDie(rRoll.aDice[1]);
    		rRoll.sDesc = rRoll.sDesc .. " [+2D]";
    	end
    	
    	if ModifierStack.getModifierKey("MINUS1D") then
    		rRoll.aDice[1] = GameSystem.decreaseActionDie(rRoll.aDice[1]);
    		rRoll.sDesc = rRoll.sDesc .. " [-1D]";
    	end
    	
    	if ModifierStack.getModifierKey("MINUS2D") then
    		rRoll.aDice[1] = GameSystem.decreaseActionDie(rRoll.aDice[1]);
    		rRoll.aDice[1] = GameSystem.decreaseActionDie(rRoll.aDice[1]);
    		rRoll.sDesc = rRoll.sDesc .. " [-2D]";
    	end
    end

  2. #2
    Your best bet is to add a lot of Debug.chat statements in all the various functions you have to see where the data is not as you expect.

    The modifiers to rolls are added during the DiceTowerManager.onDrop() function before it gets forwarded to the GM machine for final rolling.

    Regards,
    JPG

  3. #3
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,038
    Blog Entries
    7
    Thank you, Moon. I know you are busy with the FGU beta release so I really appreciate the reply.

    I needed to modify the 'handleDiceTower' function in the 'desktop/scripts/manager_dicetower.lua' file. I did not realize that dice tower rolls use different roll data. While the 5E ruleset does not need to change this function for ADV/DIS, apparently my dice swap buttons do. It was an easy fix from there...

    I will add this to the next update. I will probably wait until CoreRPG 3.3.9 is released so I can include any compatibility updates.

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