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
With upcoming work on enchantment (#3305) there is sometimes a need to add text to the beginning of an existing string or around an existing string. For example, for the "Returning Weapon" Artificer infusion you might want to change the name to indicate its infusion while still showing the original weapon type, so "Returning Dagger" or "Returning Handaxe". This currently isn't possible because there is no prefix active effect mode that would add to the beginning of a string in the same way add appends to the end.
Rather than trying to include a new change mode, which core makes difficult, I propose adding support for a placeholder value that can be used with the override mode that would be replaced with the original string. So that infusion could be written Returning {} and the text {} would be replaced with the name before the active effect was applied.
We should add a restriction to ensure this can only be applied to places we can identify as StringField or HTMLField using data models, because attempting to infer whether the replacement should happen elsewhere may cause issues with data that just looks like strings. We could also potentially make it more restrictive and require a specific option be set on the field like interpolation which must be set to true for this to work. That would allow us to further restrict this to only fields that we explicitly specify, preventing it from causing issues on stringy but not textual data.
The text was updated successfully, but these errors were encountered:
arbron
changed the title
Add existing string placeholder to override active effects
Add original string placeholder option in override active effect
Apr 7, 2024
Adds the option when apply and OVERRIDE change to a string value
to include the original string value by using `{{}}`. So an effect
with the change value of `Enhanced {{}}, +1` might be interpolated
as `Enhanced Breastplate, +1` when applied.
With upcoming work on enchantment (#3305) there is sometimes a need to add text to the beginning of an existing string or around an existing string. For example, for the "Returning Weapon" Artificer infusion you might want to change the name to indicate its infusion while still showing the original weapon type, so "Returning Dagger" or "Returning Handaxe". This currently isn't possible because there is no
prefix
active effect mode that would add to the beginning of a string in the same wayadd
appends to the end.Rather than trying to include a new change mode, which core makes difficult, I propose adding support for a placeholder value that can be used with the
override
mode that would be replaced with the original string. So that infusion could be writtenReturning {}
and the text{}
would be replaced with the name before the active effect was applied.We should add a restriction to ensure this can only be applied to places we can identify as
StringField
orHTMLField
using data models, because attempting to infer whether the replacement should happen elsewhere may cause issues with data that just looks like strings. We could also potentially make it more restrictive and require a specific option be set on the field likeinterpolation
which must be set totrue
for this to work. That would allow us to further restrict this to only fields that we explicitly specify, preventing it from causing issues on stringy but not textual data.The text was updated successfully, but these errors were encountered: