Discuss Scratch

Charles12310
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

You know how broadcasts send them to all sprites and receive them? Well, what about sending broadcasts to only specific ones?

Let's say you put a script on when a broadcast is received on one sprite, and you put a different script when a broadcast is received on another sprite. You want that only one sprite to receive the broadcast, but then the other sprites receive the broadcast too, scripting them making the project functions not what you want them to be.

// It can look like this:

send broadcast [ v] to [sprite v] :: events // "Myself" would also be included in the dropdown, just like creating a clone.

// Or this:

broadcast [ v] to [sprite v] :: events
But If you want to send a broadcast to more than one sprite, quickly, just do this:

// Run this block without Screen Refresh:

define send broadcast to 3 sprites
broadcast [event v] to [sprite 1 v] :: events
broadcast [event v] to [sprite 2 v] :: events
broadcast [event v] to [sprite 3 v] :: events

Or just put the blocks without the define block in a script if you don't want them to run quickly.

SUPPORTERS
@Charles12310
@LionHeart70
NO SUPPORTERS
@FancyFoxy

Last edited by Charles12310 (Aug. 2, 2017 22:36:18)

LionHeart70
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

Support. This would be useful.
FancyFoxy
Scratcher
500+ posts

Send Broadcast To Only A Specific Sprite(s)

You can work around by just making a new broadcast that only gets picked up by one sprite.
And if you don't want to put the same script twice or more, just use custom blocks.
No support, as I don't feel like it's really necessary.
WaffleChurro
Scratcher
100+ posts

Send Broadcast To Only A Specific Sprite(s)

No support because you can just ignore the broadcast that don't mean anything to the sprite
yzyzyz
Scratcher
500+ posts

Send Broadcast To Only A Specific Sprite(s)

No support. This will make things a lot more complicated.
bigpuppy
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

I think this is a good idea – sometimes broadcast lists get really long.
Also, by default, I think the dropdown should be at “all”:

broadcast [ v] to [all v] :: events
This would help people that didn't want to broadcast things to different sprites do stuff quicker.
Charles12310
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

bigpuppy wrote:

I think this is a good idea – sometimes broadcast lists get really long.
Also, by default, I think the dropdown should be at “all”:

broadcast [ v] to [all v] :: events
This would help people that didn't want to broadcast things to different sprites do stuff quicker.
nah, the regular broadcast block it the alternate of all.

Here is another reason: Maybe all sprite have the same script when received, but what if you want them to happen at different times?
VideoGamerCanInvent
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

It doesn't really make a difference to the current broadcast system.
Galleigo
Scratcher
500+ posts

Send Broadcast To Only A Specific Sprite(s)

Workaround
when I receive [a v] // make multiple broadcasts, dude.
when I receive [b v] // i'm not sure why you only need one broadcast
walkcycle
Scratcher
500+ posts

Send Broadcast To Only A Specific Sprite(s)

Broadcast means it goes to everyone tuned to receive the broadcast. So, either don't have a receive hat on a specific sprite (for a specific broadcast) or use a stage variable to control how (or whether) a specific sprite that receives a broadcast acts on it.
Botcho_Otkho
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

removed

Last edited by Botcho_Otkho (July 19, 2020 16:46:29)

megaman100
Scratcher
100+ posts

Send Broadcast To Only A Specific Sprite(s)

Support!

Last edited by megaman100 (Nov. 24, 2018 04:52:59)

TheAdriCoolManDude
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

megaman100 wrote:

Support!
Why do you support?

Anyways, No Support, just leave the sprites that don't need the broadcast ignoring it, and send it to the sprite that needs it.
LuckyLucky7
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

TheAdriCoolManDude wrote:

megaman100 wrote:

Support!
Why do you support?

Anyways, No Support, just leave the sprites that don't need the broadcast ignoring it, and send it to the sprite that needs it.

Galleigo wrote:

Workaround
when I receive [a v] // make multiple broadcasts, dude.
when I receive [b v] // i'm not sure why you only need one broadcast

VideoGamerCanInvent wrote:

It doesn't really make a difference to the current broadcast system.

WaffleChurro wrote:

No support because you can just ignore the broadcast that don't mean anything to the sprite
No support for all of the above.
CKCG
Scratcher
100+ posts

Send Broadcast To Only A Specific Sprite(s)

No support. Just create more broadcasts. It's such an easy workaround that it's unneccesary.
duckboycool
Scratcher
1000+ posts

Send Broadcast To Only A Specific Sprite(s)

AnAccount_StopAsking
Scratcher
500+ posts

Send Broadcast To Only A Specific Sprite(s)

duckboycool wrote:

Duplicate.
It's closed.
ScratchUser139
Scratcher
73 posts

Send Broadcast To Only A Specific Sprite(s)

If you really want one here ya go:
ask [Who's going to dance next?] and wait
set [who's receiving do a cool dance v] to (answer)
broadcast [do a cool dance v] and wait
play sound [Hooray! v] until done

when I receive [do a cool dance v] // in Gobo's code
if <(who's receiving do a cool dance) = [Gobo]> then
point in direction (45 v)
repeat (4)
repeat (10)
move (10) steps
end
turn cw (90) degrees
end
end

when I receive [do a cool dance v] // in Tera's code
if <(who's receiving do a cool dance) = [Tera]> then
set rotation style [left-right v]
repeat (5)
point in direction (90 v)
glide (1) secs to x: (50) y: (100)
point in direction (-90 v)
glide (1) secs to x: (50) y: (-50)
end
end
nikky10000000
Scratcher
500+ posts

Send Broadcast To Only A Specific Sprite(s)

just leave the sprites you don't wanna give the broadcast to empty. if you wanna receive a brodcast for different sprites at different times, then make multiple. no support.

Powered by DjangoBB