-
July 2nd, 2022, 10:32 #1
- Join Date
- Mar 2018
- Location
- Norway
- Posts
- 104
Removing modifier from dice results
I am working on a Warhammer 4th edt ruleset, and I need to remove the modifier from the dice total in the white box when rolling dice.
Basically in WH you add a modifer to your skill, not the dice roll. So I've edited the rollOutcome() so the chat results are correct.
But the modifier is still shown in the white box with the dice roll. I would like to just have ONLY the die result in the white box.
Is it possible to code the modifier away from the die roll result?
I am using the Ruleset Wizard and made a script for the roll. Could I just add another function to this script?
-
July 2nd, 2022, 14:37 #2
-
July 2nd, 2022, 17:39 #3
- Join Date
- Mar 2018
- Location
- Norway
- Posts
- 104
I tried just adding that code in the beginning of the script, but that didn't seem to work. Probably just put it in the wrong place.
I'll explain a bit more in detail what I am doing.
I have instructed the numberfield to run skillroll.SkillHandler when rolling dice.
Code:function SkillHandler(rSource, rTarget, rRoll) local rMessage = ActionsManager.createActionMessage(rSource, rRoll); --local adv = DB.getValue(ActorManager.getCreatureNode(rSource), "advantage_field", 0); local mod = rRoll.nMod local nTarget = rRoll.skill+mod local nTotal = ActionsManager.total(rRoll)-mod; rMessage.text = rMessage.text; rMessage.text = rMessage.text .. ": " .. "[".. nTarget .."]" .. " vs. [" .. nTotal .. "]" .. "\n" .."Outcome: " .. rollOutcome(nTotal, nTarget, adv); if rTarget then rMessage.text = rMessage.text .. " vs " .. rTarget.sName; end Comm.deliverChatMessage(rMessage); end
What I would like is that the field I marked in red, in the picture below, is not there.
And the result on the right most place should be equal to the die result.
Is this even possible?
Capture.JPG
-
July 2nd, 2022, 22:06 #4
I bet if you go back and look at rRoll, you will find it is a function that adds in the modifier. Sk either you need to overwrite that where it is defined, or don't use it and just use the diceRollString like damned suggested.
Note, on my p hone so can't open up the rulesets to check, and just getting into doing myself so I could well be wrong. But that's what I would look at.
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
July 3rd, 2022, 01:35 #5
My specific code was showing the absolute bare minimum for a onBeforeDiceRoll() it was unlikely to be exactly what you want.
In this case I think you should approach it differently.
In your NumberField set Use Modifier Stack to False
Set Re3set Modifier Stack to False
in your Roll use something like:
Code:local nMod = ModifierStack.getSum(); ModifierStack.reset();
-
July 3rd, 2022, 11:08 #6
- Join Date
- Mar 2018
- Location
- Norway
- Posts
- 104
Thanks damned. That worked perfectly! Just need to fix up the script for the results, but that's the easy part.
This forum is helping me immensly with this project. So just a general thanks to everyone here!
-
July 3rd, 2022, 11:15 #7
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks