PDA

View Full Version : Structure architecture document for nodePC and nodeNPC?



webdove
May 26th, 2021, 03:48
Is there a 5E reference document that describes those two types of database nodes?

If not is the best way to learn to just start using Debug.chat to print getChildren(...) and work my way down the trees?

I am trying to retrieve all actor melee attacks with their listed reach or range for PCs and NPCs to help improve the ranged attack in melee to be more accurate and to be 3D.

superteddy57
May 26th, 2021, 04:14
First, nodePC and nodeNPC are variables in many cases. They get filled based on what fills them. I could code with nodePC = window.getDatabaseNode() and it would fill the database node of one level higher than my current element's position within the database as an example. As for what you are trying to accomplish, it depends on where you are starting. If it's from the combat tracker (CT), then you can use the ActorManager functions to help grab the database node of the actor in question and then navigate down through the node. Since 5e migrates NPC actions to the CT, you could just grab the CT node (using the ActorManager to get that node) and get it's attacks. PCs would be a bit more problematic as you would have to navigate to the character sheet itself and get the actions from the actions tab.

MOD: Moved to Workshop as this pertains to coding and not the 5e system.

Moon Wizard
May 26th, 2021, 04:29
The easiest way to see what database children link to which PC records is to make PCs and export them to see what the fields map to.

You can also pull apart the ruleset code; but that can be spread over many files and control templates.

Regards,
JPG

webdove
May 26th, 2021, 04:49
The easiest way to see what database children link to which PC records is to make PCs and export them to see what the fields map to.

You can also pull apart the ruleset code; but that can be spread over many files and control templates.

Regards,
JPG

That is a great idea. Thank you!

DCrumb
May 26th, 2021, 06:18
I've also looked at a sample db.xml (my local character generator for PF1e) to see what fields were listed where for PCs and NPCs.

webdove
May 27th, 2021, 03:31
For NPCs I need the CT node for actor <space> and <reach>, then under <actions><desc> I will get the "Melee...reach x ft." phrases.

For PCs need the <combattracker> node for actor <reach> and <space> then I need the <charsheet> DB node from which I enumerate the <weaponlist> looking for ones with <properties> containing the string "reach".

damned
May 27th, 2021, 08:05
Create a PC and 3 NPCs, one small, one medium and one large.
Add them to the CT.
Close fantasy grounds and open the db.xml for that campaign and look at the data therein.

Trenloe
May 27th, 2021, 08:17
Create a PC and 3 NPCs, one small, one medium and one large.
Add them to the CT.
Close fantasy grounds and open the db.xml for that campaign and look at the data therein.
Yup. That's the way to do it!