Hello!
I’m trying to make a D&D inspired game where Stats and Skill Checks are important. I’ve got a few major stats.
A person has a number called Strength.
A person has a number called Dexterity.
A person has a number called Constitution.
A person has a number called Intelligence.
A person has a number called Willpower.
A person has a number called Charisma.
A person has a number called Luck.
Each of these stats will have a corresponding number, and the value of that number will give plusses or negatives to skill checks.
I plan on creating a table of everyone and everything’s statistics for rolling against, but I’m very new to Tables and don’t exactly know how they function.
Currently, my table only has the player’s stats.
Table of Main Stats
Person Strength Dexterity Constitution Intelligence Wisdom Charisma
"The Player" 16 14 18 10 12 8
In order to calculate bonuses, I’m using Ability_Score and Ability_Modifier.
Ability_Score is a number that varies. Ability_Score is 0.
Ability_Modifier is a number that varies. Ability_Modifier is 0.
Ability Score will take on the number of the Stat being rolled i.e Strength, and calculate the value of Ability Modifier based on that number. If X is greater than Y, Ability Modifier is 1, or 2, etc.
The roll itself is thus far very simple. I have a number called D20_1 (In case I ever need more dice rollers)
Check Rolling:
Now d20_1 is a random number from 1 to 20;
Let result be d20_1 + Ability_Modifier;
But I’m running into the problem where I don’t know the best way to get the value from the table into the dice roller. My plan is that events will have a trigger to roll, put the corresponding Stat into the ability_score, and then depending on who or what is in the event, pull the numbers from the table. I figured people here know a lot more about tables and might be able to give me a nudge in the right direction.
In short, I want to simulate “Roll a stat, add your bonuses” and then I’ll put it against the difficulty of the check to decide the outcome.