I would REALLY like a block wheer its says when i recive (anything you want here)
as a sensing block like this. wait until i recive blah blah
like a diamond sensing one becuase you cant put the other recive block anywher but the start becuase its round edged at the top. for example what if you have a guy that has this script: When space clicked
dturn to costume 6
wait until i recive bat
while with another sprite...
When flag clicked wait ten seconds. broadcast bat
so you guys with me? and you could use it to make the most equisite and elaborate games.
Offline
ya, that has been mentioned before. i really think that block should be considered! there are so many things i could use it.
Offline
I too would welcome a "wait until I receive" block, and have even spent some time thinking about the semantics of such a block. (Search the forum for "semantics")
It is trickier than it looks at first, because of the "broadcast and wait" block.
If broadcasts always start a script from the beginning, then you are waiting for all scripts started by the block to finish. But do you wait for scripts that were continued (rather than started) by a a broadcast? Currently every script has exactly one starting condition (either a message or the greenflag), and it is easy to say when all the scripts started by a message are done.
Also, the only thing a message can do at the moment is to start new scripts. Adding the ability to continue scripts that are waiting increases the complexity of the implementation of messages.
I think that the extra complexity in the implementation would be worthwhile to Scratch programmers, but I'm not the one who would have to implement it!
Offline
to relyt: thats old. we need a new one that peaple will actully go to
Offline
to the forum moderator: if your making an rpg game, your gonna NEED that reciveing sencing block.
Offline
Jman720 wrote:
Agreed, it is a NEEDED block, I get really frusturated when I needit and it is not there. GRRRRRRRRRR
me too
Offline
pasta3049 is right in that almost anything that can be done with "wait until I receive ..." could be done with variables:
wait until var>0
set var to 0
when I receive ...
set var to 1
A "wait until I receive .." block would be simpler for the game programmer, though, so I think it is worth the Scratch team taking some time to work out a consistent and usable semantics for such a block.
Offline
kevin_karplus wrote:
pasta3049 is right in that almost anything that can be done with "wait until I receive ..." could be done with variables:
wait until var>0
set var to 0
when I receive ...
set var to 1
A "wait until I receive .." block would be simpler for the game programmer, though, so I think it is worth the Scratch team taking some time to work out a consistent and usable semantics for such a block.
thatd take ALOT of time. nd thinking. and variables. I would also like a broadcast sensing block for example. <when green flag clicked>
<if> <(<pick random( 1 )to(10) <<>(5)>
<if><< <not> Broadcast penny >>
OKay it dosent look so good but you get the picture.I know You could continue the script but id mix alot of things up if you were doing multiple scripts in one.
Offline
Heybrian, I have no idea what your code fragment is supposed to mean.
Offline
kevin_karplus wrote:
Heybrian, I have no idea what your code fragment is supposed to mean.
well it kinda messud up.
Offline
kevin_karplus wrote:
Heybrian, I have no idea what your code fragment is supposed to mean.
You just hafta look like its continuous. for example when youd use this : You have a coin game. you make them flip it and it lands on one side.
When flag clicked
if sprite coin clciked, broadcast coin
When i recive coin pick random number 1 out of 10.
if number is more than five turn to cotume "tails side"
if not (or if less then 5) broadcast coin heads.
When ir ecive coin heads change to costume heads side.
Their you go. ive made it clear, you should understand it now.
Offline
kevin_karplus wrote:
Heybrian, I have no idea what your code fragment is supposed to mean.
i think its something like this:
<when I receive[ Coin
<if><( <pick random( 1 )to( 10 <<> 5 )>
<switch to costume[ tails
<else>
<broadcast[ heads
Last edited by funkymonkey (2008-01-05 18:08:03)
Offline
funkymonkey wrote:
kevin_karplus wrote:
Heybrian, I have no idea what your code fragment is supposed to mean.
i think its something like this:
<when I receive[ Coin
<if><( <pick random( 1 )to( 10 <<> 5 )>
switch to costume "tails"
<else>
<broadcast[ Penny
yes but when i tryed that did not work. the else didnt work.
Last edited by Heybrian (2008-01-05 18:09:15)
Offline
Heybrian wrote:
yes but when i tryed that did not work. the else didnt work.
it did for me. i'll upload the project that i made with it for you
Last edited by funkymonkey (2008-01-05 18:12:32)
Offline
ok, here is proof that it works: http://scratch.mit.edu/projects/funkymonkey/76739 just keep clicking the coin
Last edited by funkymonkey (2008-01-05 18:16:08)
Offline
funkymonkey wrote:
ok, here is proof that it works: http://scratch.mit.edu/projects/funkymonkey/76739 just keep clicking the coin
not if you have like ten scripts and ur doing an rpg game. that is one script. imagine a 1 week long rpg game to make. it will not work .same with
<when I receive[shoot] >
<repeat until> costume # =4
<next costume>
Last edited by Heybrian (2008-01-05 18:19:53)
Offline
Heybrian wrote:
funkymonkey wrote:
ok, here is proof that it works: http://scratch.mit.edu/projects/funkymonkey/76739 just keep clicking the coin
not if you have like ten scripts and ur doing an rpg game. that is one script. imagine a 1 week long rpg game to make. it will not work .same with
<when I receive[ shoot
<repeat until> <( costume # <=> 4 )>
<next costume>
what is that script working for? once you know that, then you can decide if it will work.
Last edited by funkymonkey (2008-01-05 18:40:29)
Offline
Offline
I think that a receive sensing block would just be confusing, as it is very easy to implement with the basic commands that exist. Instead of sending a broadcast, you could just change a variable when you want the paused script to continue (or whatever it is that you want).
"Wait until I receive" could be done like this:
|-Forever
| If Variable = 0
| Wait 0.05
| Stop Script (this will just make the script keep waiting)
|
| Do the stuff you were waiting for.... (This will execute when the variable changes)
| Varible = 0 (To keep the script from running again)
It seems just as easy to switch the value of a variable as to send a broadcast (to me).
Mr Ed
Offline
funkymonkey wrote:
Heybrian wrote:
funkymonkey wrote:
ok, here is proof that it works: http://scratch.mit.edu/projects/funkymonkey/76739 just keep clicking the coin
not if you have like ten scripts and ur doing an rpg game. that is one script. imagine a 1 week long rpg game to make. it will not work .same with
<when I receive[ shoot
<repeat until> <( costume # <=> 4 )>
<next costume>what is that script working for? once you know that, then you can decide if it will work.
huh?
Offline
funkymonkey wrote:
YES!
Offline