You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log only says creature was knocked unconscious if HP already at 0 when taking new damage (ALSO: log should preferably not say "Creature took X damage and was knocked unconscious" if Automatic Unconscious Status Application is disabled)
#288
Open
3 of 7 tasks
anfrimov opened this issue
Jul 3, 2024
· 0 comments
I searched for existing Bug Reports and found no similar reports.
Expected Behavior
Creature with HP > 0 takes damage > HP...
..when Automatic Unconscious Status Application is enabled:
Log indicates the damage AND that the Unconscious tag has been applied. Example:
Goblin took 3 damage and was knocked unconscious.
..when Automatic Unconscious Status Application is disabled:
Log indicates the damage. Example:
Goblin took 3 damage.
Creature with HP <= 0 takes damage > 0...
..when Automatic Unconscious Status Application is enabled:
Log indicates the damage. Example:
Goblin took 3 damage.
..when Automatic Unconscious Status Application is disabled:
Log indicates the damage. Example:
Goblin took 3 damage.
Current behaviour
Creature with HP > 0 takes damage > HP...
..when Automatic Unconscious Status Application is enabled:
Log indicates the damage. Example:
Goblin took 3 damage.
..when Automatic Unconscious Status Application is disabled:
Log indicates the damage. Example:
Goblin took 3 damage.
Creature with HP <= 0 takes damage > 0...
..when Automatic Unconscious Status Application is enabled:
Log indicates the damage AND that the Unconscious tag has been applied. Example:
Goblin took 3 damage and was knocked unconscious.
..when Automatic Unconscious Status Application is disabled:
Log indicates the damage AND that the Unconscious tag has been applied. Example:
Goblin took 3 damage and was knocked unconscious.
Reproduction
Example 1
Enable Automatic Unconscious Status Application
Start encounter with creature (set HP to 1/1)
Apply 2 damage to creature
Creature HP is now 0 and creature has Unconscious tag
Log says "Creature took 2 damage"
Apply 2 damage to creature
Creature HP is still 0, but...
Log says "Creature took 2 damage and was knocked unconscious"
Example 2
Disable Automatic Unconscious Status Application
Start encounter with a creature which has not been assigned an HP value or whose HP is 0
Apply 2 damage to creature
Creature has no Unconscious tag, but...
Log says "Creature took 2 damage and was knocked unconscious."
Example 3
Disable Automatic Unconscious Status Application
Start encounter with a creature which has not been assigned an HP value or whose HP is 0
Apply 2 damage to creature and manually apply Unconscious tag
Log says "Creature took 2 damage and was knocked unconscious and took Unconscious status."
Which Operating Systems are you using?
Android
iPhone/iPad
Linux
macOS
Windows
Obsidian Version Check
Version 1.6.5 (Installer 1.4.16)
Plugin Version
13.0.12
Confirmation
I have disabled all other plugins and the issue still persists.
Possible solution
Not a solution but a bit more info:
My use case for wanting to not see the unconscious message in the logs is that I'm using the initiative tracker as a player, thus I do not necessarily know the current or maximum HP of the enemies we face, but I would still like to track (using the log) damage dealt to each creature on every turn. However, because of the bug, the log says these creatures are knocked unconscious every time they take any damage, even though this status should not automatically be applied, and it says it twice when I add it manually.
Possible solution to part 1?:
Looking into the code (though this is not a coding language I know), it seems like change.hp is set as a variable (tracker.ts lines 512 and 1276) just the line before the check if the creature HP is <= 0. This check is thus before the function which updates creature.hp is called, I think? So it appears to be checking if the old HP is <= 0 in order to set message.unc = true rather than checking if the new HP is <=0.
Possible solution to part 2?:
Rather than having separate key:value pairs (in logger.ts and logger.types.ts) in the UpdateMessageLog type for status and unconscious (unc), perhaps it would be simpler to just have status. The simplest method would then just apply the status tag "Unconscious" when HP is <= 0 (if Auto Apply Unconscious is enabled), and the log would read "Creature took X damage and took Unconscious status." Less pretty than "was knocked unconscious" but all around functional.
With a little extra work, maybe you could add a text field to each status in the settings which would determine how the status was displayed in the log, with the default being something like "is status_name" (as most statuses, like blinded, paralyzed, etc. would work quite well this way, grammatically). "Creature takes 2 damage and is paralyzed." But that way one has the freedom, if desired, to add for example a Sleeping condition with the preferred log text "falls asleep". Unconscious could then be easily changed to "falls unconscious" or "is knocked unconscious". Invisible could be "turns invisible" or "becomes invisible", Petrified could be "is turned to stone". However people want it to appear in the log.
The text was updated successfully, but these errors were encountered:
Check for existing bug reports before submitting.
Expected Behavior
Creature with
HP > 0
takesdamage > HP
.....when
Automatic Unconscious Status Application
is enabled:..when
Automatic Unconscious Status Application
is disabled:Creature with
HP <= 0
takesdamage > 0
.....when
Automatic Unconscious Status Application
is enabled:..when
Automatic Unconscious Status Application
is disabled:Current behaviour
Creature with
HP > 0
takesdamage > HP
.....when
Automatic Unconscious Status Application
is enabled:..when
Automatic Unconscious Status Application
is disabled:Creature with
HP <= 0
takesdamage > 0
.....when
Automatic Unconscious Status Application
is enabled:..when
Automatic Unconscious Status Application
is disabled:Reproduction
Example 1
Automatic Unconscious Status Application
Example 2
Automatic Unconscious Status Application
Example 3
Automatic Unconscious Status Application
Which Operating Systems are you using?
Obsidian Version Check
Version 1.6.5 (Installer 1.4.16)
Plugin Version
13.0.12
Confirmation
Possible solution
Not a solution but a bit more info:
My use case for wanting to not see the unconscious message in the logs is that I'm using the initiative tracker as a player, thus I do not necessarily know the current or maximum HP of the enemies we face, but I would still like to track (using the log) damage dealt to each creature on every turn. However, because of the bug, the log says these creatures are knocked unconscious every time they take any damage, even though this status should not automatically be applied, and it says it twice when I add it manually.
Possible solution to part 1?:
Looking into the code (though this is not a coding language I know), it seems like
change.hp
is set as a variable (tracker.ts lines 512 and 1276
) just the line before the check if the creature HP is <= 0. This check is thus before the function which updatescreature.hp
is called, I think? So it appears to be checking if the old HP is <= 0 in order to set message.unc = true rather than checking if the new HP is <=0.Possible solution to part 2?:
Rather than having separate key:value pairs (in
logger.ts
andlogger.types.ts
) in theUpdateMessageLog
type forstatus
and unconscious (unc
), perhaps it would be simpler to just havestatus
. The simplest method would then just apply the status tag "Unconscious" when HP is <= 0 (if Auto Apply Unconscious is enabled), and the log would read "Creature took X damage and took Unconscious status." Less pretty than "was knocked unconscious" but all around functional.With a little extra work, maybe you could add a text field to each status in the settings which would determine how the status was displayed in the log, with the default being something like "is status_name" (as most statuses, like blinded, paralyzed, etc. would work quite well this way, grammatically). "Creature takes 2 damage and is paralyzed." But that way one has the freedom, if desired, to add for example a
Sleeping
condition with the preferred log text "falls asleep". Unconscious could then be easily changed to "falls unconscious" or "is knocked unconscious". Invisible could be "turns invisible" or "becomes invisible", Petrified could be "is turned to stone". However people want it to appear in the log.The text was updated successfully, but these errors were encountered: