PDA

View Full Version : Number box with tiny die icon?



BradYounie
February 23rd, 2016, 00:18
I'm using the Core RPG ruleset as a starting point (copied and unzipped) for creating a ruleset for my RPG (I'm an Indy game publisher), and I want to add a number box that has the tiny die icon in the lower left corner that most rulesets have. But I can't seem to find out how to add it.

Can someone help?

BradYounie
February 23rd, 2016, 00:28
It figures that no sooner do I post the question, that I figure it out. :)

It's a simple matter of adding <rollable /> to your basicnumber control. Nice!

damned
February 23rd, 2016, 10:17
Welcome BradYounie! There are a few things I would have a look at:

https://www.fantasygrounds.com/forums/showthread.php?25234-Jeff-s-Excruciatingly-Simple-Extension-Tutorial
https://www.fantasygrounds.com/wiki/index.php/Developer_Guides
https://www.fg-con.com/morecore-extension/

What game are you working on?

Trenloe
February 23rd, 2016, 16:40
Welcome BradYounie! There are a few things I would have a look at:
This too: https://www.fantasygrounds.com/forums/showthread.php?20651-Modifying-the-CoreRPG-ruleset

damned
February 24th, 2016, 00:41
Thats the one I was looking for! Thanks Trenloe!

BradYounie
February 24th, 2016, 12:02
Welcome BradYounie!
What game are you working on?

Well, I own an indy game company called Carnivore Games, and this is a new game I'm developing. I plan to use FG as a tool for some playtesting.

I can't say much about the game except that it's a new system, and the setting is both fantasy and sci-if at the same time, depending on how you play it. It's in early dev right now.

damned
February 24th, 2016, 12:52
I had a peek at your website - The Unexplained looks interesting :)

BradYounie
February 24th, 2016, 16:30
I had a peek at your website - The Unexplained looks interesting :)

Thanks! I plan to create a full ruleset for it.

BradYounie
March 20th, 2016, 01:43
I'm trying to do the same thing with a basicstring control (which is defined in CoreRPG. For some reason, adding <rollable /> doesn't cause the dice icon to appear, nor will it roll dice. It's weird that it doesn't appear for basicstrings. I traced them back through the templates, and nothing stuck out to me that would make one work and the other not.

Trenloe
March 20th, 2016, 02:00
It doesn't make sense having a string field rollable, as it could contain data that can't be equated to anything relevant to a roll. The number field usually applies a numerical modification to the roll, a string could be anything - possibly something that doesn't equate to a numerical modification.

If you want similar functionality to rollable on a string control then you'll have to code for it in LUA, and ensure that the data stored in the string makes sense from a roll perspective. Have a look at the code in common\scripts\number.lua in the CoreRPG ruleset. The onInit function has the LUA code that sets the rollable bitmap widget.

BradYounie
March 20th, 2016, 03:48
It doesn't make sense having a string field rollable, as it could contain data that can't be equated to anything relevant to a roll. The number field usually applies a numerical modification to the roll, a string could be anything - possibly something that doesn't equate to a numerical modification.

If you want similar functionality to rollable on a string control then you'll have to code for it in LUA, and ensure that the data stored in the string makes sense from a roll perspective. Have a look at the code in common\scripts\number.lua in the CoreRPG ruleset. The onInit function has the LUA code that sets the rollable bitmap widget.

Thanks. In this case the text field is auto generated, so I know it'll be valid.

damned
March 20th, 2016, 05:52
Thanks. In this case the text field is auto generated, so I know it'll be valid.

Does it not make sense to turn this into a Number field?

Moon Wizard
March 20th, 2016, 19:25
I can see a string field contains a dice expression might want to be rollable, but there's no built-in code to enforce a string field to only accept dice expressions.

Also, the rollable tag is used by a numberfield template in CoreRPG. You would have to write your own template for strings.

Regards,
JPG

BradYounie
March 21st, 2016, 14:06
Does it not make sense to turn this into a Number field?

Because it needs to be a dice roll expression, which is auto generated and the field is read only.