PDA

View Full Version : <die> name no longer accepts period



Trenloe
December 21st, 2019, 14:07
For custom dice result graphics, the Star Wars: Edge of the Empire community ruleset uses the <die> name.result name to display the correct die face icon in the chat window.

For example:


<!-- dBoost -->
<customdie name="dBoost">
<model>d6</model>
<menuicon>customdice</menuicon>
</customdie>
<die name="dBoost.1"><icon>dBoosticon.1</icon></die>
<die name="dBoost.2"><icon>dBoosticon.2</icon></die>
<die name="dBoost.3"><icon>dBoosticon.3</icon></die>
<die name="dBoost.4"><icon>dBoosticon.4</icon></die>
<die name="dBoost.5"><icon>dBoosticon.5</icon></die>
<die name="dBoost.6"><icon>dBoosticon.6</icon></die>

But, with this, I get multiple warnings (one for each <die> entry) as follows: [12/21/2019 6:55:29 AM] [WARNING] die: Name attribute must be alphanumeric value. (Star Wars EotE) (definitions/dice.xml)

I changed the <die> definition and the underlying code to replace the period (.) with a r and this doesn't give the error anymore:

<!-- dBoost -->
<customdie name="dBoost">
<model>d6</model>
<menuicon>customdice</menuicon>
</customdie>
<die name="dBoostr1"><icon>dBoosticon.1</icon></die>
<die name="dBoostr2"><icon>dBoosticon.2</icon></die>
<die name="dBoostr3"><icon>dBoosticon.3</icon></die>
<die name="dBoostr4"><icon>dBoosticon.4</icon></die>
<die name="dBoostr5"><icon>dBoosticon.5</icon></die>
<die name="dBoostr6"><icon>dBoosticon.6</icon></die>

And the dice roll and show in the chat window:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=30948

However, there are two issues with this:

1) The die numerical result is superimposed on top of the icon. In FGC I'd use a font called "dieresult" that doesn't have any numeric characters in it, which stops the number being shown on the dice icon. Do I have to do the same in FG Unity or is there an easier way to not display the die result in the result icon?
2) The die name is being shown above each die - for example, in the above: dBoostr3+dBoostr4+dBoostr6 can this be turned off?

To give an idea of what I'd see in FG Classic:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=30949

Moon Wizard
December 26th, 2019, 19:10
Yes, the die names must be alphanumeric, so that all the new dice expression logic will continue to work.

Can you paste the code that builds the results, or point me to it?

There are actually some new options in the chat output for dice that haven't been needed yet, but are built into FGU already. In addition to "type" and "result", there are now the following fields for each die display:
"backcolor"
"icon"
"iconcolor"
"font"
"fontcolor"
(And a few more for later, regarding modes, sets, etc.)

I'm thinking that instead of replacing the die as you did in FGC, you could just specify an "icon", which overrides the default die icon; and you could try setting the color to "00000000" (i.e. zero alpha channel). I'm not sure if that will work, but I think it might.

Regards,
JPG

Valarian
April 9th, 2020, 10:33
For The One Ring ruleset, I've used the Adobe Blank (https://github.com/adobe-fonts/adobe-blank) font to display the die results. This hides the results and lets the custom graphic be displayed without dice text showing.

License
33320

pr6i6e6st
April 11th, 2020, 15:31
Was it ever figured out how to remove the text above the result icons? or was there a way to get the text results to merge rather than show each result (i.e. to show "2d6" instead of "1d6r6+1d6r3")?

edit: figured out how to at least get rid of the dice expressions at the top. it's in gameelements.xml. line 27 of the CoreRPG file. the <font expression="diceexpr" can be changed to something nil to remove the expression for now. I'm still trying to figure out if i can access it with the custom dice code and intercept it somehow but the only places i can find "diceexpr" is gamelements and graphics_fonts.xml.

pr6i6e6st
April 14th, 2020, 21:34
Did the Adobe Blank font stop working for anyone else after today's update? or is something messed up on my end?

