STAR TREK 2d20
  1. #1

    Saving Throw issue

    Sorry to post another but it seems that in 3.5E when you do a save vs a DC such as in the party sheet or when a spell with a save is cast, it is not counting a roll of 1 or 20 properly. As I recall in 3.5E for Attack rolls and Saving Throws a roll of a 1 on the dice is always a miss or fail and a roll of a 20 on the dice is always a hit or success, but in Fantasy Grounds its purely going off of roll total vs DC. So I can roll a 1 and succeed as long as it was higher then the DC and I can roll a 20 and fail.

  2. #2
    Ok so I think I found how to fix this, its all in manager_action_save.lua in functions handleApplySave, notifyApplySave and applySave. I will post those 3 functions below with the code changes.

    Code:
    function handleApplySave(msgOOB)
    	local rSource = ActorManager.getActor(msgOOB.sSourceType, msgOOB.sSourceNode);
    	local rOrigin = ActorManager.getActor(msgOOB.sTargetType, msgOOB.sTargetNode);
    	
    	local rAction = {};
    	rAction.bSecret = (tonumber(msgOOB.nSecret) == 1);
    	rAction.sDesc = msgOOB.sDesc;
    	rAction.nTotal = tonumber(msgOOB.nTotal) or 0;
    	rAction.nMod = tonumber(msgOOB.nMod) or 0; -- added 
    	rAction.sSaveDesc = msgOOB.sSaveDesc;
    	rAction.nTarget = tonumber(msgOOB.nTarget) or 0;
    	rAction.bRemoveOnMiss = (tonumber(msgOOB.nRemoveOnMiss) == 1);
    
    	applySave(rSource, rOrigin, rAction);
    end
    Code:
    function notifyApplySave(rSource, rRoll)
    	local msgOOB = {};
    	msgOOB.type = OOB_MSGTYPE_APPLYSAVE;
    	
    	if rRoll.bTower then
    		msgOOB.nSecret = 1;
    	else
    		msgOOB.nSecret = 0;
    	end
    	msgOOB.sDesc = rRoll.sDesc;
    	msgOOB.nTotal = ActionsManager.total(rRoll); -- nTotal = nTotal + rRoll.nMod;
    	msgOOB.nMod = rRoll.nMod; -- added
    	msgOOB.sSaveDesc = rRoll.sSaveDesc;
    	msgOOB.nTarget = rRoll.nTarget;
    	if rRoll.bRemoveOnMiss then msgOOB.nRemoveOnMiss = 1; end
    
    	local sSourceType, sSourceNode = ActorManager.getTypeAndNodeName(rSource);
    	msgOOB.sSourceType = sSourceType;
    	msgOOB.sSourceNode = sSourceNode;
    
    	if rRoll.sSource ~= "" then
    		msgOOB.sTargetType = "ct";
    		msgOOB.sTargetNode = rRoll.sSource;
    	else
    		msgOOB.sTargetType = "";
    		msgOOB.sTargetNode = "";
    	end
    	
    	Comm.deliverOOBMessage(msgOOB, "");
    end
    Code:
    function applySave(rSource, rOrigin, rAction, sUser)
    	local msgShort = {font = "msgfont"};
    	local msgLong = {font = "msgfont"};
    	
    	msgShort.text = "Save";
    	msgLong.text = "Save [" .. rAction.nTotal ..  "]";
    	if rAction.nTarget then
    		msgLong.text = msgLong.text .. "[vs. DC " .. rAction.nTarget .. "]";
    	end
    	msgShort.text = msgShort.text .. " ->";
    	msgLong.text = msgLong.text .. " ->";
    	if rSource then
    		msgShort.text = msgShort.text .. " [for " .. rSource.sName .. "]";
    		msgLong.text = msgLong.text .. " [for " .. rSource.sName .. "]";
    	end
    	if rOrigin then
    		msgShort.text = msgShort.text .. " [vs " .. rOrigin.sName .. "]";
    		msgLong.text = msgLong.text .. " [vs " .. rOrigin.sName .. "]";
    	end
    	
    	msgShort.icon = "roll_cast";
    		
    	local sAttack = "";
    	local bHalfMatch = false;
    	if rAction.sSaveDesc then
    		sAttack = rAction.sSaveDesc:match("%[SAVE VS[^]]*%] ([^[]+)") or "";
    		bHalfMatch = (rAction.sSaveDesc:match("%[HALF ON SAVE%]") ~= nil);
    	end
    	rAction.sResult = "";
    	-- added
    	local nDieRoll = rAction.nTotal - rAction.nMod;
    	-- end added
    	if (nDieRoll > 1 and rAction.nTotal >= rAction.nTarget) or nDieRoll == 20 then -- added 
    		msgLong.text = msgLong.text .. " [SUCCESS]";
    		
    		if rSource then
    			local bHalfDamage = bHalfMatch;
    			local bAvoidDamage = false;
    			if bHalfDamage then
    				local sSave = rAction.sDesc:match("%[SAVE%] (%w+)");
    				if sSave then
    					sSave = sSave:lower();
    				end
    				if sSave == "reflex" then
    					if EffectManager35E.hasEffectCondition(rSource, "Improved Evasion") then
    						bAvoidDamage = true;
    						msgLong.text = msgLong.text .. " [IMPROVED EVASION]";
    					elseif EffectManager35E.hasEffectCondition(rSource, "Evasion") then
    						bAvoidDamage = true;
    						msgLong.text = msgLong.text .. " [EVASION]";
    					end
    				end
    			end
    			
    			if bAvoidDamage then
    				rAction.sResult = "none";
    				rAction.bRemoveOnMiss = false;
    			elseif bHalfDamage then
    				rAction.sResult = "half_success";
    				rAction.bRemoveOnMiss = false;
    			end
    			
    			if rOrigin and rAction.bRemoveOnMiss then
    				TargetingManager.removeTarget(ActorManager.getCTNodeName(rOrigin), ActorManager.getCTNodeName(rSource));
    			end
    		end
    	else
    		msgLong.text = msgLong.text .. " [FAILURE]";
    
    		if rSource then
    			local bHalfDamage = false;
    			if bHalfMatch then
    				local sSave = rAction.sDesc:match("%[SAVE%] (%w+)");
    				if sSave then
    					sSave = sSave:lower();
    				end
    				if sSave == "reflex" then
    					if EffectManager35E.hasEffectCondition(rSource, "Improved Evasion") then
    						bHalfDamage = true;
    						msgLong.text = msgLong.text .. " [IMPROVED EVASION]";
    					end
    				end
    			end
    			
    			if bHalfDamage then
    				rAction.sResult = "half_failure";
    			end
    		end
    	end
    
    	ActionsManager.outputResult(rAction.bSecret, rSource, rOrigin, msgLong, msgShort);
    	
    	if rSource and rOrigin then
    		ActionDamage.setDamageState(rOrigin, rSource, StringManager.trim(sAttack), rAction.sResult);
    	end
    end
    that should be it.

  3. #3
    I guess you have to put it into the Pathfinder Modules Bug Report thread to get noticed, or The House of Healing...

  4. #4
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,797
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  5. #5
    At the time of my post I didn't know that it was to be fixed in the future release (never looked at the beta) but when I deleted my rule set for 3.5E and updated to Dev version it still wasn't working. Might be they were still working on it at that time and hadn't put it into the "Dev" file.
    Last edited by mr900rr; July 5th, 2018 at 02:30.

  6. #6
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,797
    Quote Originally Posted by mr900rr View Post
    At the time of my post I didn't know that it was to be fixed in the future release (never looked at the beta) but when I deleted my rule set for 3.5E and updated to Dev version it still wasn't working. Might be they were still working on it at that time and hadn't put it into the "Dev" file.
    I was just guessing it had been fixed; I don't play 3.5 so I have no idea what the issue is but I saw that in the test release and thought it might be your issue. But if it isn't then it hasn't been fixed. Incidentally Dev is not for you but Test is if you want to.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    This is a different issue to the one reported as fixed in the current test version.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #8
    Not sure I understand the "Dev is not for you" part in your comment, in the updater there is three options "Live", "Test" and "Dev", am I not supposed to click the "Dev" option which I assume is the beta?

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    Quote Originally Posted by mr900rr View Post
    Not sure I understand the "Dev is not for you" part in your comment, in the updater there is three options "Live", "Test" and "Dev", am I not supposed to click the "Dev" option which I assume is the beta?
    See the information on testing here: https://www.fantasygrounds.com/forum...public-testing!

    The current beta test package is in the "test" channel. "Dev" is reserved for the developers and they can load anything into that channel at anytime, such as custom debug code to try to catch a specific issue - don't use it unless the FG devs ask you specifically to use it. Use "test" to access the current version of FG in test.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  10. #10
    Oh, well they need to have a window pop up when you select that option informing of this with a confirm button, I don't think a majority of users would know that and come to the forums to ask before clicking it to try the latest version. I have had the software since like 2013 and never knew this till now.

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
  •  
DICE PACKS BUNDLE

Log in

Log in