Starfinder Playlist
Page 4 of 4 First ... 234

Thread: Custom Dice?

  1. #31
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,244
    Blog Entries
    9
    Quote Originally Posted by antaskidayo View Post
    is there a step by step process for a newbie like me?
    It requires that you write an extension. There is no step by step guide to create this type of extension, because extensions are capable of doing so many different things.

    There is step by step guide for creating a custom decal extension, see the section on Custom Decal Extension section on this page.
    The Developer Guides have more detailed info.
    Then as mentioned in this post, you will want to take apart an existing extension that does something similar to what you want to get some ideas.

    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.

  2. #32
    I'm trying to make a zero-based D10 (0-9) and not having much luck getting it to work. I'm trying to replace the 10 face of the d10 with a 0 face.

    This is in an extension for MoreCore. Here's what I have right now:

    Extension.xml
    Code:
    	<base>
    		<includefile source="gameelements.xml" />
    		
    		<!-- Graphics -->
    		<includefile source="graphics/dice/d10/base.xml" />
    gameelements.xml
    Code:
    <root>
    	<die name="d4" merge="delete" />
    	<die name="d6" merge="delete" />
    	<die name="d8" merge="delete" />
    	<die name="d12" merge="delete" />
    	<die name="d20" merge="delete" />
    	<die name="dF" merge="delete" />
    	
    	<die name="d10">
    		<icon>d10icon</icon>
    		<position>270,-60</position>
    	</die>
    	<die name="d10.1"><icon>d10icon.1</icon></die>
    	<die name="d10.2"><icon>d10icon.2</icon></die>
    	<die name="d10.3"><icon>d10icon.3</icon></die>
    	<die name="d10.4"><icon>d10icon.4</icon></die>
    	<die name="d10.5"><icon>d10icon.5</icon></die>
    	<die name="d10.6"><icon>d10icon.6</icon></die>
    	<die name="d10.7"><icon>d10icon.7</icon></die>
    	<die name="d10.8"><icon>d10icon.8</icon></die>
    	<die name="d10.9"><icon>d10icon.9</icon></die>
    	<die name="d10.10"><icon>d10icon.0</icon></die>
    graphics/dice/d10/base.xml
    Code:
    <root>
    	<icon name="d10icon" file="graphics/dice/d10/d10.png" />
    	<icon name="d10icon.1" file="graphics/dice/d10/d10.1.png" />
    	<icon name="d10icon.2" file="graphics/dice/d10/d10.2.png" />
    	<icon name="d10icon.3" file="graphics/dice/d10/d10.3.png" />
    	<icon name="d10icon.4" file="graphics/dice/d10/d10.4.png" />
    	<icon name="d10icon.5" file="graphics/dice/d10/d10.5.png" />
    	<icon name="d10icon.6" file="graphics/dice/d10/d10.6.png" />
    	<icon name="d10icon.7" file="graphics/dice/d10/d10.7.png" />
    	<icon name="d10icon.8" file="graphics/dice/d10/d10.8.png" />
    	<icon name="d10icon.9" file="graphics/dice/d10/d10.9.png" />
    	<icon name="d10icon.0" file="graphics/dice/d10/d10.0.png" />
    </root>
    graphics/dice/d10/d10.0.png
    d10.0.png

    not working.jpg

    What am I missing?
    Last edited by darrenan; June 6th, 2020 at 22:44.

  3. #33

  4. #34
    So you can't reskin the built-in dice? I'll give that try. Does the name matter? Would d10IS (for invisible sun) work just as well?

  5. #35
    I would appreciate a clear reason why what I'm doing above doesn't work? I feel like I'm trying random stuff to get it to work, I'd rather understand it. Calling it quits for now.

  6. #36
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    Quote Originally Posted by darrenan View Post
    So you can't reskin the built-in dice? I'll give that try. Does the name matter? Would d10IS (for invisible sun) work just as well?
    I think numbers only after the "d"
    You probably could/should be able to just replace the
    <icon name="d10icon.0" file="graphics/dice/d10/d10.0.png" />

    You will need to do something more complex to change teh actual dice result.

  7. #37
    deleted

  8. #38
    I have been playing with this myself over the last week. To create a die that can be used for a roll, (e.g. with /die in the chat box), you are limited to naming your die with a lower-case "d" followed by any number of upper-case "F" and digits. So dFFF would be acceptable for a new die that can be rolled but dABC is not. My code tracking suggests that this is down to the function isDiceString(sWord) in manager_string.lua in CoreRPG. It would be possible to change this, but only if you replaced the whole code file in your extension/ruleset. Unfortunately this would make your extension/ruleset much more prone to breaking if this file is altered in a future update to CoreRPG itself.

    However, you can create die with pretty much any name if all you want to use them for is substitution during the display of the result diebox in the chat window display, i.e. you register a function using ActionsManager.registerResultHandler("dice", yourFunctionName) that processes the results of the roll to replace the die type (rRoll.sType) with another so that the icon associated with the other type is displayed in the box instead of the original. To stop the result numbers being displayed on top of the new icon, developers have tended to replace the "dieresult" font with one that has no glyphs for one or more of the digits 0 through 9. Note this appears to be the normal approach for FGC. My scanning of the forums and personal testing suggests that in FGU you can change the icon and font properties of the each rolled die in the resultHandler without having to create dummy die definitions. This means that a font could be created containing the die face glyphs that you desire and applied over a single icon representing the die shape for the result box, applying color at run-time as appropriate or using the alpha channel of the font color to make it transparent if no result number is desired.

    Hope that helps.

    NB - this is my assumed behaviour of everything based on stepping through code in a number of rulesets and extensions. If anyone spots any errors in what I have stated, please respond as I am learning all this as well!

    Regards,
    Bracken

  9. #39
    This has been an interesting thread. I'm going to try to do the same thing for a d09. I haven't coded anything in over a decade and that was Matlab. LOL. I will likely be back asking for help.

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