PDA

View Full Version : Personal Dice extension



Xarxus
January 6th, 2021, 20:56
Here I am with this first attempt to do something. I hope not to violate any rules with what I will say and show.
Ah, sorry my English, I hope what I write is understandable.

I started from a game that I love (Rolemaster Standard System) and from the "dream" I had about how Fantasy Grounds should make things available to me.
Don't be scared (by now), I didn't create the entire ruleset, I just made my own extension for managing the dice.

These were the goals I had set for myself:

the images of the dice must be as similar as possible to the other dice made available by the system;
the dice must be able to change color like the others;
they must have the same menus as the others;
they must react to the increase in number (right mouse button after drag) like the others;
they must act as required by the RMSS rules, ie Openended, High-openended, Low-openended and Closed (not Open) pitches; this means that if values ​​are obtained that require rerolls, these must be performed automatically in compliance with the rules, by consistently modifying the type of die.
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=42647&stc=1&d=1609966470

To get system-like dice, the first thing I did was capture an image of a 100 die. Then I used Gimp to create a white background mask that matched the shape of the die.
On this shape I then created two other images, one for managing the shadows, to give the die three-dimensionality, and the other for the writing.
I'm not very good with graphics, but I think the result is satisfactory. If any of you could do better, please let us join forces.
Finally I created two other images useful to indicate if the die is high-openended or low-openended.

The images are superimposed in this sequence: background -> shadows -> written -> any symbols, if necessary.

Finally I started working on the operation. It wasn't easy, given the fact that I'm a beginner, but I'm pretty happy with the result.
The only thing I want to change is color management. In fact, to get the desired result I had to include the entire pointer_selection.lua, just to add four lines of code at the end of the updateColors() function.
This does not satisfy me at all. Importing all that code means exposing it to malfunctions if that file undergoes updates, because in my extension will remain the version I copied.
I'd rather be able to intercept the event, somehow, in order to unleash my code downstream, injecting it somehow. But I haven't figured out how to do it yet, if it can be done. Again, if you have any proposals, I'm here!

Here is a short video of the operation so that you can make the observations you deem appropriate.

I have a lot to learn, don't worry about giving me advice. :D


https://www.youtube.com/watch?v=0X1ybxqYaes

damned
January 6th, 2021, 23:21
Well done Xarxus

Dakadin
January 6th, 2021, 23:37
Great job!

Xarxus
January 7th, 2021, 15:11
Tnx both of you.

One question: there is a way to call original updateColors() inside pointer_selection.lua?
As I told in the first post, I don't like to have all the file because of future versions or different personalization in some ruleset. I'd like to append my code to that dinamically.

Do you know if there is a way?