DICE PACKS BUNDLE
  1. #1

    [Programming] Dice names in xml?

    Hey guys! so I finally got a copy of the Unity version, and decided today i'd poke in at fixing the code for the Alien RPG.

    I've got it working for the most part, but I notice something. First, I'm getting errors to start, which is probably leading to the next issues I have.

    Code:
    [4/9/2020 11:28:26 PM] [<color="red">ERROR</color>]  die: Name (d3.1) must be alphanumeric value. [AlienRPGtestphase] [definitions/dice.xml]
    
    [4/9/2020 11:28:26 PM] [<color="red">ERROR</color>]  die: Name (d3.2) must be alphanumeric value. [AlienRPGtestphase] [definitions/dice.xml]
    this appears at loadup for all the "die: Name"s. Obviously, I can't have "." in there anymore? This is part of the Custom Die extension, which was included within my code to bring in the new dice (dS, and dB, d60, d66, d600, d666).

    Second thing, when i roll any dice, d6 or anything, no box or graphics show the die results or the dice rolled.

    i imagine i just have to rename the die faces in the definitions/dice.xml but I'm not sure what that would be.

    I'll include my .pak file. the new dice should show at the bottom as icons next to the d6, but can be rolled from the stats of a character sheet if the number is above 0.

    thanks for any advice
    Attached Files Attached Files

  2. #2

  3. #3
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    I've just had to do the same for The One Ring to get the custom dice to show up. I renamed the dice as damned suggests, replacing the "." with "r" (e.g. d6r1, d6r2, etc.). I've then had to use the Adobe Blank font to hide the actual die results, to avoid the results numbers being shown on the custom dice faces.

    See:
    https://www.fantasygrounds.com/forum...accepts-period
    https://www.fantasygrounds.com/forum...nversion/page7
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  4. #4
    Quote Originally Posted by Valarian View Post
    I've just had to do the same for The One Ring to get the custom dice to show up. I renamed the dice as damned suggests, replacing the "." with "r" (e.g. d6r1, d6r2, etc.). I've then had to use the Adobe Blank font to hide the actual die results, to avoid the results numbers being shown on the custom dice faces.

    See:
    https://www.fantasygrounds.com/forum...accepts-period
    https://www.fantasygrounds.com/forum...nversion/page7
    i appear to be lacking the graphic results now. i got the errors to stop, following Damned's advice; but rolling dice just create a chat entry, nothing saying how many of what die were rolled and what the result was. My custom dice do tell me via chat how many successes or fails there are, but i can't see the result of a d6 or d60 etc. etc. even if i roll a table, i don't know what number i rolled, i just get the text from that table column.

    examplediceresults.png

    might be worth noting that i started this project back in august, so if there were important changes to the custom dice extension, i might need to have a gothrough of that

  5. #5
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    Did you change the dice handlers when changing the results to the custom dice graphics?

    e.g.
    Code:
    dicetable[n].type = dicetable[n].type .. "." .. dicetable[n].result;
    to
    Code:
    dicetable[n].type = dicetable[n].type .. "r" .. dicetable[n].result;
    The die handler code needs to be changed to replace the "." with whatever you've used instead (e.g. "r") so that when the d6 is rolled is goes to the d6r1 icon graphic instead of d6.1
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  6. #6
    Quote Originally Posted by Valarian View Post
    Did you change the dice handlers when changing the results to the custom dice graphics?

    e.g.
    Code:
    dicetable[n].type = dicetable[n].type .. "." .. dicetable[n].result;
    to
    Code:
    dicetable[n].type = dicetable[n].type .. "r" .. dicetable[n].result;
    The die handler code needs to be changed to replace the "." with whatever you've used instead (e.g. "r") so that when the d6 is rolled is goes to the d6r1 icon graphic instead of d6.1
    ah ok i figured out what you mean. awesome. that is looking a lot better. Now, i don't know if you worked it out yet or not, but i think I'm having the issue Trenloe was having. Was there a workaround? Thanks for the help btw.

    examplediceresults.png

  7. #7
    Quote Originally Posted by damned View Post
    Rename the dice something like d301, d302 etc
    instead of making a whole new thread, since i mentioned it within this one, what changed about <buttonfield><frame></fame></buttonfield>? it seems that none of my buttons show frames anymore, nor do my <windowlist><frame></frame></windowlist>

    edit: actually, I'm not totally sure about this. it seems a fair amount of the frames are working for the character sheets, but some buttons and the npc list are not showing frames.
    Last edited by pr6i6e6st; April 10th, 2020 at 23:42.

  8. #8
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,693
    Blog Entries
    1
    Quote Originally Posted by pr6i6e6st View Post
    instead of making a whole new thread, since i mentioned it within this one, what changed about <buttonfield><frame></fame></buttonfield>? it seems that none of my buttons show frames anymore, nor do my <windowlist><frame></frame></windowlist>

    edit: actually, I'm not totally sure about this. it seems a fair amount of the frames are working for the character sheets, but some buttons and the npc list are not showing frames.
    I havent seen that - sorry.

  9. #9
    figured out the second issue. seems that the <buttoncontrol><frame></frame></buttoncontrol> format won't work anymore in unity, and it needs to look more like <buttoncontrol><frame name="fielddark" offset="0,0,0,0" /></buttoncontrol>

    to clarify, this is what i had before
    Code:
    <buttonfield name="type">
    				<anchored width="90" height="30">
    					<top parent="columnanchor" anchor="bottom" relation="relative" offset="0" />
    					<left offset="97" />
    				</anchored>
    				<state text="Vehicle" />
    				<state text="EEV" />
    				<state text="Starship" />
    				<default>0</default>
    				<color>000000</color>
    				<frame>fielddark</frame>-----------------------<<<<here
    				<font>reference-r</font>
    				<script>
    					function onInit()
    						onValueChanged();
    					end
    					function onValueChanged()
    						window.update();
    					end
    				</script>
    			</buttonfield>
    and this is what i have now and works in unity
    Code:
    <buttonfield name="type">
    				<anchored width="90" height="30">
    					<top parent="columnanchor" anchor="bottom" relation="relative" offset="0" />
    					<left offset="97" />
    				</anchored>
    				<state text="Vehicle" />
    				<state text="EEV" />
    				<state text="Starship" />
    				<default>0</default>
    				<color>000000</color>
    				<frame name="fielddark" offset="0,0,0,0" />-------------------<<<<here
    				<font>reference-r</font>
    				<script>
    					function onInit()
    						onValueChanged();
    					end
    					function onValueChanged()
    						window.update();
    					end
    				</script>
    			</buttonfield>
    Last edited by pr6i6e6st; April 11th, 2020 at 02:24.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in