PDA

View Full Version : Looking for a guide or suggestions on creating a custom ruleset



Coanunn
September 21st, 2015, 22:29
Ok so I am in the process of trying to create a ruleset for a game that is in development currently. I can't discuss much about the mechanics but what I can say is to create it in Fantasy Grounds I need the ability to create a custom 6 sided die where each face has an image that is displayed to the user when it is rolled. I have seen a guide once before on the wiki for creating custom dice but my google-fu fails me and I have been unable to find it again. Second I need the ability to create a recordsheet that stores the number of dice rolled as a pool. I know there are dice pool rulesets already but does anyone have a guide for creating that from scratch as this will be it's own ruleset and not an extension to an existing ruleset.

Moon Wizard
September 22nd, 2015, 01:53
The community Star Wars: Edge of Empire uses custom dice. You can't change the 3D model, but you can change the result displayed.

The community Shadowrun ruleset uses dice pools, I believe.

Regards,
JPG

Coanunn
September 22nd, 2015, 01:55
The community Star Wars: Edge of Empire uses custom dice. You can't change the 3D model, but you can change the result displayed.

The community Shadowrun ruleset uses dice pools, I believe.

Regards,
JPG

Muahahaha, thank you very much sir! If I can't follow a guide I can definitely try to reverse engineer the code in those rulesets!

Trenloe
September 22nd, 2015, 06:59
There's no specific guide that I'm aware of. However, there's some info in the following thread on how to change the result icons: https://www.fantasygrounds.com/forums/showthread.php?23013-Demi-Dice&p=197877&viewfull=1#post197877

The Star Wars: Edge of the Empire ruleset using custom dice icons and a dice pool. However, it's not based on CoreRPG so it would take quite a bit of work to port the dice mechanics to a CoreRPG based ruleset.

damned
September 22nd, 2015, 08:50
Coanunn be prepared for some challenging sessions as you work your way thru it! Hopefully you have some programming skill :) Do ask questions when you get stuck but be prepared for a learning curve. Use Notepad++ and find in files. You will find that most elements are referenced or built (Im no programmer so these are probably the wrong terms) from 3 or more files. It makes sense after a bit but it takes some getting used to.

Coanunn
September 22nd, 2015, 23:35
Thanks guys. It's a long term project as the game it will support is still in development itself, but I wanted to get a jump on learning things I had no clue how to do in FG. I have some programming experience including a useless AAS from some years ago and I've poked around making my own modules and such. A ruleset is a big jump up but I'll just work on it a bit at a time.

damned
September 23rd, 2015, 00:58
If you look at MoreCore extension it is fairly well commented in the code. It has nothing of the dice pools and custom dice faces (although it does have support for rolling d3, d5, d7, d14,d16,d24 and d30 dice) but it might help ease your general learning curve. ShadowRun has been ported to CoreRPG and CoreRPG is what you really should base your ruleset on - build it as a layered ruleset. StarWars has some of the dice faces but is not currently a CoreRPG ruleset so it misses some of the newer features of FG.

Coanunn
September 26th, 2015, 16:31
My problem with building it on core is even if I do I have to do dice pools completely from scratch along with the dice faces or am I missing something? I know that all I really need is a way to parse a d6 that 1-2 is one result, 3 is result, 4-5 are one result and 6 is a result. Then I have to set the dice pool to roll from the character sheet and the modifier in the corner to be additional dice rather than a modifier to the result rolled. Thus if you have a +2 modifier you roll 2 additional dice. I realize a lot of this is beyond my capacity at this point as I am very very new to trying to writing anything for FG having really only done a handful of extensions based largely on the work of others but I wasn't aware there was anything in core that would let me do that since core seems to be largely a modifier to a central die. Is it possible to modify the die mechanic in core that much and not break everything else?

Trenloe
September 26th, 2015, 16:45
I wholly recommend that you use CoreRPG as your basis - it has a lot of stuff in it (nothing to do with dice) that you'll want in your games down the line. The mainstream rulesets you see in Fantasy Grounds are all built (layered) on top of CoreRPG (3.5E, Pathfinder, 4E, 5E, C&C, Savage Worlds, Call of Cthulhu, Numenera, etc.).


My problem with building it on core is even if I do I have to do dice pools completely from scratch along with the dice faces or am I missing something?
Perhaps not from scratch, but you'll certainly have to do some coding.


