Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add original string placeholder option in override active effect #3426

Closed
arbron opened this issue Apr 7, 2024 · 0 comments · Fixed by #3523
Closed

Add original string placeholder option in override active effect #3426

arbron opened this issue Apr 7, 2024 · 0 comments · Fixed by #3523

Comments

@arbron
Copy link
Collaborator

arbron commented Apr 7, 2024

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.

@arbron arbron added this to the D&D5E 3.2.0 milestone Apr 7, 2024
@arbron arbron self-assigned this Apr 7, 2024
@arbron arbron changed the title Add existing string placeholder to override active effects Add original string placeholder option in override active effect Apr 7, 2024
arbron added a commit that referenced this issue May 2, 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.
arbron added a commit that referenced this issue May 3, 2024
[#3426] Add simple string interpolation to active effects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant