5E Character Create Playlist
Page 1 of 2 12 Last
  1. #1

    ActorManager5E getWoundPercent() bug

    There appears to be a bug with the getWoundPercent() function in ActorManager5E. When a change has occured to the health status such as a wound being applied, the sStatus returned can be different between Host and Client. The nPercentWounded is returned correctly.

    I believe this is due to lines 47-48 where the client returns the previous status without calculating a new one based on the current values. When it is the host calling the function, it calculates the new status and returns it.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  2. #2
    Quote Originally Posted by mattekure View Post
    There appears to be a bug with the getWoundPercent() function in ActorManager5E. When a change has occured to the health status such as a wound being applied, the sStatus returned can be different between Host and Client. The nPercentWounded is returned correctly.

    I believe this is due to lines 47-48 where the client returns the previous status without calculating a new one based on the current values. When it is the host calling the function, it calculates the new status and returns it.
    The chain around my neck (free extension Death Indicator that I volunteered to maintain) appears to have this call in it multiple times. Can you describe what behavior I would see from this bug from a user perspective? It appears most cases I've looked at in this stuff is a > 1 type of check or the status value. What status value difference behavior are you seeing specifically? (this was one of those deprecated updates I had to make)
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  3. #3
    The function returns 2 values, nPercentWounded, and sStatus. In this example, I took a single NPC with 10 HP, and added damage 1 HP at a time. After each wound was received, I called the function and got these return values.

    You can the results as I apply each HP of damage. Both host and client return the same value for the nPercentWounded. But the client returns the status before the wound was applied, not the new status. The host returns what the status should be.

    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  4. #4
    The client pulls the status from the CT entry when possible. There was a reason why this was added sometime in the past for other rulesets; and I applied it for consistency.

    Is there are particular place where this incurs an issue?

    Thanks,
    JPG

  5. #5
    This issue came up to me when working on an extension that applies a bitmap status indicator to the token based on how wounded you are. It was relying on the status from that function, but I was getting inconsistent results where the DM would show the "Dead" indicator, while the Players would still only show the "Critical" indicator.

    I have rewritten it to only rely on the nPercentWounded since that produces consistent results for both client and host.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  6. #6
    I'm wondering if I should move to attempting to calculate status directly on client in all instances; and wait until the original reason for that hook was added.

    It's possible that it's no longer needed; since the function only calculates percentages for owned PCs and CT entries anyway (which we know are available on the current client by default).

    Let me think on it a bit; and possibly patch next week.

    Regards,
    JPG

  7. #7
    Thanks, appreciate it
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  8. #8
    I tested this with my 4E version of Death Indicator and did not receive any errors. Seems to be working as intended (knock on wood).

  9. #9
    Quote Originally Posted by kevininrussia View Post
    I tested this with my 4E version of Death Indicator and did not receive any errors. Seems to be working as intended (knock on wood).
    Thanks it looks like it is mostly called on the host. I'll check more in depth if someone reports a problem - as it does replace those dying/stable/dead things based on "Dead" status or some logic like that in one case - for the token and in one case on the CT. I just think all the logic is relegated to the host side of things and the actual modifications get passed to client in normal ways.
    Last edited by SilentRuin; February 24th, 2021 at 17:21.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  10. #10
    No, token widgets (decorators) and CT font colors are all local to each client; so the token health bar and CT wound coloration would be the most likely impacted.

    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
  •  
Starfinder Playlist

Log in

Log in