View Full Version : Custom Die Icons
Foen
March 3rd, 2010, 22:38
In case folks haven't noticed this, ragamer has come up with a great way of delivering custom die result icons in FG. It is possible to have custom icons in the chat window depending on the die result, and that might be useful for people who use fudge/fate dice, or WoD-type successes/failures.
It doesn't change the 3d model used to roll the dice, but does change the way the results are reported in the chat box. I can't find a way to disable the number value printed in the centre of the image, but I attach a screen shot of a modified d4 showing the different icons.
All credit is due to ragamer, and the thread explaining how it can be done is here (https://www.fantasygrounds.com/forums/showthread.php?t=11857).
This old dog has just learned anew trick ;)
Foen
Foen
March 3rd, 2010, 22:43
I forgot to say, but I just changed the icon colour to prove the point: there is no reason whay different results might not show ticks, crosses, skulls, etc.
joshuha
March 3rd, 2010, 23:47
I have played around with something similar to this awhile ago but without being able to remove the numbers it really makes pure custom icons as dice hard to do. It is great for things like Fudge dice though.
Zeus
March 4th, 2010, 00:13
Hey thats useful. I'm going to update my 4E Fumble Roll extension to take make use of this.
Thanks for the heads up.
ragamer
March 4th, 2010, 00:38
Just wanted to add a few caveats:
- When you hand-pick a custom die on the radial menu and then "multiply it" by right clicking, FG engine exhibit a strange behaviour: the .result value is calculated appropiately following whatever custom onResult() event you have programmed on the customdie but... The string coming on .type is only valid for the 1st die, the rest is identified as the base die string. For example, if you select d3 option and then right click twice (for a 3d3 roll), the dice.type value you will get is {"d3","d6","d6"}, but the dice.result will be correctly appearing as a table of 3 integers between 1-3. This OFC, breaks the logic of my dirty trick to detect which dies need to be "translated" in this case of manually hand-picking multiple custom dice.
- I was playing a bit with the .result fields and is perfectly possible to "toy with them" as much as pleased to generate subtotals, compacted wild-die rolls, etc, etc but, as whatever string you put there is converted to an integer value, indeed, is impossible to remove the number unless... I can make the font used for it invalid and showing only blanks... But as it's too late today I will look into a potential "font hacking" solution some other day.
Foen
March 4th, 2010, 05:35
I also looked at the font, but it is defined system-wide (dieresult) and it doesn't seem you can change it just for one chat message or one die.
ragamer
March 4th, 2010, 10:06
Mmm interesting, so if your ruleset ONLY use numberless dice you can take advantage of a modified font were numbers are replaced by blanks so you can show full icons as the rest of functionality of your ruleset will not be altered.
Foen
March 4th, 2010, 18:38
The other option would be to replace the digit zero with a blank, provided none of your other rolls gave a zero response: I think the only standard FG die to return zero is the tens die in a d100 roll.
ragamer
March 4th, 2010, 19:36
That's a great suggestion, Foen... Indeed.
kalmarjan
March 5th, 2010, 18:31
IIRC, after doing custom dice on my own, the numbers are called up as a font. Perhaps a workaround is to have the special characters mapped to the numbers in the font before you package it together. I was going to look into that, but I forgot a long time ago.
cylone
March 6th, 2010, 19:09
All this has me wondering, would it be possible to jury-rig the new Warhammer rpg dice in any way or form?
( https://www.fantasyflightgames.com/edge_news.asp?eidn=778 ) (dice explanation)
This in particular makes me hopefull:
"if your ruleset ONLY use numberless dice you can take advantage of a modified font were numbers are replaced by blanks so you can show full icons"
Or perhaps replacing the font used in all dicerolls(i believe this is different than the one used in general chat) with custom symbolbased font? (such a font already exists btw)
Heck id be thrilled with just getting letters instead of numbers
ie: SSFD... (success,success,failure,delay...)
Some sort of table lookup if thats even possible in FG?
This would definitely push me towards staying with FG instead of having to learn Maptool :(
Foen
March 7th, 2010, 13:12
Looks quite possible, but it would need to be built into the ruleset (quite hard to link in to onDiceLanded from an extension).
cylone
March 7th, 2010, 14:12
Foen could you perhaps help me start by making just the code for one example die and i can extrapolate from that.
Here's the simplest one:
Blank, Blank, Blank, Symbol 2, Symbol 2, Symbol 1
Also after checking some things mentioned in this topic, the dice icon image, seems there is just one per dice (what would be needed is an image per dice face).
Foen
March 7th, 2010, 15:01
Happy to help, but I'm on hols ATM and hence away from my computer. I'll take a look when I get back next weekend.
Foen
cylone
March 8th, 2010, 03:03
That is great. Thank you in advance.
ragamer
March 8th, 2010, 12:07
No special treatment needed... Just remember that the dice font applies to ALL rolls that are passed to the chatbox entries.
AFAIK most "non numerical" dices are d6 so you will just need to replace on your custom font "1", "2", "3", "4", "5", "6" by the corresponding symbols.
Another issue is the background numerical report... As FG engine will add the numbers on the default "result string", so in your example (Blank=1, Blank=2, Blank=3, Symbol 2=4, Symbol 2=5, Symbol 1=6) a roll of (Blank, Symbol 2, Symbol 1) will be reported numerically as a number between 11 and 14.
So you need to add custom code on OnDiceLanded() function (usually located at chat_chat.lua, assuming your "base" ruleset is the Generic d20) to process the "result" and generate an adequate string.
Then you have the problem of a ruleset with DIFFERENT non numerical d6... Well, your option will be to use 7,8,9,0 as the extra faces and then tweak also on OnDiceLanded() the dice.result numbers so the correct "face" is shown when you send the chat_entry.
So, in short, your idea will allow for 10 "symbolic" faces that you can combine with a common dice icon, thus saving you the hassle of having to create multiple custom dice but... It will be limited in the ammount of different dices you can have on your ruleset.
EDIT: I forgot... The XML resources are spread between "graphics.xml" and "gameelements.xml" if your "base" is the Generic d20 ruleset, just search for the string of the resource in the base directory *.xml files and you will locate were you should add them (Order of appearance is important on XML, so try to add them were the other resources are defined. There are some good XML editors that allow you to easily look for strings on multiple files in a given directory, I recomend you SCITE as it's a good editor that also manages LUA scripts very nicely).
i101
March 10th, 2010, 21:21
This sounds awesome.. So technically someone could do for example some HeroQuest dice by this, am I right?
Foen
March 10th, 2010, 22:39
Here is an example extension for the standard d20 ruleset. Please note that the code mucks around with the chat window mechanics (which is why I used d20 as a base: it has less complexity in its chat window code), so you cannot simply drop this code into a ruleset.
The chat_chat code changes are only in onDiceLanded, and only then in the highlighted section:
-- ################################################## #############################
--
-- New Code: change the Dice type after has been rolled but before is been shown on the chat
--
-- first generate a manual message
local entry = {};
entry.text = draginfo.getStringData();
entry.font = "systemfont";
entry.dice = {};
entry.diemodifier = draginfo.getNumberData();
if User.isHost() then
if ChatManager.getDieRevealFlag() then
entry.dicesecret = false;
end
entry.sender = GmIdentityManager.getCurrent();
else
entry.sender = User.getIdentityLabel();
end
-- now trigger the translation on dice of type "f6"
for i,v in ipairs(draginfo.getDieList()) do
if v.type=="f6" then
if v.result==1 then
table.insert(entry.dice,{type="fs6",result=0});
elseif v.result==2 then
table.insert(entry.dice,{type="fb6",result=0});
else
table.insert(entry.dice,{type="ff6",result=0});
end
else
table.insert(entry.dice,v);
end
end
-- deliver the modified die message
deliverMessage(entry);
return true;
--
-- ################################################## #############################
While the code changes the dice graphics (to a ticked, crossed or blank d6) it does not get rid of the die result. It changes this to zero, however, so someone else (who knows how to do such things) can create a replica font for the die results with a blank in place of the character for zero.
To test this extension, type /die 4f6 or else roll the f6 die from the d6 right-click menu.
Hope that helps
Foen
drahkar
March 11th, 2010, 01:05
This definitely has a huge amount of potential. I'll have to look into it more deeply once I have time to focus on bits that aren't pertinent to the current project.
Foen
March 11th, 2010, 05:59
It was ragamer who first posted it: to him the kudos!
Foen
cylone
March 16th, 2010, 01:10
OMFG! This is great. Ive just seen it, unfortunatelly dont have the time to mess with it, but when i do i'll try and do the funky warhammer dice.
Thanks Foen and Ragamer!
VenomousFiligree
June 29th, 2010, 20:27
Any progress on this one? Warhammer dice would be excellent!
cylone
July 1st, 2010, 13:51
Sorry but no.
It is just infinitely more easier to do it in Maptools.
shaggynick
July 17th, 2010, 19:35
I'm new to Fantasy Grounds but from the looks of it there is no way to change out the 3d Dice in the game?
Moon Wizard
July 18th, 2010, 02:27
Shaggynick,
What are you trying to do?
Currently, you can customize the color of the dice by using the color palette in the upper right corner.
Cheers,
JPG
shaggynick
July 18th, 2010, 03:31
I actually wanted to change what is displayed on the 3d dice themselves instead of the traditional numbers.
Moon Wizard
July 18th, 2010, 05:07
You can change the font displayed on the dice icons in the chat window (i.e. the results), but the numbers on the 3D dice are part of the textures/shape of the dice and not editable.
Cheers,
JPG
Talen
July 21st, 2010, 02:39
Hey thats useful. I'm going to update my 4E Fumble Roll extension to take make use of this.
Thanks for the heads up.
Is the fumble extension part of your house rules at your resources page? Ive been looking for a good 4e fumble table!
Oberoten
July 21st, 2010, 06:02
You can change the font displayed on the dice icons in the chat window (i.e. the results), but the numbers on the 3D dice are part of the textures/shape of the dice and not editable.
Cheers,
JPG
Any chance we might be seeing "skins" for the dice sometime in the future? I'd love to have my cow-pattern dice for a westerngame.
- Obe
Zeus
July 21st, 2010, 18:06
Is the fumble extension part of your house rules at your resources page? Ive been looking for a good 4e fumble table!
Yes. The optional House Rules and Fumbles on natural Attack Rolls of 1 rules are implemented as part of my 4E House Rules extension.
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.