Is it possible to modify the die mechanic in core that much and not break everything else?
Absolutely. (Assuming you know vaguely what you're doing).

Some further info to do with handling dice results in these threads:

https://www.fantasygrounds.com/forums/showthread.php?23013-Demi-Dice&p=197855&viewfull=1#post197855
https://www.fantasygrounds.com/forums/showthread.php?20615-Custom-Dice
https://www.fantasygrounds.com/forums/showthread.php?23095-7th-Sea-Roll-amp-Keep&p=199129&viewfull=1#post199129

Coanunn
September 26th, 2015, 18:59
Ok, So very quickly I can tell I am out of my depth here but the stuff you have provided so far Trenloe has been amazing. I was able to set up some custom dice faces to display that showed the icons from the system and was even able to repackage it as an extension based on your Custom Dice Icons extension. I notice when I have it roll the custom die it still returns a "face value" for the die. My next question requires I explain the die a bit more so the die results possible are, blank, success, double success and success with complication. Is there any way I can write a script that turns the 1-6 result of the d6 that the roller is using by default into a two line return that simply counts successes and complications?

Unfortunately the .lua code is absolutely greek to me as it seems to be calling several functions that I assume are FG functions but because I don't know the root function all I know is that something is being called. The XML seems to be handling the icons but not the actual "value" returned by the die unless I'm just dense and not reading it clearly. So at this point where I find myself is wanting to write a simple if then routine that returns successes based on die face and then counts total successes across multiple dice, but I have no clue if that is something the .lua is able to do with one of the functions I'm not understanding or is somewhere in the XML and I missed it. Either way I feel like I'm at a point now where I'm asking you guys to create it for me and that isn't fair to anyone. Sorry, been 12 years since I did any serious programming and apparently the rust is thicker than I thought it was on my skills.

Coanunn
September 26th, 2015, 19:05
Hold on one moment, I am looking at the Custom Die Results extension now and I may be able to do exactly what I wanted to do with that.. I will come back to this after some playing. At least this way no one is having to do it for me at all!

Coanunn
September 26th, 2015, 19:35
Ok, I think I can get one or the other to work but for whatever reason when I try to do both it just blows up on me. Are the two functions mutually exclusive such that new icons or modified results are available but not both?

Coanunn
September 26th, 2015, 22:13
Ok, after playing with it today I have something that records the number of successes, and displays a custom icon on all rolls EXCEPT the 1 and 2. In both cases it simply shows a 0 instead of the icon along with returning the appropriate 0 successes. I based it very much on the Custom Dice Icons and Custom Dice Results extensions you posted in the Demi Dice thread. What I don't understand is why the 1 and 2 are not displaying the appropriate die icon as well as how I can take this mechanic and set it as the default dice mechanic from character sheet entries. That said, I can't even begin to express my gratitude for all the help so far!

I've attached the Custom_Dice.xml that I've edited so far. It will need the comments cleaned up and some name changes to use my custom graphics but that was all secondary to trying to get something that actually produced the result I was looking for from the roller.

Trenloe
September 27th, 2015, 21:58
What I don't understand is why the 1 and 2 are not displaying the appropriate die icon
Because the graphics files dBoost.1.png and dBoost.2.png files are blank die faces.


...as well as how I can take this mechanic and set it as the default dice mechanic from character sheet entries.
Use the custom die type you've defined, "d000123" in this case, as the dice that get rolled. If you're using CoreRPG you can right-click on the d6, select "Custom Dice" (top left) and then you should see your custom dice as one of the options on the next menu (hover over to see a tooltip that shows which dice it is). Drag this dice to the ability/skill entry on the CoreRPG character sheet to add this dice.

Coanunn
September 29th, 2015, 14:31
Because the graphics files dBoost.1.png and dBoost.2.png files are blank die faces.
I tried with an alternate graphic I created as well and had the same response. Is it due to the fact I'm setting the value of those die faces to 0? I wouldn't imagine the graphic displayed in the chat log output would be that tied to the result, it's just a graphic file call right?


Use the custom die type you've defined, "d000123" in this case, as the dice that get rolled. If you're using CoreRPG you can right-click on the d6, select "Custom Dice" (top left) and then you should see your custom dice as one of the options on the next menu (hover over to see a tooltip that shows which dice it is). Drag this dice to the ability/skill entry on the CoreRPG character sheet to add this dice.
Thanks, that is a huge help!

Trenloe
September 29th, 2015, 14:42
Is it due to the fact I'm setting the value of those die faces to 0?
Yes. You'll need to specify which dice icon to use for the result of 0.

For example, this code is used for a result of 1:

<die name="d000123.1"><icon>dBoost.1</icon></die>

You need to have an entry for 0, for example:

<die name="d000123.0"><icon>dBoost.0</icon></die>

Then you'll need to define what graphic is used for icon dBoost.0:


<icon name="dBoost.0" file="graphics/dice/dBoost.0.png" />