Discuss Scratch

cookieclickerer33
Scratcher
1000+ posts

Scratch Workaround Guide VII

Basilikos wrote:

Bump
you cant bump stikies
MythosLore
Scratcher
1000+ posts

Scratch Workaround Guide VII

cookieclickerer33 wrote:

Basilikos wrote:

Bump
you cant bump stikies
I’m guessing they did this to bring it above all of the closed ones.
cookieclickerer33
Scratcher
1000+ posts

Scratch Workaround Guide VII

MythosLore wrote:

cookieclickerer33 wrote:

Basilikos wrote:

Bump
you cant bump stikies
I’m guessing they did this to bring it above all of the closed ones.
stikeys dont get bumped they always stay at the same position
MythosLore
Scratcher
1000+ posts

Scratch Workaround Guide VII

cookieclickerer33 wrote:

MythosLore wrote:

cookieclickerer33 wrote:

Basilikos wrote:

Bump
you cant bump stikies
I’m guessing they did this to bring it above all of the closed ones.
stikeys dont get bumped they always stay at the same position
There’s an order that the stickies go in, too.
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

super dead forum?
PaperMarioFan2022
Scratcher
1000+ posts

Scratch Workaround Guide VII

1080GBA wrote:

super dead forum?
Nah, it's a sticky which can't be bumped (only suggestions as long as they don't cause disruption to the community I heard).
96498cb
Scratcher
100+ posts

Scratch Workaround Guide VII

_nix wrote:

wait until I receive message1

Use a variable to keep track of whether or not you’ve received the broadcast. (Choose “for this sprite only” when you create it.) The important thing is that you reset it right when you start waiting - that way you’ll only stop waiting once you receive the broadcast again, if you’ve received it before!

set [have I received message1? v] to [false]
wait until <(have I received message1?) = [true]>
say [I received it!] for (1) secs
when I receive [message1 v]
set [have I received message1? v] to [true]
wait… using this will have the same effect as just
<(have I received message1?) = [true]>
co0lcr34t10ns
Scratcher
1000+ posts

Scratch Workaround Guide VII

2D Lists, a rejected suggestion, can easily recreated with not many blocks. At least, this is how I think they work, I know jack squat about anything other than Scratch lol
set [sublist v] to (item (sublist 1 v) of [2d list v] :: list)
hide list [2d list v]
show list (sublist)
do what you want with the other list

Last edited by co0lcr34t10ns (Nov. 15, 2023 23:49:28)

Tris_das_Einhorn
Scratcher
100+ posts

Scratch Workaround Guide VII

Hey! I'd like to suggest a workaround for non-English keyboard characters which can't be detected by the
<key [ v] pressed?>
block. It's a super easy workaround but might be really useful to Scratchers who make projects in languages other than English!

Because only the plain 26 English letters are in the dropdown, to detect characters with diacritics (ä,ô,í,ű, etc.), non-latin characters (α,ж,ß,ð, etc.), and special characters (%,€,?, etc.) the following workaround can be used:

<key (join [] [special character]) pressed?>

It's much quicker than the known ascii workaround and means that projects with keyboard input can be used by Scratchers all around the world. Please consider adding it to this list!

Last edited by Tris_das_Einhorn (Nov. 19, 2023 08:57:29)

TP2222
Scratcher
100+ posts

Scratch Workaround Guide VII


define random costume
repeat (pick random (1) to (55))
next costume
end
Hee hee
undeterminstic
Scratcher
1000+ posts

Scratch Workaround Guide VII

TP2222 wrote:


define random costume
repeat (pick random (1) to (55))
next costume
end
Hee hee
stop spamming
MohammedHayyan
Scratcher
26 posts

Scratch Workaround Guide VII

_nix wrote:


boolean: “I receive (message)”


You might be right, but there is a way. Here's how it works:

when gf clicked::cat // Whatever sprite you want
set [message1 v] to [0] // In computing, 0 means it's a false condition
broadcast[message1 v]

when I receive[message1 v]:: cat // In the same sprite or another sprite
set [message1 v] to [1] // In computing, 1 means it's a true condition

when gf clicked:: cat
forever
...
. . .{

}::grey
. . .{

}::grey
. . .{

} . . .{

}::grey
if<(message1)=(1)>then
...
else
if<<not<(message1)=(1)>>and<(message1)=(0)>>then
...
end
end
...
...
end

Last edited by MohammedHayyan (Nov. 20, 2023 13:28:21)

JelliBeens-1
Scratcher
71 posts

Scratch Workaround Guide VII

Another workaround:
define shown?
set [ v] to [1]
create clone of [myself v]
set [result v] to <touching [myself v] ?>
set [ v] to [0]

when I start as a clone
if <(‌) = [1]> then
delete this clone
else
. . .
end
co0lcr34t10ns
Scratcher
1000+ posts

Scratch Workaround Guide VII

undeterminstic wrote:

TP2222 wrote:


define random costume
repeat (pick random (1) to (55))
next costume
end
Hee hee
stop spamming
He's not spamming, that's an actual suggestion
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

_nix wrote:

(#3)


rotate around sprite: (thanks, @hill_walker123!)

Use the basic trigonometry blocks “sin” and “cos” to follow the path a circle would make around the target sprite. (You can get those by dragging out the “abs of” block at the bottom of Operators and changing its dropdown menu.)

define rotate (degrees) degrees around (sprite)
set [distance v] to (distance to (sprite))
set [direction before custom block ran v] to (direction)
point towards (sprite)
set x to (([x position v] of (sprite)) + ((distance :: variables) * ([sin v] of (((direction) + (180)) + (degrees)))
set y to (([y position v] of (sprite)) + ((distance :: variables) * ([cos v] of (((direction) + (180)) + (degrees)))
point in direction (direction before custom block ran)


suggestion:
define rotate (degrees) degrees around x:[x] y:[y]
set [distance v] to ([sqrt v] of ((((x)-(x position))*((x)-(x position)))+(((y)-(y position))*((y)-(y position))))
set [original direction v] to (direction) //i just call it 'od'
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position))))+(<(y) < (y position)>*[180]))
set x to ((x) + ((distance :: variables) * ([sin v] of (((direction) + (180)) + (degrees)))
set y to ((y) + ((distance :: variables) * ([cos v] of (((direction) + (180)) + (degrees)))
point in direction ((original direction)+(degrees)) //add (degrees)-> also rotate sprite
(took me quite a bit of time to type all this thou)
tell me if anything is wrong
fancy mode edit:
define rotate (degrees) degrees around x:[x] y:[y]
set [distance v] to (distance to x:(x) y:(y)::sensing)
set [original direction v] to (direction) //i just call it 'od'
point towards x:(x) y:(y)::motion
set x to ((x) + ((distance :: variables) * ([sin v] of (((direction) + (180)) + (degrees)))
set y to ((y) + ((distance :: variables) * ([cos v] of (((direction) + (180)) + (degrees)))
point in direction ((original direction)+(degrees)) //add (degrees)-> also rotate sprite

Last edited by 1080GBA (Dec. 24, 2023 05:08:45)

1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

define wait until next second
before you think this is just a ‘wait () second’ block, its not.
for example, the project started when the (current ) is 15, but its actually 15.2 . this block will make this code wait 0.8 seconds, aka wait until current second exactly equals 16. workaround:
define wait until next second
set [second of last frame v] to (current [second v])
repeat until <not<(second of last frame)=(current [second v])>> j{
set [second of last frame v] to (current [second v])}::control loop n//no wait until screen refresh
zeer121
Scratcher
94 posts

Scratch Workaround Guide VII

Workaround for the:

when this sprite not clicked :: events hat

Block:

when green flag clicked
forever
if <not <touching [mouse-pointer v] ?>> then
say [YOU DID NOT CLICK ME] for (2) secs
end
end

Last edited by zeer121 (Jan. 2, 2024 11:16:44)

NotK3ndricAlt
Scratcher
1000+ posts

Scratch Workaround Guide VII

zeer121 wrote:

Workaround for the:

when this sprite not clicked :: events hat

Block:

Snipped block!
Actually:
when green flag clicked
forever
if <not <<touching [mouse-pointer v] ?> and <mouse down?>>> then
say [YOU DID NOT CLICK ME] for (0.1) secs // tells the computer to check everytime if the sprite is not being clicked
end
end

Last edited by NotK3ndricAlt (Jan. 2, 2024 11:17:10)

zeer121
Scratcher
94 posts

Scratch Workaround Guide VII

JelliBeens-1 wrote:

Another workaround:
define shown?
set [ v] to [1]
create clone of [myself v]
set [result v] to <touching [myself v] ?>
set [ v] to [0]

when I start as a clone
if <(‌) = [1]> then
delete this clone
else
say [Hi] for (2) secs
end
TheEpikGamer211
Scratcher
1000+ posts

Scratch Workaround Guide VII

zeer121 wrote:

JelliBeens-1 wrote:

-snip-
uhh, why are you quoting something without responding? I'm not sure if its allowed?

Powered by DjangoBB