Discuss Scratch

23 posts

Hat Block Modding

I don't know whether this was asked already, but I can't find it anywhere on my various searches on the Advanced Topics forum.

I have worked out how to make new blocks in Scratch and change old ones, but I've noticed that where scripts which make the blocks function would be, the hat blocks are in a different section on that script under getHats() and don't have any normal code, but instead have two properties:
  • restartExistingThreads: <boolean>,
  • edgeActivated: <boolean>
My question is, how do I edit a hat block's codes, or add existing hat blocks with functional code?

Additionally, I believe restartExistingThreads is to restart threads started by the exact same hat block upon activation of that hat block again, but I can't quite work out for what edgeActivated is used. What is edgeActivated's purpose?

Any help is appreciated, thanks.

There's Great News, and then there's BAD News.
The great news is that the evil kumquats have given up on eating signatures!
The BAD news is (removed by guavas - bow down to your guava overlords).

Last edited by The Empire of Guavas (May 18 2020 23:16:42)
1000+ posts

Hat Block Modding

Hat blocks are triggered by a `startHats` method in the runtime

I think edgeActivated blocks are like the when <> block where they call a predicate to see it should trigger (such as the when _ > _ block)

- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }

Powered by DjangoBB

Standard | Mobile