5E Character Create Playlist
Page 1 of 2 12 Last
  1. #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?

  2. #2
    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

  3. #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.

  4. #4
    Oh, you're talking about the tooltip. It is not dynamic, which is why it's a generic tooltip for that control.

    Regards,
    JPG

  5. #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.

  6. #6
    So, what is the solution then? Just default to empty string? Then, you have a graphical button with no information on hover.

    Regards,
    JPG

  7. #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.

  8. #8
    Quote Originally Posted by bmos View Post
    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.
    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.

  9. #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 5E
    Last edited by rhagelstrom; August 8th, 2022 at 17:33.

  10. #10
    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;
    I added a Debug.chat(sFaction) to CombatManager.showTurnMessage; and it's reporting correctly (friend, neutral, foe, empty string)

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in