PDA

View Full Version : Adding a Force Rating section to Trenloe's FFG Star Wars Ruleset



Archamus
December 28th, 2016, 01:17
I'm using Trenloe's Star Wars ruleset for Fantasy Flight Games (https://www.fantasygrounds.com/forums/showthread.php?24151-Star-Wars-Edge-of-the-Empire-Age-of-Rebellion-Force-and-Destiny-v2-ruleset)

I wanted a spot for players to keep track of their Force rating, so I threw it down in the unused lower right corner of the main character sheet tab.
https://i.imgur.com/6YGnKS0.png

The next thing I'd like to have is functionality for the players to be able to double click or drag the "available" field to have it added to the diepool, and to be able to drag it straight to the chat window to have it roll there if they wish to bypass the die pool. I get lost very quickly in the LUA script side of the rulesets though and I can't figure out how this is being handled by other parts of the ruleset.

Is there a straight forward, easy way, to just call up x number of the dForce dice, x being the number in that field?

vodokar
December 28th, 2016, 02:25
While rulesets are open source, it is customary to make feature requests to the original author of the ruleset rather than making changes to the ruleset yourself. This allows the person that is in the best position to have the greatest knowledge of the ruleset functionality version control in order to best maintain a rulesets functionality and bug-free condition thru the life of it. Just imagine the situation if every person that touched a ruleset made changes to it, a year down the line, the original author would not even be able to test and fix bugs that a user reported because he would have no idea what version of the code the user was using.

Archamus
December 28th, 2016, 03:38
Nothing I'm doing is affecting anyone's ruleset, so I don't see the concern with me modifying a couple of things for my group. Reading back over my post I guess I can see that I could have been clearer that this is just for my game.

I did almost posted this to the thread for the ruleset instead, but this section seems more appropriate.

I didn't want to ask for a new feature, because as far as I can tell from his thread he is not working on this ruleset at this time; and when and if he does go back to it, it sounded like it was going to be a complete overhaul. At that point I would have a few suggestions to make, but for now I'm just trying to adjust something for a game I'm going to start running in a few weeks.

So I thought it better to ask the larger community where there may be someone who has been exactly where I am right now, with trying to turn a number field into a call for dice.

I have a feeling though that there isn't going to be a straightforward way to do this with just a small script in the character sheet xml file.

vodokar
December 28th, 2016, 03:51
Might I suggest then that you make your changes in the form of an extension. If you directly modify the ruleset, you will be putting yourself into the position of having to redo the changes the next time that the ruleset is updated or forgo said update. I can't speak for Trenloe's schedule or what is on his plate, what a busy guy, but I do know that he does actively maintain and update the rulesets that he has authored. So, it is a matter of when, and not if, that any changes you make will trip over an update that he puts out. That's all I'm saying.

Trenloe
December 28th, 2016, 05:31
The next thing I'd like to have is functionality for the players to be able to double click or drag the "available" field to have it added to the diepool, and to be able to drag it straight to the chat window to have it roll there if they wish to bypass the die pool. I get lost very quickly in the LUA script side of the rulesets though and I can't figure out how this is being handled by other parts of the ruleset.

Is there a straight forward, easy way, to just call up x number of the dForce dice, x being the number in that field?
There's not an "easy" way to do this if you're not familiar with the FG LUA and database access. You can take a look at the dice icon which is the "skilldicepool" template in classes\common\skilldicepool.xml which uses classes\common\skilldicepool.lua to control what happens on either double click (add to dice pool) or drag/drop (roll in chat window). You'll see that the core of both of these is the DicePoolManager.addSkillDice function that is in managers\dicepoolmanager.lua. You'd need to write a similar handler for the force dice - to get the number of currently available force dice from the charsheet database and then add the relevant number of force dice to the "dice" table. And then copy and edit the XML and LUa that skilldicepool uses to begin with.

Trenloe
December 28th, 2016, 05:47
Additional: as this is a basic dice add, you could probably do away with the DicePoolManager add dice and just use something like the following in your equivalent of skilldicepool.lua:


local nForceDice = <window control where available force dice is stored>.getValue();
if nForceDie > 0 then
for i = 1, nForceDie do
table.insert(dice, "dForce");
end
end