Custom cap blocks

uh huh...
how?
dev mode? something else?

load it in the 10.0 test branch Snap! Build Your Own Blocks

okay thanks

if you turn off the boolean, the primitive won't change the block's shape
untitled script pic (2)
untitled script pic (3)
i wonder what the purpose for that is though

turning off the bool actually disables the block entirley so it would ofc stop the shape change

i think its so you can make branching logic with editing the primitives

Another good reason to add custom cap blocks is to indicate whether the definition inside will surely stop any more blocks from running.

For example, if I put a forever block in a definition, that block should become a cap.

[scratchblocks]
(test 123::grey stack)::control hat
forever
[/scratchblocks]

[scratchblocks]
test 123::grey cap
[/scratchblocks]

image
isn't this block good enoough ?

This is a hat block. A hat block starts a script, such as
[scratchblocks]
when green flag clicked::control
[/scratchblocks]

A cap block is a block that ends a script and prevents any more blocks from being placed below, such as
[scratchblocks]
stop [all v]
[/scratchblocks]

... from the plumbing term "cap" for the thing you screw onto the end of a pipe to stop water pouring out from it:
cap

Having two things called "hat block" and "cap block" is really confusing, since a "cap" is also a kind of hat:
cap2

This is imho a surprising bad nomenclature we inherit from Scratch.

It may be not as elegant as the feature requested, but untitled script pic (19) will do the job (when applied at the end of a block all it does is prevent other blocks from being attached, I suppose - or is there a catch?).

as far as i can tell the word "cap" is never used to reffer to that kind of block shape in snap

I think it is, from what I saw on the Scratch Forums.

yes it is

back when I was a Scratch developer we never called them "cap" blocks. Unlike hat blocks and reporter blocks these didn't have a special "type" name of their own, they were just regular command blocks with a "isStop" attribute. I don't know who came up with that word, but I bet it's kids in some wiki. Personally I've never understood the infatuation some folks develop about them. I rember that back in 2007 one of the first arguments I got into with a group of teachers who were seeking advice how to force kids to always end every script with a stop block, because only then would it be "proper programming style".

Huh, you were a scratch dev?

Thats what I said

how is that "proper programming style" though? I think snap and scratch do it right imo

EPIC
That is awesome ( for documentation purposes. (For example, an end game block)

He is saying that the teachers thought so.

not him.

I know

Oh. Okay. It doesn't make much sense to me either.