ozmar
September 26th, 2020, 02:00
Hello,
I am relatively new to FGU, and I've been working with the code to try to create a custom ruleset for my home game. I started with modifying the WarhammerFRP ruleset, as that is close to what I want.
I have what I hope is a quick question: how and where are the character ability scores defined in the ruleset code?
WHFRP has 8 primary abilities: Weapon Skill, Ballistic Skill, etc... And it has a number of derived ability scores like Attack, Strength Bonus, etc...
For example: I see Ballistic Skill is defined in record_char_main.xml with a source="abilities.ballistic" - does this indicate that there is a data table called abilities with a field called ballistic? Can this be referenced elsewhere, such as when you want to calculate a derived ability based on this number?
I also see this referenced in manager_char.lua, which apparently has code to tell the application how to handle certain actions. For example:
function addSkill(nodeChar, sClass, sRecord, nodeTargetList)
local nodeSource = resolveRefNode(sRecord);
local nodeEntry = nodeTargetList.createChild();
DB.copyNode(nodeSource, nodeEntry);
local sStat = DB.getValue(nodeSource, "attribute", "");
local sFocus = "";
if sStat == "Weapon" then
sFocus ="weapon";
elseif sStat == "Ballistic" then
sFocus ="ballistic";
etc...
end
DB.setValue(nodeEntry, "statname", "string", sFocus);
end
(Some code omitted for brevity...)
And I see in data_common.lua sections of code that appear to define an abilities table (lots of names of fields).
This all sort of makes sense to me, and yet I can't seem to grasp how to do this:
Define character ability = Strength
Derive Strength_Bonus (SB) from value of Strength
So, if you enter Strength = 45, then SB = 4
Does this make sense? Anyone have a brief explanation for how this kind of information is created, stored and manipulated by the ruleset?
Thanks in advance!
-Ozmar the Self-Taught Coder :bandit:
I am relatively new to FGU, and I've been working with the code to try to create a custom ruleset for my home game. I started with modifying the WarhammerFRP ruleset, as that is close to what I want.
I have what I hope is a quick question: how and where are the character ability scores defined in the ruleset code?
WHFRP has 8 primary abilities: Weapon Skill, Ballistic Skill, etc... And it has a number of derived ability scores like Attack, Strength Bonus, etc...
For example: I see Ballistic Skill is defined in record_char_main.xml with a source="abilities.ballistic" - does this indicate that there is a data table called abilities with a field called ballistic? Can this be referenced elsewhere, such as when you want to calculate a derived ability based on this number?
I also see this referenced in manager_char.lua, which apparently has code to tell the application how to handle certain actions. For example:
function addSkill(nodeChar, sClass, sRecord, nodeTargetList)
local nodeSource = resolveRefNode(sRecord);
local nodeEntry = nodeTargetList.createChild();
DB.copyNode(nodeSource, nodeEntry);
local sStat = DB.getValue(nodeSource, "attribute", "");
local sFocus = "";
if sStat == "Weapon" then
sFocus ="weapon";
elseif sStat == "Ballistic" then
sFocus ="ballistic";
etc...
end
DB.setValue(nodeEntry, "statname", "string", sFocus);
end
(Some code omitted for brevity...)
And I see in data_common.lua sections of code that appear to define an abilities table (lots of names of fields).
This all sort of makes sense to me, and yet I can't seem to grasp how to do this:
Define character ability = Strength
Derive Strength_Bonus (SB) from value of Strength
So, if you enter Strength = 45, then SB = 4
Does this make sense? Anyone have a brief explanation for how this kind of information is created, stored and manipulated by the ruleset?
Thanks in advance!
-Ozmar the Self-Taught Coder :bandit: