PDA

View Full Version : CombatTracker, Actors, Character/Monster nodes?



Varsuuk
January 30th, 2021, 23:05
I have recently started working on rolls and the combat tracker.

When resolving things, where should I look for information?
Of course, any of the entities could be a PC or an NPC/Monster.

When the stat is not "volatile" like Level, is it safe/OK to get it via ActorManager.getCreatureNode()? Or do I need to put anything I might need to resolve rolls in the CT?
I figure, some things probably want to be from CT only but I am just not sure how to decide or what rules of thumb/thought are.

Any advice or links to description/tips?

SilentRuin
January 30th, 2021, 23:58
I have recently started working on rolls and the combat tracker.

When resolving things, where should I look for information?
Of course, any of the entities could be a PC or an NPC/Monster.

When the stat is not "volatile" like Level, is it safe/OK to get it via ActorManager.getCreatureNode()? Or do I need to put anything I might need to resolve rolls in the CT?
I figure, some things probably want to be from CT only but I am just not sure how to decide or what rules of thumb/thought are.

Any advice or links to description/tips?

I would ignore actors etc. entirely and simply treat it as pure DB operations. Or use CombatManager...



for _,nodeCT in pairs(CombatManager.getCombatantNodes()) do

local sFaction = DB.getValue(nodeCT, "friendfoe", "");
end


etc.

Varsuuk
January 31st, 2021, 00:29
What I meant is use the actor to get their "creature node" which is character or npc node.
From there to query the node for the entry via DB.getValue(creatureNode, "thingIwant")

The node in the CT is a subset of the original entity copied to it. It won't have every field - well, it COULD, if I chose to copy them all but - if I recall, that caused issues and workarounds were used to solve it in 2E. Because the 2E CT is like uber feature-fun.

damned
January 31st, 2021, 01:22
What data are you trying to access in combat that isnt stored in the CT?
If its needed for CT wont it be in the CT?

Varsuuk
January 31st, 2021, 02:46
Well ... doesn’t the developer decide what goes in the CT? ;)

So if I want to check if the target has some trait (not referring to 5E mechanic) or some such, do I always have to add that trait to the CT?

For another example, need to look - do npcs CT entry have their HitDie? Like an ogre is HD3+3 (making that up) etc?

I meant what’s on the CT isn’t magic, we put it there when adding the creature to the CT.

damned
January 31st, 2021, 03:06
Ofc you get to decide. But if you have something you are checking back to the source for all the time maybe it should be in the CT?
Generally I think the HD is translated to a BAB or something like that, and that is included on the CT for sure as its used all the time.

Varsuuk
January 31st, 2021, 05:38
Btw Damned “doesn’t the developer get to decide” meant that nothing is included unless you write code to include it.

So I was reacting to “if it was needed in CT, wouldn’t it be in the CT” - I was trying to make clear (badly) that nothing is there... yet because I hadn’t learned yet whether to add things to CT or if the Dara is “static” - whether was better to leave on the source node (character or npc) and load from there vs copying it to every CT entry (in the case of npcs, like you add 12 kobolds and we want to know their savibn throw - it doesn’t vary across the kobolds. Is it better to add a ST field for CT or to get the source node and read from there?

damned
January 31st, 2021, 07:13
in 5E (and 2E, I havent looked at 3.5E or 4E) the kobolds Saves are in the CT...

Varsuuk
January 31st, 2021, 16:10
Gotcha, so pretty much - ignore the character/NPC sheet and just add whatever you think is needed from them to the CT.

I wasn't sure how people decided what was best on CT and what was better to leave on sheet to avoid duplication. I come from a const/volatile consideration in class development but this isn't meant to use those considerations I see.

SilentRuin
January 31st, 2021, 16:25
Gotcha, so pretty much - ignore the character/NPC sheet and just add whatever you think is needed from them to the CT.

I wasn't sure how people decided what was best on CT and what was better to leave on sheet to avoid duplication. I come from a const/volatile consideration in class development but this isn't meant to use those considerations I see.

I'm not sure where this "anything can go into the CT" direction came from - but I'd be very careful about that. Rulesets and other extensions expect a certain consistency in existing data structures. New data or new structures - sure. Messing with some of the core data structures that CombatManager and maybe other things depend on? Would not recommend it.

Varsuuk
January 31st, 2021, 17:38
I'm talking about if I want to access something I have added to a character sheet let's say some FOO characteristic.

Now, when the roll to hit is happening, we check if this source actor has FOO value, if so BAR. Whatever.
I know I am terrible at explaining myself. I am asking (and no longer need an answer since was told "just add what need" vs going to the char/npc sheets) whether if FOO is a non-changing value across all of one type of NPC for example whether we need to copy the same tag=value to all 15 of the npc CT records so when to hit handler called - we do a DB look on CT to get the value or if we do a DB lookup on the npc sheet to get the never-changes-for-this-monster value. It is not a necessarily "linked" field in as much it does not tick down or up and is not affected by spells etc. It is a number, or a string and it never changes for all "Orcs" let's say.

Not removing anything. Only change is in MY ruleset's TOHIT handler on how I decide this.

Again, do not want to belabor this ;) I'll just add the fields I need to the CT via the linking as recommended.
(I will post a different CT questions soon ;) )