Ask block (read op before posting)

id: 753135

category: Suggestions

posts: 4

This block is different from the
ask [] and wait
block. That block would pause the entire script until answered. I'm suggesting the
ask [] ::sensing
block.
This would ask the question while continuing the script. Not waiting for it to be answered. Once answered all that would happen is the text would go away. And the answer reporter would return as the answer.

If you do:
when green flag clicked
ask [] ::sensing
if <(answer) = [fish]> then
...

end

It would return the answer block as nothing until the question is answered.

If you do:
when green flag clicked
ask [] ::sensing
wait (1) secs //and the person does not answer the question during the 1 second
ask [?] ::sensing
Then it would reset the answer reporter. And set it to the answer once answered

Q&A:
none yet.

Malicondi Malicondi loading

DangerPuppy10 wrote:

If you do:
when green flag clicked
ask [] ::sensing
if <(answer) = [fish]> then
...

end
It's ask and wait for a reason. if you use this script above, unless you're superhuman and can type fish in mere milliseconds, the script will simply do nothing as you have no time to properly give an answer. If you want to ask something and continue scripts after it, use a broadcast to use the ask block.

Malicondi wrote:

DangerPuppy10 wrote:

If you do:
when green flag clicked
ask [] ::sensing
if <(answer) = [fish]> then
...

end
It's ask and wait for a reason. if you use this script above, unless you're superhuman and can type fish in mere milliseconds, the script will simply do nothing as you have no time to properly give an answer. If you want to ask something and continue scripts after it, use a broadcast to use the ask block.
You wouldn't be able to stop the ask and wait block from a broadcast after a certain time without having to use:
stop [other scripts in sprite v]
which obviously disrupts other running broadcasts. With the first example aside, the other examples seem reasonable
Malicondi Malicondi loading

ajskateboarder wrote:

You wouldn't be able to stop the ask and wait block from a broadcast after a certain time without having to use:
stop [other scripts in sprite v]
which obviously disrupts other running broadcasts. With the first example aside, the other examples seem reasonable
No, rebroadcasting a script restarts it allowing you to ask again, although since there's no way to hide or cancel a ask dialogue, that would still be a problem prevalent in both the workaround and the suggestion, although a fix for that is a suggestion on its own.

I can see how this can be used, but I don't imagine ever using it as normally you need the response from the user as soon as they're done, hence ask and wait.

Edit: unless that's part of the suggestion, with the second example it would just stack ask dialogues which scratch already does if you ask multiple things at once. It'll show the oldest dialogue, and as you finish then the others will show. Stopping that and making a new box for an answer would have to be a separate part of the suggestion