My stage is broadcasting something but my sprite is not receiving the broadcast. Does anybody know why this might be?
Offline
Are you sure that they're broadcasting/receiving the same broadcast? And how do you know that your sprite isn't receiving the broadcast?
Offline
As ErnieParke said, check both 'sides' are working, and that the two broadcast titles are exactly the same. Then maybe check that there's not a problem with the script after the recieving block. Try using single-stepping mode if you're having trouble pinpointing the problem.
Offline
Try some debugging "say" blocks so you can check if the broadcasts are working. Like this:
say [broadcasting...] for (2) secs broadcast [go v] when I receive [go v] say [Broadcast received!] for (2) secs do stuffThen take out the says when you have found the source of the problem.
Last edited by joefarebrother (2012-11-14 11:59:34)
Offline
Hi everyone, I'm making a game on Scratch and am trying to use Broadcast to change backgrounds. At the end of every one of my backgrounds, I have a yellow strip. I have a script on my only moving sprite that is as follows: When Flag Clicked, Forever, If (touching color yellow), broadcast (change backgrounds). Then on my stage I have a script that goes like this: When I Receive (change backgrounds), next background. When my moving sprite touches the yellow strip, the backgrounds all flash wildly, and sometimes I end up on the next background, and sometimes I don't. I've tried just putting the broadcast command in an If statement, but then the code doesn't work. Does anyone know why this is or how to help? Thanks in advance!!
Offline
You might want to create your own topic for this.
Have tried using 'broadcast change backgrounds and wait'.? Otherwise, it'll just keep broadcasting 'change backgrounds' regardless of whether the script on the other end has finished executing. This might be why your background keeps 'flashing wildly'. And if you only want the background to change once when the sprite touches the yellow strip, make sure to add some code so 'change backgrounds' is only broadcast once.
Offline
EmmaSpikes11 wrote:
Hi everyone, I'm making a game on Scratch and am trying to use Broadcast to change backgrounds. At the end of every one of my backgrounds, I have a yellow strip. I have a script on my only moving sprite that is as follows: When Flag Clicked, Forever, If (touching color yellow), broadcast (change backgrounds). Then on my stage I have a script that goes like this: When I Receive (change backgrounds), next background. When my moving sprite touches the yellow strip, the backgrounds all flash wildly, and sometimes I end up on the next background, and sometimes I don't. I've tried just putting the broadcast command in an If statement, but then the code doesn't work. Does anyone know why this is or how to help? Thanks in advance!!
Please make your own topic
Offline
Both sides are there and about "says" blocks there is a 'says' block directly after recieving the broadcast
Offline
Um, @Blazingwave, I figured since this is the "Help with Scripts" broadcasting page, my topic might be relevant. Sorry if you think otherwise, but that was really not needed.
Offline
EmmaSpikes11 wrote:
Um, @Blazingwave, I figured since this is the "Help with Scripts" broadcasting page, my topic might be relevant. Sorry if you think otherwise, but that was really not needed.
Ah, actually they were kind of right. This isn't a main topic for broadcasting help; it's a specific topic that Blazingwave created for help with the problems they were having with broadcasting.
When you have a problem where you need help with scripts it's best to press Post New Topic in Help With Scripts since that way you can get more help with your specific problem. Also it allows for these threads to close when the problem is solved and be more easily used for reference.
Hope that cleared this up; sorry if it came off sounds strange ^^ And if you still need help with your problem then I do advise making a new topic since people are more likely to notice; I'll keep my eye out for one in case.
Offline
@BetaSmozzick thanks for clearing that up for me. I was just unsure about what Blazingwave said. Sorry! BTW, my game is fixed now!
Offline