PDA

View Full Version : how to get NPC type?



jkeller
October 30th, 2025, 20:55
Does anyone know how to get the NPC type (e.g. "Undead" for a Zombie), given that I have the Combat Tracker node for the Zombie?

I don't think it's part of the CT data. I assume I have to somehow get the NPC node (which has the type). Is that possible?

Thanks!

Trenloe
October 30th, 2025, 21:11
Which ruleset? This will be stored in different places depending on the ruleset you're using.


I don't think it's part of the CT data. I assume I have to somehow get the NPC node (which has the type). Is that possible?
Yes, this is possible. There are various ways to get the CT Node - what is your reference to the NPC? Is it rTarget, or rSource? If so, you can get the CT node with ActorManager.getCTNode

jkeller
October 30th, 2025, 21:33
This is for 5E.

I have the CT node (it may be the source or the target, but in this case it would be the source - type "npc").

But I don't think the CT node has the NPC's type, does it? I'm thinking I have to get the "NPC node" somehow.

Trenloe
October 30th, 2025, 21:41
Please try to remember to mention which ruleset you're using when posting - it will give you quicker and more efficient support.

NPC data is 100% stored within the CT entry node - it's copied to the CT entry for each NPC when the NPC record is added to the CT.

In 5E you can use LibraryData5E.getNPCTypeValue(nodeCT) to return what's contained in the NPC "type" field (with minor formatting to capitalize the string data), or you can just use DB.getValue(nodeCT, "type","") to return the raw data in the type field.

jkeller
October 30th, 2025, 21:43
Thank you!