What is a condition?

I just want to know the difference between an event and a condition.
It has been a while since I used Snap! and I am trying to figure out how the new Snap! Custom Hats work. I found out that if the hat block reports true, the script runs, but I don't understand what a condition is.

An event hat runs once when the result is true, but then it doesn't run again until the result is false, and then true again.

A condition hat is similar to what the old when <> block did, it runs while the result is true (the when <> block is now an event hat, but you can still get the old condition hat version by relabeling it).

You can think of an event like the when I start as a clone block. It runs when the clones is first created, it doesn't repeatedly run while the clone exists.

Generally speaking, a condition is something that can either be true or false (though intuistionist logicians, and quantum theorists, will reject the "law of excluded middle"). A condition may last for any amount of time.
An event is something that, theoretically, happens "in no time at all". The very moment a condition starts being true, or false, may be called an event.

In summary, Condition hats are syntactic sugar for

forever{
if <>{
...
}}

, while Event hats are like

forever{
if <>{
...
wait until <not <>>
}}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.