Discuss Scratch

medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

This block since for some reason they had a backdrop equivalent but no costume ver:

Workaround:

If you can't see it:

Last edited by medians (Jan. 21, 2023 03:22:10)

hill_walker123
Scratcher
100+ posts

Scratch Workaround Guide VII

_nix wrote:

But I didn't actually change any of the idea which makes it work (imagining a circle around the pivot and using cos and sin blocks to rotate around that), so I made sure to still include full credits to you. Is it alright if I add the version I did to the workaround guide, with credits for the original code and idea to you?
yes, it's fine with me!
hill_walker123
Scratcher
100+ posts

Scratch Workaround Guide VII

medians wrote:

This block since for some reason they had a backdrop equivalent but no costume ver:

Workaround:

If you can't see it:

you can use scratchblocks
switch costume to [random costume v]

switch costume to ((0) + (0))
set [# of costumes v] to (costume [number v] :: looks)
switch costume to (pick random (1) to (# of costumes))
that's visible to everyone

Last edited by hill_walker123 (Jan. 23, 2023 16:30:49)

medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

The blocks in method 1 of delete last item of list are messed up. They should be:

Or in scratchblocks:
set [popped value v] to (item (length of [list v] :: list) of [list v] :: list)
delete (length of [list v]) of [list v]

hill_walker123 wrote:

medians wrote:

you can use scratchblocks
switch costume to [random costume v]

switch costume to ((0) + (0))
set [# of costumes v] to (costume [number v] :: looks)
switch costume to (pick random (1) to (# of costumes))
that's visible to everyone
Yeah I know.
Repeat until message:

Repeat until message ended can be done by changing = 1 to 0, and if you want to wait until the message starts in the first place, you can add:

You can also add this before the repeat until loop in repeat until message but with 0 for a similar thing.
MSE666
Scratcher
26 posts

Scratch Workaround Guide VII

DON'T CREATE CODE BLOCK ON TO LOW FGS
when I start as a clone
create clone of [ v]
delete this clone
OR
when green flag clicked
forever
add (HELP ME:: list) to [HELP ME v]
end
INSERT-USER_NAME
Scratcher
1000+ posts

Scratch Workaround Guide VII

MSE666 wrote:

DON'T CREATE CODE BLOCK ON TO LOW FGS
when I start as a clone
create clone of [ v]
delete this clone
OR
when green flag clicked
forever
add (HELP ME:: list) to [HELP ME v]
end
those don't work and i'm on a school chromebook
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

MSE666 wrote:

DON'T CREATE CODE BLOCK ON TO LOW FGS
when I start as a clone
create clone of [ v]
delete this clone
OR
when green flag clicked
forever
add (HELP ME:: list) to [HELP ME v]
end
Okay but blocks that do this cannot be shared because they crash Scratch.
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

when can i have the sticky
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

_nix wrote:

Method 2: trigonometric “point towards”

This method uses the trigonometry function “atan” to calculate the direction between your current position and the target with math.

define point towards x: (target x) y: (target y)
point in direction ([atan v] of (((target x) - (x position)) / ((target y) - (y position)))
if <(target y) < (y position)> then
turn cw (180) degrees
end
This can be shortened to:
define point towards x: (target x) y: (target y)
point in direction (([atan v] of (((target x) - (x position)) / ((target y) - (y position)))) + ((180) * <(target y) < (y position)>))
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

1080GBA wrote:

when can i have the sticky
Please stop asking. I will make a post clearly stating that I'm looking to have someone else maintain the thread or create their own workaround guide. I haven't decided when yet, so you'd be better off not expecting it any time soon. It'll probably be when I'm less active on the site in general or am too busy with other work to make suitable updates.

In my opinion, besides adding newly shared workarounds every now and then (which I am still doing!), the guide doesn't currently need that much maintenance or expanding, which is why I am not handing it off to anyone else right now.
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

1080GBA wrote:

when can i have the sticky
And that's how you not get the sticky. She is still maintaining it.
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

medians wrote:

_nix wrote:

define point towards x: (target x) y: (target y)
point in direction ([atan v] of (((target x) - (x position)) / ((target y) - (y position)))
if <(target y) < (y position)> then
turn cw (180) degrees
end
This can be shortened to:
Thanks! But I won't be using this one — see, my goal is to have readable code that is easy to understand and learn from, not code that is absolutely as compact as it can possibly be. The main advantage of compact code is that it takes less space if you have to use it a bunch of times, but most people will just reuse the custom block. And, if a person's project is lagging a lot, this probably won't make much of a performance difference compared to bigger changes in code design. I think the benefits of readable code outweighs the benefits of compact code in this case.
xz-Blaze
Scratcher
1000+ posts

Scratch Workaround Guide VII

1080GBA wrote:

when can i have the sticky
not right now. she is still maintaining this sticky.
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

medians wrote:

The blocks in method 1 of delete last item of list are messed up. They should be:

Or in scratchblocks:
set [popped value v] to (item (length of [list v] :: list) of [list v] :: list)
delete (length of [list v]) of [list v]
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

medians wrote:

medians wrote:

The blocks in method 1 of delete last item of list are messed up. They should be:

Or in scratchblocks:
set [popped value v] to (item (length of [list v] :: list) of [list v] :: list)
delete (length of [list v]) of [list v]
Got it, thanks! I'll have a lookie over other recent feedback later today.

edit: lmao sorry I screwed up an SSD with the OS install for my secondary comp / local file server and spent the afternoon getting that fixed. If nothing goes terribly awry I'll make halfway good on that promise tomorrow!

Last edited by _nix (Feb. 14, 2023 01:53:05)

inom5962dojo
Scratcher
100+ posts

Scratch Workaround Guide VII

The reason new people want new Blocks is so it’s easier to do things, people who are inexperienced at coding are not going to think of these, and only like 1% of Scratchers use the fourms(not sure if that’s right, I think I saw it somewhere) These long scripts could be simplified into just one block, that’s the point of new blocks.
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

inom5962dojo wrote:

The reason new people want new Blocks is so it’s easier to do things, people who are inexperienced at coding are not going to think of these, and only like 1% of Scratchers use the fourms(not sure if that’s right, I think I saw it somewhere) These long scripts could be simplified into just one block, that’s the point of new blocks.
You're kind of right, but that's sort of the beauty of learning — as you code more and look at how other people do things (with “see inside”, through the forums, or by checking out tutorial projects!), you start to get better at coming up with solutions to code problems which could use a single block, but are actually solvable with all the code already available! So, it does end up being a little harder for beginning Scratchers, but I think it's a healthy amount of challenge: there isn't much reason to learn the finer nuances of programming if every essential block is already available to you.

That's something I keep in mind with this workaround guide: Some Scratchers just really need a code block available to them, and aren't interested in figuring out exactly how to get it to work themselves. For those people, it's nice to have workarounds available. But the big goal with this guide, which makes it different from the ones before it, is that I want to gently teach people how the workarounds work, so that they have some coding ideas to think about whenever they use that workaround. I want to help introduce people who are less experienced with Scratch to concepts they might not have experimented with much before.

That's why workarounds are great — there's a great variety of frequently suggested blocks, and workarounds for them use many different kinds of blocks and ideas! By sharing those workarounds and going into a little detail about how they work, I can help show many different concepts in bite-sized pieces. I try not to go into a ton of detail, so I don't overwhelm most people and make them think they could never learn the ideas. It's just a small example in each workaround, but I hope it goes some way to help people warm up to ideas and start thinking about and using them more.
inom5962dojo
Scratcher
100+ posts

Scratch Workaround Guide VII

_nix wrote:

inom5962dojo wrote:

The reason new people want new Blocks is so it’s easier to do things, people who are inexperienced at coding are not going to think of these, and only like 1% of Scratchers use the fourms(not sure if that’s right, I think I saw it somewhere) These long scripts could be simplified into just one block, that’s the point of new blocks.
You're kind of right, but that's sort of the beauty of learning — as you code more and look at how other people do things (with “see inside”, through the forums, or by checking out tutorial projects!), you start to get better at coming up with solutions to code problems which could use a single block, but are actually solvable with all the code already available! So, it does end up being a little harder for beginning Scratchers, but I think it's a healthy amount of challenge: there isn't much reason to learn the finer nuances of programming if every essential block is already available to you.

That's something I keep in mind with this workaround guide: Some Scratchers just really need a code block available to them, and aren't interested in figuring out exactly how to get it to work themselves. For those people, it's nice to have workarounds available. But the big goal with this guide, which makes it different from the ones before it, is that I want to gently teach people how the workarounds work, so that they have some coding ideas to think about whenever they use that workaround. I want to help introduce people who are less experienced with Scratch to concepts they might not have experimented with much before.

That's why workarounds are great — there's a great variety of frequently suggested blocks, and workarounds for them use many different kinds of blocks and ideas! By sharing those workarounds and going into a little detail about how they work, I can help show many different concepts in bite-sized pieces. I try not to go into a ton of detail, so I don't overwhelm most people and make them think they could never learn the ideas. It's just a small example in each workaround, but I hope it goes some way to help people warm up to ideas and start thinking about and using them more.

Wow, thanks for responding so in depth! That’s a good point!
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

hill_walker123 wrote:

_nix wrote:

But I didn't actually change any of the idea which makes it work (imagining a circle around the pivot and using cos and sin blocks to rotate around that), so I made sure to still include full credits to you. Is it alright if I add the version I did to the workaround guide, with credits for the original code and idea to you?
yes, it's fine with me!
Thanks, I've gotten around to adding this now! Have a look near the top of the Motion, Looks & Sound section.

update:

medians wrote:

This block since for some reason they had a backdrop equivalent but no costume ver:

Workaround:
Thanks! I've got this added too. Check out the bottom of Motion, Looks & Sound — it's placed after the related “# of costumes” workaround.

I've also updated the Looks section to mention that none of those “switch costume” workarounds are needed for backdrops, since those already have options right in the block dropdown menu. Thanks for pointing that out for “random costume”!

Last edited by _nix (Feb. 14, 2023 14:12:55)

INSERT-USER_NAME
Scratcher
1000+ posts

Scratch Workaround Guide VII

I found a workaround that can be very dangerous if misused, and as such, I'm not too sure if I should post it here.

Powered by DjangoBB