Thread: Faction "faction" is "foe"?
-
August 6th, 2022, 12:54 #1
Faction "faction" is "foe"?
ActorManager.getFaction presumes "foe" if the friendfoe value is nil.
However, picking "faction" in the CT is what sets the friendfoe value to nil so I would expect it to presume "faction".
Tested in 5E and 3.5E.
Is this intentional?bmos' extensions
he/them
-
August 7th, 2022, 00:55 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
Some info:
* The "faction" field does not exist in the combat tracker; it's named "friendfoe".
* The valid values are friend/neutral/foe or undefined.
* The ActorManager deliberately assumes "foe" as a fallback value, if undefined.
Regards,
JPG
-
August 7th, 2022, 01:34 #3
Not sure what to tell you, the tooltip says "Faction"
https://i.imgur.com/I17rk2a.png
EDIT: But that is a helpful response. "Faction" is actually undefined and undefined = foe.
Got it.bmos' extensions
he/them
-
August 7th, 2022, 04:46 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
Oh, you're talking about the tooltip. It is not dynamic, which is why it's a generic tooltip for that control.
Regards,
JPG
-
August 7th, 2022, 13:41 #5
It actually is a dynamic tooltip, at least in 5E and 3.5E.
https://i.imgur.com/o7jH1yI.png
https://i.imgur.com/AtXmHUA.png
https://i.imgur.com/Dv838qb.png
https://i.imgur.com/peQARUE.png
If I'm following, what you're saying is that the tooltip "faction" is referring to the field, but the other tooltips are referring to the field values (when set).
When the field is not set to a value, it falls back to the tooltip that merely describes the field. IMO, this is a confusing experience.Last edited by bmos; August 7th, 2022 at 15:35.
bmos' extensions
he/them
-
August 8th, 2022, 00:48 #6
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
So, what is the solution then? Just default to empty string? Then, you have a graphical button with no information on hover.
Regards,
JPG
-
August 8th, 2022, 15:15 #7
In direct answer to your question, the tooltip could be Faction: Foe, Faction: Friend, Faction: Neutral, or Faction: None.
But honestly I'd lean more toward getFaction returning "" when the friendfoe node is nil (as it already returns "" sometimes -- i'm not sure of the steps to reproduce, but rhagelstrom and I have both noticed that).
I understand if that's too risky for compatibility with existing rulesets and will just do it in my extension if that makes more sense.
EDIT: I also noticed that the latest version of CoreRPG is already taking this aproach of presuming "" in at least one place: manager_combat_record.lua handleStandardCombatAddFields has DB.getValue(v, "friendfoe", "") (which does not presume "foe" if the node is nil, unlike in getFaction).Last edited by bmos; August 8th, 2022 at 16:29.
bmos' extensions
he/them
-
August 8th, 2022, 15:43 #8
I'll see if I can dig up how to reproduce. What I'm seeing is ActorManager.getFaction() returns empty string when faction=faction. I thought at some point I saw it return "foe" but I currently can't reproduce and perhaps was mistaken. If an Actor with faction=faction is added to the CT, the Actor is added to the CT as Foe.
-
August 8th, 2022, 17:31 #9
Update:
When Actor is a PC with Faction=Faction then ActorManager.getFaction() returns "foe". When Actor is NPC with Faction=Faction ActorManager.getFaction() returns empty string. Tested in 5ELast edited by rhagelstrom; August 8th, 2022 at 17:33.
-
August 8th, 2022, 18:12 #10
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
If you look at ActorManager.getFaction, this is the logic:
Code:local nodeCT = ActorManager.getCTNode(rActor); if nodeCT then return DB.getValue(nodeCT, "friendfoe", "foe"); end return nil;
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks