This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-04-28 18:00:30

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

How to update all items in a list all at once with zero delay?

I know you can delete all at once with one block, but how would you change all by a number, say 4, at the same time like with the delete [all] block.

Offline

 

#2 2010-04-28 18:52:27

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How to update all items in a list all at once with zero delay?

Instead of using the "replace" block, use a "broadcast and wait" block. For every item in the list, make a "When I receive" script that will activate at the broadcast and replace its specified item. One of those scripts per item.
All the items get replaced at once - but there's all that scripting! At least it works.  smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2010-04-28 18:59:35

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: How to update all items in a list all at once with zero delay?

Jonathanpb wrote:

Instead of using the "replace" block, use a "broadcast and wait" block. For every item in the list, make a "When I receive" script that will activate at the broadcast and replace its specified item. One of those scripts per item.
All the items get replaced at once - but there's all that scripting! At least it works.  smile

Thank you!

Also, I can compress all that scripting into one block, since I'm using BYOB, which I didn't want to say because everyone would say to check the atomic check-box, when that actually has a delay. >.>

Another good thing is it's the 2.99 alpha, so I can duplicate scripts and put them in lists. :3

Offline

 

#4 2010-04-28 20:06:03

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: How to update all items in a list all at once with zero delay?

Jonathanpb wrote:

Instead of using the "replace" block, use a "broadcast and wait" block. For every item in the list, make a "When I receive" script that will activate at the broadcast and replace its specified item. One of those scripts per item.
All the items get replaced at once - but there's all that scripting! At least it works.  smile

Well... that has more of a delay.


nXIII

Offline

 

#5 2010-04-28 20:11:53

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: How to update all items in a list all at once with zero delay?

nXIII wrote:

Jonathanpb wrote:

Instead of using the "replace" block, use a "broadcast and wait" block. For every item in the list, make a "When I receive" script that will activate at the broadcast and replace its specified item. One of those scripts per item.
All the items get replaced at once - but there's all that scripting! At least it works.  smile

Well... that has more of a delay.

Really? Because my lists have varying values, and I just can't make that many scripts. Is there another way?

Offline

 

#6 2010-04-29 00:48:59

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How to update all items in a list all at once with zero delay?

nXIII wrote:

Jonathanpb wrote:

Instead of using the "replace" block, use a "broadcast and wait" block. For every item in the list, make a "When I receive" script that will activate at the broadcast and replace its specified item. One of those scripts per item.
All the items get replaced at once - but there's all that scripting! At least it works.  smile

Well... that has more of a delay.

But they all update at once - wasn't that the goal?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#7 2010-04-29 12:43:19

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: How to update all items in a list all at once with zero delay?

http://img413.imageshack.us/img413/438/changebynumberscript.gif
Does this help?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#8 2010-04-29 13:04:47

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: How to update all items in a list all at once with zero delay?

How long was the list?


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

Board footer