Thread: Stop Save Confusion!
-
March 29th, 2020, 20:38 #21
.
thx @celestian.
1) so essentially, to show an image in-post, you have to host image somewhere else then include link, instead of uploading image into post. correct?
2) regarding how to get that failed / save text into the interface.... i kept (re)reading and was really not quite getting how it could happen.
is someone planning to do an extension, or do i have to do some code hacking in certain file(s)?
this would be for pfrpg(1) btw
-----
roll dice. it builds character.
-
March 29th, 2020, 20:45 #22
Correct, I use imgur.com and a screen snipping tool called ShareX (windows) that uploads directly to it. I just snip, it puts the url in copy buffer and I paste it in.
For PF it would depend on where they manage saves. I don't know much about PF as I said but I think it's layered on 3.5e ruleset and the location is the same there. Depending on how it displays all you'd need to do is tweak the text to your liking. You'd want to check that "rOrigin" exists and if it does then you can assume it's a save because someone forced them. Otherwise you probably want to leave the text alone.
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 " .. ActorManager.getDisplayName(rSource) .. "]"; msgLong.text = msgLong.text .. " [for " .. ActorManager.getDisplayName(rSource) .. "]"; end if rOrigin then msgShort.text = msgShort.text .. " [vs " .. ActorManager.getDisplayName(rOrigin) .. "]"; msgLong.text = msgLong.text .. " [vs " .. ActorManager.getDisplayName(rOrigin) .. "]"; 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 = ""; if rAction.sSaveResult == "autosuccess" or rAction.sSaveResult == "success" then if rAction.sSaveResult == "autosuccess" then msgLong.text = msgLong.text .. " [AUTOMATIC SUCCESS]"; else msgLong.text = msgLong.text .. " [SUCCESS]"; end 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 if rAction.sSaveResult == "autofailure" then msgLong.text = msgLong.text .. " [AUTOMATIC FAILURE]"; else msgLong.text = msgLong.text .. " [FAILURE]"; end 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
---
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.
-
March 29th, 2020, 22:56 #23
It is fairly easy as Celestian outlined But beware, since I know you use my extensions, this will surely be incompatible with my extension, so you may have to open my extension and change that there rather than writing an own extension When you tell me which extension you use, then I can change it for you, too but I do not intend to change it in general, would just be for you then, because my mind is already used to think in the perspective of the person who saves such that the chat and the save overlays (as here https://www.fantasygrounds.com/forum...ea-from-Ken-L) , just in case you did not know about that ) already make sense for me; also it would take me now too much time to change the overlays, too, to respect the other perspective
My extensions for 3.5e and Pathfinder
Bug reports please here
-
March 29th, 2020, 23:15 #24---
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.
-
March 29th, 2020, 23:21 #25My extensions for 3.5e and Pathfinder
Bug reports please here
-
March 29th, 2020, 23:35 #26
To make sure we're talking about the same thing... while you might be overriding manager_action_save if you're not directly altering the function I mentioned he could do a narrow override of just that and not break your work using his own custom global script and changing it via
Code:function onInit() ActionSave.applySave = applySaveCustom; end function applySaveCustom(rSource, rOrigin, rAction, sUser) ... etc... end
Sorry if I'm preaching to the choir here but this was something that I didn't learn for a while and it's been extremely useful.---
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.
-
March 30th, 2020, 00:05 #27
Thanks, and yes, I understood I am doing such approaches from time to time, too, when I think about that (most of the time I forget that ) What I meant before, is that I indeed overwrite the function applySave, too (because evasion is coded there, too, in 3.5/PF1 and I improved that code to make these effects a bit more versatile )
Last edited by Kelrugem; March 30th, 2020 at 00:07.
My extensions for 3.5e and Pathfinder
Bug reports please here
-
March 30th, 2020, 00:16 #28
But, moreover, in that special situation an overwrite of the function would not work when I remember Moon Wizard's instruction with respect to that (even when I would not overwrite it) The reason for this is that applySave gets called in the script manager_action_save.lua, too (e.g. in handleApplySave by the line applySave(rSource, rOrigin, rAction)), and the approach with using onInit etc. as you did, literally overwrites ActionSave.applySave but not applySave such that internal calls of this function would still use the original function Thence, one can only replace functions in that way when there are no internal calls of this function (but maybe when the internal call is also via ActionSave.applySave instead of just via applySave?)
Moon Wizard, please correct me when I remember this wronglyMy extensions for 3.5e and Pathfinder
Bug reports please here
-
March 30th, 2020, 09:06 #29
please note I use inline images all the time and i use them from images i upload in the post, as in, not uploaded externally.
-
March 30th, 2020, 11:40 #30
For inline images, upload the attachment as usual. Then temporarily add a link to it to the post (click on the right side of the attachment button and select the attachment name). This will give you an attachment link with the attachment number.
Then add the following to your post, replacing XXXXX with the attachment number you got from the link. Replace the curly brackets around the first IMG to square brackets [IMG] - I had to change these to allow the forum to display the data:
Code:{IMG}https://www.fantasygrounds.com/forums/attachment.php?attachmentid=XXXXX[/IMG]
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!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks