PDA

View Full Version : 5E Background question



tmandeville
December 27th, 2023, 18:29
I have been trying to create and update the EDH ruleset that is a modified version of 5E and in that ruleset They have both professions and backgrounds. The question is in Backgrounds in 5e it parses the skills so when you select the background it brings up a list of skills you can choose from. But is there anyway or someone that can assist with a code that would allow to add a line for Attributes and then code it if you wanted to add str or dex by 1 for it to populate a box to choose? Been trying to look thru code but cannot seem to find a way or if there was a ext that can be built?

Any support would be great.

Thanks,

Moon Wizard
December 27th, 2023, 19:20
There is not anything like that, since the code was written to support the standard 5E background changes, which only includes: features, skills, tools, languages.

Any changes like that would require an extension to be written to modify the way backgrounds get processed.

Regards,
JPG

LordEntrails
December 27th, 2023, 21:29
You might want to link to the DDH ruleset you are talking about. I'm not familiar with that acronym and I suspect most others are not.

tmandeville
December 28th, 2023, 00:23
Sorry it is Everyday heroes
I got the multiple stat one to work with my extension

This is the Code to increase 1 of 2 stats.

-- Increase your Strength or Intelligence score by 1, maximum of 20.
a1, a2, sIncrease = sAbilities:match("increase your (%w+) or (%w+) score by (%d+)");
if a1 then
local aAbilities = {};
for _,v in ipairs(DataCommon.abilities) do
if (v == a1) or (v == a2) then
table.insert(aAbilities, StringManager.capitalize(v));
end
end
if #aAbilities > 0 then
local nAbilityAdj = tonumber(sIncrease) or 1;
table.insert(tAbilitySelect, { aAbilities = aAbilities, nAbilityAdj = nAbilityAdj });
end
end

This is what i had for increasing just one stat but its not working.

-- Increase your Constitution score by 1, to a maximum of 20.
local a1, sIncrease = sAbilities:match("increase your (%w+) score by (%d+)");
if a1 and (a1 == "constitution") then
local nAbilityAdj = tonumber(sIncrease) or 1;
table.insert(tAbilitySelect, { nAbilityAdj = nAbilityAdj });
end
end