[GH-ISSUE #6922] [Feature]: "until"/"while" condition for macro based decisions #3880

Closed
opened 2026-10-21 06:08:25 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @usagirei on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6922

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Currently we can ask the decision model to conditionally enable a block via {{#if decision:... }}.
For persistence, we have sticky:N and cooldown:N parameters.
The addition of new condition parameters that can extend or shorten the block lifetime would extend the functionality.

Proposed solution

Following a yes decision, when one of these parameters are present, the decision model is also asked whether the entry should stay active / be deactivated

  • until:"..."[:mode?] - disables the block when the model determines true|yes
  • while:"..."[:mode?] - disables the block when the model determines false|no
  • while and until should be exclusively used, as they are the same condition with inverted results
  • mode takes and|or and determines how the conditions interact with the presence of sticky
    • Allow restrict|extend as alternate keywords as it simplifies reasoning about it
  • if sticky is unset, mode can be omitted (until:"...") as the lifetime is determined only by the condition now
  • conversely, if sticky is set, mode should be present or default to a sane value (restrict|and for until; extend|or for while)

Cooldown then applies normally after deactivation.


With Sticky Turns

Syntax Keep Active Logic Lifetime Behavior
while:"...":and sticky:<N> condition == true AND sticky_turns > 0 Cut Short The block is disabled if the condition resolves to no OR if the sticky turns expire. It requires both to be true to stay active.
while:"...":or sticky:<N> condition == true OR sticky_turns > 0 Extended The block stays active as long as either the condition is true or there are sticky turns left.
until:"...":and sticky:<N> condition == false AND sticky_turns > 0 Cut Short The block is disabled if the condition resolves to yes OR if the sticky turns expires.
until:"...":or sticky:<N> condition == false OR sticky_turns > 0 Extended The block stays active as long as either condition is false or there are sticky turns left.

The AND mode creates a restriction on the active time - it only lasts until the timer expires, or the condition triggers
The OR mode creates an extension to the active time - it stays active indeterminately based on the condition


Without Sticky Turns

Syntax Keep Active Logic Lifetime Behavior
while:"..." condition == true Variable The block stays active as long as the condition evaluates to true.
until:"..." condition == false Variable The block deactivates when the condition evaluates to true.

Alternatives considered

Additional context

Examples:

activates on combat start and stays until combat has ended:
decision:"combat has started this turn" until:"combat has ended this turn"

activates on spell usage, and stays for n turns at minimum, extended if the user has not moved
decision:"{{user}} has used a stealth spell" while:"{{user}} has not moved":extend sticky:5

activates on spell usage, and stays for n turns at most, while the user is undetected
decision:"{{user}} has used a stealth spell" until:"{{user}} was detected":restrict sticky:5

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @usagirei on GitHub (Sep 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6922 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Currently we can ask the decision model to conditionally enable a block via `{{#if decision:... }}`. For persistence, we have `sticky:N` and `cooldown:N` parameters. The addition of new condition parameters that can extend or shorten the block lifetime would extend the functionality. <!-- Describe the pain point or gap this feature would address --> ## Proposed solution Following a `yes` decision, when one of these parameters are present, the decision model is also asked whether the entry should stay active / be deactivated * `until:"..."[:mode?]` - disables the block when the model determines `true|yes` * `while:"..."[:mode?]` - disables the block when the model determines `false|no` * while and until should be exclusively used, as they are the same condition with inverted results * `mode` takes `and|or` and determines how the conditions interact with the presence of sticky * Allow `restrict|extend` as alternate keywords as it simplifies reasoning about it * if sticky is unset, mode can be omitted (`until:"..."`) as the lifetime is determined only by the condition now * conversely, if sticky is set, mode should be present or default to a sane value (`restrict|and` for until; `extend|or` for while) Cooldown then applies normally after deactivation. --- With Sticky Turns | Syntax | Keep Active Logic | Lifetime | Behavior | | :--- | :--- | :--- | :--- | | `while:"...":and sticky:<N>` | `condition == true` **AND** `sticky_turns > 0` | Cut Short | The block is disabled if the condition resolves to no **OR** if the sticky turns expire. It requires both to be true to stay active. | | `while:"...":or sticky:<N>` | `condition == true` **OR** `sticky_turns > 0` | Extended | The block stays active as long as *either* the condition is true *or* there are sticky turns left. | | `until:"...":and sticky:<N>` | `condition == false` **AND** `sticky_turns > 0` | Cut Short | The block is disabled if the condition resolves to yes **OR** if the sticky turns expires. | | `until:"...":or sticky:<N>` | `condition == false` **OR** `sticky_turns > 0` | Extended | The block stays active as long as *either* condition is false *or* there are sticky turns left. | The AND mode creates a restriction on the active time - it only lasts until the timer expires, or the condition triggers The OR mode creates an extension to the active time - it stays active indeterminately based on the condition --- Without Sticky Turns | Syntax | Keep Active Logic | Lifetime | Behavior | | :--- | :--- | :--- | :--- | | `while:"..."` | `condition == true` | Variable | The block stays active as long as the condition evaluates to true. | | `until:"..."` | `condition == false` | Variable | The block deactivates when the condition evaluates to true. | <!-- What would you like to see added or changed? --> ## Alternatives considered <!-- Any other approaches you thought about? --> ## Additional context Examples: activates on combat start and stays until combat has ended: `decision:"combat has started this turn" until:"combat has ended this turn"` activates on spell usage, and stays for n turns at minimum, extended if the user has not moved `decision:"{{user}} has used a stealth spell" while:"{{user}} has not moved":extend sticky:5` activates on spell usage, and stays for n turns at most, while the user is undetected `decision:"{{user}} has used a stealth spell" until:"{{user}} was detected":restrict sticky:5` <!-- Optional: mockups, related issues, references, or examples --> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3880
No description provided.