Discuss Scratch

ScratchUser139
Scratcher
73 posts

Delayed Execution After Stopping [SOLUTION]

Read the whole text before you say it's rejected:
I know this is rejected:

Za-Chary wrote:

1.2 “When stop sign clicked” hat block
This block would allow users to click the stop sign to run a script. However, the stop sign is designed to stop all the scripts in the project. With this block in place, more scripts will start when you want the project to stop, thus defeating the purpose of the stop sign. Regardless, there are workarounds for this block using the timer or ghost effect blocks; these can be found in this post or this post.

This suggestion extends to any block that causes a script to be run as a result of the stop sign being clicked, not just the specific hat block below. For more information, see this post.

when @stopSign clicked :: events :: hat

But this feature might be done in a manner that honors the stop sign's purpose while still permitting beneficial behaviors, like cleanup scripts or UI resets. Here is a solution that solves the initial problem.

How It Works:
Rather than running scripts right away when the stop sign is clicked, this feature might function as follows:
1. All scripts stop first (as usual).
2. When stopping, any script whose name starts with “When Stop Sign Clicked” will execute.
3. This avoids any new scripts interfering with the stop sign's primary function.

Why This Works:
Prevents conflicts: Since all scripts are stopped first, the stop sign will still function as usual. The new scripts would only run after everything else is completely stopped.
Assists cleanup behaviors: This allows users to reset variables, hide sprites, or update UI controls after stopping the project.
Enhances user experience: Many users manually reset their projects when they stop them—this block does it automatically.

Alternative Implementation: “When Project Stops”:
Instead of “When Stop Sign Clicked”, the alternative would be:
“When Project Stops” – This block would run only after the stop of all scripts, so it makes it clear that it doesn't interfere with the intent of the stop sign.

This is less ambiguous and more intuitive.
ScratchUser139
Scratcher
73 posts

Delayed Execution After Stopping [SOLUTION]

bump

Powered by DjangoBB