Valarian
April 23rd, 2020, 07:57
Did the Adobe Blank font stop working for anyone else after today's update? or is something messed up on my end?
Seems the update is now blocking the font. I've got an error when loading that wasn't happening a couple of weeks ago.
[4/23/2020 7:40:10 AM] FGU v4.0.0 ULTIMATE (2020-04-17)
[4/23/2020 7:40:10 AM] Launcher scene starting.
[4/23/2020 7:52:15 AM] Daily session backup created.
[4/23/2020 7:52:15 AM] Starting cloud server mode. [Valarian]
[4/23/2020 7:52:21 AM] Game server started. [128.199.60.165:53157]
[4/23/2020 7:52:22 AM] Launcher scene exiting.
[4/23/2020 7:52:22 AM] Match successfully created on lobby.
[4/23/2020 7:52:22 AM] Tabletop scene starting.
[4/23/2020 7:53:18 AM] [<color="red">ERROR</color>] font: Unable to load file (graphics/fonts/Adobe Blank 400.ttf) for font (dieresult). [TheOneRing] [graphics/graphics_fonts.xml]

Moon Wizard
April 25th, 2020, 00:46
We've been working on a replacement font engine for speed and supporting more fonts. Unfortunately, we found that some other more esoteric fonts are having issues. (some of the language fonts, and a few others). You can try looking for an alternate; or wait for the next font update (not necessarily next build). Carl is looking at an option that is even more low level than the last one to better support more fonts.

Regards,
JPG

Carter77
May 17th, 2020, 06:44
Hello,

I have the same issue on an extension which allow to roll Legend of the Five Rings 5th edition dices (L5RCustomDice.ext).
I installed it on FGU and based on the information indicated on this topic I do the following changes :
- rename in dice.xml the dice code by replacing "." by "r" :
<die name="d6"><icon>d6icon</icon><position>470,-70</position></die>
<die name="d6.1"><icon>d6icon.1</icon></die>
<die name="d6.2"><icon>d6icon.2</icon></die>
<die name="d6.3"><icon>d6icon.3</icon></die>
<die name="d6.4"><icon>d6icon.4</icon></die>
<die name="d6.5"><icon>d6icon.5</icon></die>
<die name="d6.6"><icon>d6icon.6</icon></die>

by

<die name="d6"><icon>d6icon</icon><position>470,-70</position></die>
<die name="d6r1"><icon>d6icon.1</icon></die>
<die name="d6r2"><icon>d6icon.2</icon></die>
<die name="d6r3"><icon>d6icon.3</icon></die>
<die name="d6r4"><icon>d6icon.4</icon></die>
<die name="d6r5"><icon>d6icon.5</icon></die>
<die name="d6r6"><icon>d6icon.6</icon></die>

- renaming in the actionmanageroverrides.lua file the following line
newDie.type = v.type .. "." .. v.result;
by
newDie.type = v.type .. "r" .. v.result;


But when I roll d6 and d12 in the chat nothing appears.

If someone knows what is wrong or missing in the code it would be very nice of him.
The original extension is here (https://drive.google.com/open?id=1kMum7tWdMA6ydR3hV_QLgwaAjQDhyStn)

The FGU one is there (https://drive.google.com/open?id=1dC517xKykDg5WcGtrMBhfg143XreCiKf)

Thanks in advance.

Carter

pindercarl
May 17th, 2020, 15:51
Seems the update is now blocking the font. I've got an error when loading that wasn't happening a couple of weeks ago.
[4/23/2020 7:40:10 AM] FGU v4.0.0 ULTIMATE (2020-04-17)
[4/23/2020 7:40:10 AM] Launcher scene starting.
[4/23/2020 7:52:15 AM] Daily session backup created.
[4/23/2020 7:52:15 AM] Starting cloud server mode. [Valarian]
[4/23/2020 7:52:21 AM] Game server started. [128.199.60.165:53157]
[4/23/2020 7:52:22 AM] Launcher scene exiting.
[4/23/2020 7:52:22 AM] Match successfully created on lobby.
[4/23/2020 7:52:22 AM] Tabletop scene starting.
[4/23/2020 7:53:18 AM] [<color="red">ERROR</color>] font: Unable to load file (graphics/fonts/Adobe Blank 400.ttf) for font (dieresult). [TheOneRing] [graphics/graphics_fonts.xml]

I have verified that AdobeBlank.ttf is working with the latest font updates.