mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5024] [Issue]: Add addnumvar macro for numeric variable addition #2776
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2776
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Aug 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5024
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Add an
{{addnumvar::name::value}}macro that performs numeric addition without changing the existing string-concatenation behavior of{{addvar}}.Expected behavior
{{addnumvar::name::value}}should read the variable and value as numbers, add them, store the result back as a string, and return an empty string.Actual behavior
{{addvar::name::value}}concatenates values as strings. For example, adding a modifier to a roll produces20-2instead of the numeric result18, preventing subsequent numeric comparisons.Steps to reproduce
natrollto20,modifierto2, andfinal_resulttonatroll.{{addvar::final_result::{{modifier}}}}.{{getvar::final_result}}.20-2rather than the expected numeric result18.Environment
65c8ebc180)Logs, screenshots, or video
Attached
macro-engine.ts: https://cdn.discordapp.com/attachments/1537564144256028742/1537651206623862794/macro-engine.ts?ex=6a807987&is=6a7f2807&hm=7f8ea60a1aa82a25c99e234eceb61c764ebde3a6e60f912f45cf2163db0b40f4f4&. Attached image: https://cdn.discordapp.com/attachments/1537564144256028742/1537651206967529552/image.png?ex=6a807987&is=6a7f2807&hm=43dee54ee8c192c569bdeaf9fe5f3c4583a3539366054e97450276ac8cb0adb5&.Additional context
The existing
{{incvar::name}}and{{decvar::name}}macros only support increments or decrements of 1. The requested behavior mirrors SillyTavern's numeric addvar behavior while preserving Marinara's existingaddvarbehavior. The use case is adding dice-roll modifiers before comparing the result against a difficulty class. Marinara indicated that this can be added.Discord thread: [FR] Add addnumvar macro for numeric variable addition
Discord thread link: https://discord.com/channels/1417099416812392641/1537564144256028742
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)
Discord thread transcript (5 messages)
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: