PDA

View Full Version : Remodel D10 to 0-9 instead of 1-10



Hitcher
May 20th, 2014, 14:09
Hi,

I am currently trying to modify CoreRPG to emulate "Immortal: The Invisible War". In this system, the d10 is defined as 0-9 instead of 1-10.

The revamp of the character sheets had not been that big of a problem, but where and how can I re-define a dice in this way? Can someone sport me a hint?

Hitcher

Trenloe
May 20th, 2014, 16:33
You can't change the "10" showing on the actual dice rolling as this is built into the 3d model and dice skinning is not available (yet).

However, you can change the 10 to a 0 after the roll and display this in the roll results.

If you are using CoreRPG you can add some code to the createActionMessage function in scripts\manager_actions.lua:


function createActionMessage(rSource, rRoll)
local sDesc = rRoll.sDesc;

-- Build the basic message to deliver
local rMessage = ChatManager.createBaseMessage(rSource, rRoll.sUser);
rMessage.type = rRoll.sType;
rMessage.text = rMessage.text .. sDesc;
rMessage.dice = rRoll.aDice;
rMessage.diemodifier = rRoll.nMod;

-- Code to change 10 rolled on a d10 to a 0
for k,v in ipairs (rRoll.aDice) do
--Debug.console("Index = " .. k .. ", type = " .. v.type .. ", result = " .. v.result);
if v.type == "d10" and v.result == 10 then
rRoll.aDice[k].result = 0;
end
end

-- Check to see if this roll should be secret (GM or dice tower tag)
...
...

You can remove the comments from the Debug.console commands to see the format of the rRoll.aDice table, more info on that here: https://www.fantasygrounds.com/refdoc/Comm.xcp

Here's an example of the output where 5d10 were rolled and the 10 has been replaced with the 0:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/d10%2010%20to%200.jpg

damned
May 20th, 2014, 17:20
Trenloe has used this in the Star Wars: Edge of the Empire to create the special dice... you still see the standard dice roll in chat window but the results will show the custom skins from that game. Check it out to see how that will work for you.

Hitcher
May 21st, 2014, 06:40
Thanks a lot. This worked very well, and I could also directly embedd the message in case of a critical failure or critical success. Thanks for your fast and perfect help. One Step further towards a working ruleset :-)