Allow wait/halt to be used as a section #8547
Open
ahmadmsaleem wants to merge 13 commits intoSkriptLang:dev/featurefrom
Open
Allow wait/halt to be used as a section #8547ahmadmsaleem wants to merge 13 commits intoSkriptLang:dev/featurefrom
ahmadmsaleem wants to merge 13 commits intoSkriptLang:dev/featurefrom
Conversation
fa65249 to
f461ac0
Compare
ahmadmsaleem
commented
Apr 16, 2026
Contributor
|
That's a neat way to do it |
Contributor
Author
this approach worked surprisingly well, idk how |
APickledWalrus
requested changes
Apr 17, 2026
sovdeeth
requested changes
Apr 25, 2026
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
APickledWalrus
requested changes
May 5, 2026
Comment on lines
+118
to
+119
| if (!isSection) | ||
| addDelayedEvent(event); |
Member
There was a problem hiding this comment.
The event is delayed regardless, no?
| Skript.debug(getIndentation() + "... continuing after " + (System.nanoTime() - start) / 1_000_000_000. + "s"); | ||
|
|
||
| // Re-set local variables | ||
| Object outerLocals = isSection ? Variables.removeLocals(event) : null; |
Member
There was a problem hiding this comment.
What's the purpose of this? I don't think the variable handling needs to be any different for sections.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
wait/haltonly work as effects today, they block the entire trigger until the delay elapses. There is no way in Skript to schedule a block of code to run later while the rest of the trigger continues immediately.Solution
Make Delay an EffectSection. EffectSectionEffect delegated setNext/getNext but not getActualNext or executionIntent, so Section.loadCode's intent walk stopped at the wrapper and missed trailing stop intents — letting inner delays leak past the section. Override both to delegate.
Effect form: unchanged.
Section form: body parses as a separate trigger under outer events with hasDelayBefore=TRUE. walk() snapshots locals, schedules the task, swaps locals in the callback so mutations stay isolated. Outer isn't delayed.
Testing Completed
Manual in game testing on a Paper server covering:
No skript test files added in this PR
wait/haltdo not currently have test scripts undersrc/test/skript/tests/and adding the first ones for this feature felt out of scope. Happy to add them in a follow upSupporting Information
This PR was made by eult :)
Completes: none
Related: none
AI assistance: Claude Opus 4.6, Used to help me writing the walk method, tests and rewrite the description