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

#1 2008-07-18 21:59:17

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Script numbering

I think it would be a good idea to put in script numbering. that way you could have a block like
[blocks]
<stop script>#:
or for external sprites(a script to stop a script of another sprite)
<stop script>#: Sprite:
[/block]
Just two ideas for the use of script numbering, but there are probably thousands.

Offline

 

#2 2008-07-20 16:56:09

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Script numbering

Is anybody going to look?  sad

Offline

 

#3 2008-07-20 17:08:10

the_guardian
Scratcher
Registered: 2008-03-16
Posts: 98

Re: Script numbering

you can accomplish the same thing with existing blocks.  I have never used the blocks in a forum, so forgive me if it looks bad...

<repeat until><(  <=>  )>0

do stuff here...

<end>

then when you want the script to stop, you set the variable to zero from anywhere in your program.


Guardian 3D!  http://scratch.mit.edu/projects/the_guardian/169865

Offline

 

#4 2008-07-20 17:10:51

the_guardian
Scratcher
Registered: 2008-03-16
Posts: 98

Re: Script numbering

<repeat until><(variable <=> 0 )>


Guardian 3D!  http://scratch.mit.edu/projects/the_guardian/169865

Offline

 

#5 2008-07-20 18:50:12

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Script numbering

yeah but it wold be much easier to do what i said. plus thats just one use of script numbering.

Offline

 

#6 2008-07-20 18:53:09

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Script numbering

I'm trying to understand if you are using those blocks, why not just put them in the script they are supposed to stop?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#7 2008-07-20 19:51:00

the_guardian
Scratcher
Registered: 2008-03-16
Posts: 98

Re: Script numbering

was that question for me Bluestribute?  That is myu suggestion to put the blocks i listed in the script you want to stop.


Guardian 3D!  http://scratch.mit.edu/projects/the_guardian/169865

Offline

 

#8 2008-07-20 19:52:08

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Script numbering

the_guardian wrote:

was that question for me Bluestribute?  That is myu suggestion to put the blocks i listed in the script you want to stop.

Just this general topic of stopping a script, but why not just put the stop script in the actual script?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#9 2008-07-21 08:55:07

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: Script numbering

I like this suggestion Alan Projects.
Guardian is right his method would work but their are some examples where it wouldn't. eg inside a repeat (10) you would need an extra if variable=0.  It would also continue to the end of the list of things to repeat and not stop as soon as the variable=0.
I would also like a stop sprite command.


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#10 2008-07-21 20:02:45

the_guardian
Scratcher
Registered: 2008-03-16
Posts: 98

Re: Script numbering

good point bigB,  if you had a large loop you would have to wait for the loop to end before it checked the variable to stop.  I actually use the methos i descibed so my controller scripts know when my game is over.


Guardian 3D!  http://scratch.mit.edu/projects/the_guardian/169865

Offline

 

#11 2008-07-21 20:28:55

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Script numbering

bigB wrote:

I like this suggestion Alan Projects.
Guardian is right his method would work but their are some examples where it wouldn't. eg inside a repeat (10) you would need an extra if variable=0.  It would also continue to the end of the list of things to repeat and not stop as soon as the variable=0.
I would also like a stop sprite command.

Exactly variables start getting annoying because what if you want to start a script again? you could do that with script numbering and extra blocks! two huge lines and an unnecessary variable avoided.

Offline

 

Board footer