Discuss Scratch

WilliamA99
Scratcher
2 posts

make a 'íf i receive a message' block

this is what I mean:

if <I recieve [message1 v]> then

end

Last edited by WilliamA99 (July 17, 2016 02:05:30)

cs156175
Scratcher
1000+ posts

make a 'íf i receive a message' block

easy workaround.

when I receive [message v]
...::grey
DownsGameClub
Scratcher
1000+ posts

make a 'íf i receive a message' block

Sorry, but there is too much ambiguity for this block-

The Scratch Team wrote:

There is way too much ambiguity to how this would work. Would it return true of the broadcast was fired at any point since the project was created, since the green flag was clicked, since something else was broadcasted, etc.? If you really want to do something like this, instead just make a variable and set it to 1 and use the equals block.
LP_Play
Scratcher
1000+ posts

make a 'íf i receive a message' block

No support. Workaround stated below;

when I receive [message1 v]
set [message1 v] to [1]
when green flag clicked
set [message1 v] to [0]
forever
if <(message1) = [1]> then
. . .
end
end

Also, please read the stickies first.

Last edited by LP_Play (July 17, 2016 01:06:07)

Sheep_maker
Scratcher
1000+ posts

make a 'íf i receive a message' block

How long does this boolean stay true once its corresponding broadcast is broadcasted?
gamebeater187
Scratcher
1000+ posts

make a 'íf i receive a message' block

Support ONLY for
if  I receive [ v] then {say [example]} end if <> :: events

Last edited by gamebeater187 (July 17, 2016 16:44:08)

zorket
Scratcher
500+ posts

make a 'íf i receive a message' block

gamebeater187 wrote:

Support ONLY for
if  I receive [ v] then {say [example]} end if <> :: events
I believe this is the equivalent of:
when I receive [ v]
repeat until <>
. . .
end
JavierR100
Scratcher
500+ posts

make a 'íf i receive a message' block

Sorry, but your suggestion is being rejected by stickies:

The stickies wrote:

9. <broadcast [ ] received> boolean
There is way too much ambiguity to how this would work. Would it return true of the broadcast was fired at any point since the project was created, since the green flag was clicked, since something else was broadcasted, etc.? If you really want to do something like this, instead just make a variable and set it to 1 and use the equals block.
Use workarounds above
Scratch on!
agarraga
Scratcher
500+ posts

make a 'íf i receive a message' block

Please agree to the sticky

9. <broadcast received> boolean
There is way too much ambiguity to how this would work. Would it return true of the broadcast was fired at any point since the project was created, since the green flag was clicked, since something else was broadcasted, etc.? If you really want to do something like this, instead just make a variable and set it to 1 and use the equals block.
CoffeeCat22
Scratcher
1 post

make a 'íf i receive a message' block

gamebeater187 wrote:

Support ONLY for
if  I receive [ v] then {say [example]} end if <> :: events
how do I make that block?
LionHeart70
Scratcher
1000+ posts

make a 'íf i receive a message' block

It's rejected, because there's too much ambiguity to how it'd work.
Botcho_Otkho
Scratcher
1000+ posts

make a 'íf i receive a message' block

Read the sticky,this is a rejected suggestion.
Jazop06
Scratcher
17 posts

make a 'íf i receive a message' block

WilliamA99 wrote:

this is what I mean:

if <I recieve [message1 v]> then

end


U mean Like this

if <when I receive [message1 v]> then
...
end

Last edited by Jazop06 (July 27, 2017 22:45:52)

Charles12310
Scratcher
1000+ posts

make a 'íf i receive a message' block

No Support. There is a lot of confusion on how this would work. Would the block turn true for only half a second, then false? Or will it turn true forever after the broadcast being received? Or will the Boolean turn true at the start of the broadcasts, and false at the end? We don't know how this is supposed to work.

// Half A Second

when I receive [broadcast v]
set [received? v] to [true]
wait (0.5) secs
set [received? v] to [false]

when I receive [broadcast v]
...

// Forever After Receiving:

when gf clicked
set [received? v] to [false]

when I receive [broadcast v]
set [received? v] to [true]
...

// Only During Broadcast:

when gf clicked
set [received? v] to [false]

when I receive [broadcast v]
set [received? v] to [true]
...
set [received? v] to [false]
Charles12310
Scratcher
1000+ posts

make a 'íf i receive a message' block

Charles12310 wrote:

No Support. There is a lot of confusion on how this would work. Would the block turn true for only half a second, then false? Or will it turn true forever after the broadcast being received? Or will the Boolean turn true at the start of the broadcasts, and false at the end? We don't know how this is supposed to work.

// Half A Second

when I receive [broadcast v]
set [received? v] to [true]
wait (0.5) secs
set [received? v] to [false]

when I receive [broadcast v]
...

// Forever After Receiving:

when gf clicked
set [received? v] to [false]

when I receive [broadcast v]
set [received? v] to [true]
...

// Only During Broadcast:

when gf clicked
set [received? v] to [false]

when I receive [broadcast v]
set [received? v] to [true]
...
set [received? v] to [false]
However, the ones not rejected are:

if I receive [ v] {
...
} :: events

wait until I receive [ v] :: events

repeat until I receive [ v] {
...
} :: events
Botcho_Otkho
Scratcher
1000+ posts

make a 'íf i receive a message' block

gamebeater187 wrote:

Support ONLY for
if  I receive [ v] then {say [example]} end if <> :: events
What? How would this block work?
Botcho_Otkho
Scratcher
1000+ posts

make a 'íf i receive a message' block

It's a rejected suggestion.
Charles12310
Scratcher
1000+ posts

make a 'íf i receive a message' block

Charles12310 wrote:

Charles12310 wrote:

No Support. There is a lot of confusion on how this would work. Would the block turn true for only half a second, then false? Or will it turn true forever after the broadcast being received? Or will the Boolean turn true at the start of the broadcasts, and false at the end? We don't know how this is supposed to work.

// Half A Second

when I receive [broadcast v]
set [received? v] to [true]
wait (0.5) secs
set [received? v] to [false]

when I receive [broadcast v]
...

// Forever After Receiving:

when gf clicked
set [received? v] to [false]

when I receive [broadcast v]
set [received? v] to [true]
...

// Only During Broadcast:

when gf clicked
set [received? v] to [false]

when I receive [broadcast v]
set [received? v] to [true]
...
set [received? v] to [false]
However, the ones not rejected are:

if I receive [ v] {
...
} :: events

wait until I receive [ v] :: events

repeat until I receive [ v] {
...
} :: events
What About These?
walkcycle
Scratcher
500+ posts

make a 'íf i receive a message' block

Charles12310 wrote:

What About These?
Would complicate Scratch without adding any real benefit.

Powered by DjangoBB