View Full Version : [5e] Get Character Traits
7H3LaughingMan
October 31st, 2016, 16:52
Does anyone know how you would go about getting a list of traits that a character has if you have the character node? Writing an extension and I need to check to see if a character has the "Powerful Build" trait or not. I have a basic understanding of how to get basic values from character sheets based on the code already in the ruleset but not to familiar with how to get this kind of information.
Also, what would probably be the best way to to view the structure of a node?
Trenloe
October 31st, 2016, 17:04
Also, what would probably be the best way to to view the structure of a node?
Create a character in Fantasy Grounds, then export the character (from the Character Management screen or with /exportchar) and take a look at the resulting XML. This is the FG database structure - info here: https://www.fantasygrounds.com/modguide/database.xcp
DB and databasenode API references here: https://www.fantasygrounds.com/refdoc/DB.xcp and https://www.fantasygrounds.com/refdoc/databasenode.xcp
7H3LaughingMan
October 31st, 2016, 17:59
Create a character in Fantasy Grounds, then export the character (from the Character Management screen or with /exportchar) and take a look at the resulting XML. This is the FG database structure - info here: https://www.fantasygrounds.com/modguide/database.xcp
DB and databasenode API references here: https://www.fantasygrounds.com/refdoc/DB.xcp and https://www.fantasygrounds.com/refdoc/databasenode.xcp
Thanks for the information, was able to figure it out and came up with the following code.
function checkPowerfulBuild(nodeChar)
local traits = DB.getChildren(nodeChar, "traitlist");
for k, v in pairs(traits) do
if DB.getValue(v, "name", "") == "Powerful Build" then
return true;
end
end
return false;
end
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.