Discuss Scratch
- Discussion Forums
- » Suggestions
- » "Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
- cooldude-222
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
WORKAROUND:read the op this is for custom blocks
message split.
Broadcast mmessage.
Have 2 scripts recieve it at the same time.
Last edited by cooldude-222 (Sept. 12, 2020 22:48:01)
- EpicGhoul993
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
WORKAROUND:
message split.
Broadcast mmessage.
Have 2 scripts recieve it at the same time.
Sorry, you have to wait 60 seconds between posts[Offtopic]Oof rip[/Offtopic]
Anyway, there actually is a quite acceptable workaround, BUT if you use many block combinations there will be lots of duplicated codes.broadcast [run 1 and 2 v]
when I receive [run 1 and 2 v]
block 1 ::custom
when I receive [run 1 and 2 v]
block 2 ::custom
And, I don't say I give this a No Support,Support.I only want to point out how the workaround given is not very affective compared to the suggestion block.Here's my opinions on the workaround. Please think before posting “ThErE's A wOrKaRoUnD1!!1!!111!”, and be constructive on the topic.
- Mountains of broadcast
Let's say you are making a wayyyy complex game, and you are forced to have several script parts to run at once. Imagine you having to make 10 broadcasts exactly like the one I give above… you know.- Screen refeshing
As I recently read from a Scratch HWS topic,[…]boardcasts force the screen to refresh, while cusrom blocks with the tick on “run without screen refresh” don't.that leads to some scary times where you do stuff really fast and don't want the player to, like, see the character runs everywhere on the screen, but the refresh ruins everything and you are left scratching your head on how to hide it from the player again.
- dimayajonelcid
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
WORKAROUND:What if it was a custom block? You would need to do tedious work to transfer all of the parameters.
message split.
Broadcast mmessage.
Have 2 scripts recieve it at the same time.
And what if you need to stop both scripts? It’s just not possible.
- Byron_Inc
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
When will it say “Hello” if I do the following script:
do {
repeat (10)
next costume
wait (.05) secs
end
}while doing {
glide (1) secs to x: (0) y: (0)
} :: control loop
say [Hello]?- cooldude-222
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
When will it say “Hello” if I do the following script:I believe it will run after both are donedo {?
repeat (10)
next costume
wait (.05) secs
end
}while doing {
glide (1) secs to x: (0) y: (0)
} :: control loop
say [Hello]
- scratch978654
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
IKR?How is this not constructive?Support, I have needed this so many times and it would be so helpful for custom blocksplease be constructive
- MrFluffyPenguins
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
what if you put a forever loop in it? does it ever do the scripts below?When will it say “Hello” if I do the following script:I believe it will run after both are donedo {?
repeat (10)
next costume
wait (.05) secs
end
}while doing {
glide (1) secs to x: (0) y: (0)
} :: control loop
say [Hello]
- lovecodeabc
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
https://scratch.mit.edu/projects/424934761/
See inside see it works .
See inside see it works .
when green flag clicked
1
define 1
...
define 2
...
when green flag clicked
2
Last edited by lovecodeabc (Sept. 16, 2020 18:32:57)
- apple502j
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
Technically Impossible.
To have multiple scripts run at the same time, we need to use new threads. That's what broadcasts do - each broadcast receiver has its own thread. Custom blocks don't use threads - it runs in the context of parent thread. In the different thread, you cannot access thread variables (aka custom block arguments). Also, we need to wait until all thread finishes executing so we need to yield. Hey, I re-designed “broadcasts”, right?
Also, thread's top block needs to be a hat block, and needs to have set opcodes, not just arbitrary command block. This makes it impossible to use the argument as a thread.
To have multiple scripts run at the same time, we need to use new threads. That's what broadcasts do - each broadcast receiver has its own thread. Custom blocks don't use threads - it runs in the context of parent thread. In the different thread, you cannot access thread variables (aka custom block arguments). Also, we need to wait until all thread finishes executing so we need to yield. Hey, I re-designed “broadcasts”, right?
Also, thread's top block needs to be a hat block, and needs to have set opcodes, not just arbitrary command block. This makes it impossible to use the argument as a thread.
- xXRedTheCoderXx
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
https://scratch.mit.edu/projects/424934761/Bruh, please use words, no-one know what you're trying to say!when green flag clicked
1
define 1
...
define 2
...
when green flag clicked
2
what if you put a forever loop in it? does it ever do the scripts below?Nope.
I believe it will run after both are doneCorrect.
Technically Impossible.Oh…
To have multiple scripts run at the same time, we need to use new threads. That's what broadcasts do - each broadcast receiver has its own thread. Custom blocks don't use threads - it runs in the context of parent thread. In the different thread, you cannot access thread variables (aka custom block arguments). Also, we need to wait until all thread finishes executing so we need to yield. Hey, I re-designed “broadcasts”, right?
Also, thread's top block needs to be a hat block, and needs to have set opcodes, not just arbitrary command block. This makes it impossible to use the argument as a thread.
So should I just close this?- MrFluffyPenguins
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
There's a block that does pretty much the same thing in Snap!
It's called “do in paralell”. It doesn't do it at the exact same time, but it's pretty close.
It's called “do in paralell”. It doesn't do it at the exact same time, but it's pretty close.
Last edited by MrFluffyPenguins (Sept. 14, 2020 16:04:39)
- cooldude-222
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
what if instead of the
do{
}while doing{
} ::controlit isstart{
} ::controlit would start running the script inside and it would also continue to run the script below- xXRedTheCoderXx
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
what if instead of theSeems interesting - but is it possible?do{it is
}while doing{
} ::controlstart{it would start running the script inside and it would also continue to run the script below
} ::control
- cooldude-222
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
they have awhat if instead of theSeems interesting - but is it possible?do{it is
}while doing{
} ::controlstart{it would start running the script inside and it would also continue to run the script below
} ::control
launch ((move (10) steps::stack)::grey) ::controlblock in snap so yes. i just feel like this would be easier to understand than that
- xXRedTheCoderXx
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
Hmm… well it seems promising. What do other people think of this idea?Seems interesting - but is it possible?they have alaunch ((move (10) steps::stack)::grey) ::controlblock in snap so yes. i just feel like this would be easier to understand than that
- SquirreIstar
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
they have aFTFYlaunch ((move (10) steps::stack)::ring grey) ::controlblock in snap so yes. i just feel like this would be easier to understand than that
Last edited by SquirreIstar (Sept. 14, 2020 16:19:00)
- MrFluffyPenguins
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
I think the “do in parallel” block from Snap! is a lot better.Hmm… well it seems promising. What do other people think of this idea?Seems interesting - but is it possible?they have alaunch ((move (10) steps::stack)::grey) ::controlblock in snap so yes. i just feel like this would be easier to understand than that
- apple502j
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
Note that Snap! and Scratch 3.0 are totally different. I believe it's based on Scratch 1.4?
- cooldude-222
-
Scratcher
100+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
^^^ They don't really seem to like itHmm… well it seems promising. What do other people think of this idea?Seems interesting - but is it possible?they have alaunch ((move (10) steps::stack)::grey) ::controlblock in snap so yes. i just feel like this would be easier to understand than that
- xXRedTheCoderXx
-
Scratcher
1000+ posts
"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)
^^^ They don't really seem to like itOnly one person said they preferred the Snap block so far, calm down.
Let's just wait a bit. ^^
