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 repeat action & tweak untrigger filter #1411

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

Pablete1234
Copy link
Member

@Pablete1234 Pablete1234 commented Oct 11, 2024

Modifies the 1.5 proto default behavior for untrigger-filter back to never whenever the action is filtered. This is because we've realized that otherwise recursive actions will cause infinite recursion on untrigger by default, which is undesired behavior.
So now in proto 1.5, when an action has no filter, it defaults to untrigger-filter="always", but whenever it's filtered or map is in an older proto, it defaults to never.

Additionally a repeat action has been introduced. This allows for loops without recursion within actions:

<actions>
  <repeat times="var * 2" filter="allow">
    <message text="This message is repeating a bunch of times!"/>
  </repeat>
</actions>

When var is 5, this will send the message 10 times in chat. Note that times takes in a function, so you can do things as simple as times="5" or as complex as to mix-in variables, and math operations. Non-whole numbers will be rounded down, negative numbers will cause no iterations (it won't run the inner action).

The filter will be run as many times as the loop is ran, for performance reasons if you want the filter to be checked just once move it outside the repeat like action filter="x" -> repeat.
Untriggering has no effect whatsoever over the repeat action, it will not propagate any untrigger signal downwards

Signed-off-by: Pablo Herrera <pabloherrerapalacio@gmail.com>
@Pablete1234 Pablete1234 merged commit 852bf3d into dev Oct 11, 2024
2 checks passed
@Pablete1234 Pablete1234 deleted the add-repeat-action branch October 11, 2024 16:44
TheRealPear added a commit to TheRealPear/PGM-Docs that referenced this pull request Oct 12, 2024
Based on updates in PGMDev/PGM#1411

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>
CoWinkKeyDinkInc added a commit to PGMDev/Website that referenced this pull request Oct 15, 2024
* Document proto 1.5.0

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

* Implement CoWink's suggested change

Co-authored-by: Patrick <CoWinkKeyDinkInc@users.noreply.github.com>
Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

* Delete extra word

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

* Implement Pablo's suggested change (part 1)

Co-authored-by: Pablo Herrera <pabloherrerapalacio@gmail.com>
Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

* Implement Pablo's suggested change (part 2)

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

* Adjust untrigger notes

Based on updates in PGMDev/PGM#1411

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

* Fix XML issue in Race for Victory example

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>

---------

Signed-off-by: Pear <20259871+TheRealPear@users.noreply.github.com>
Co-authored-by: Patrick <CoWinkKeyDinkInc@users.noreply.github.com>
Co-authored-by: Pablo Herrera <pabloherrerapalacio@gmail.com>
Pablete1234 added a commit that referenced this pull request Nov 30, 2024
Signed-off-by: Pablo Herrera <pabloherrerapalacio@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants