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

#601 2010-06-10 19:10:25

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

LS97 wrote:

oh, and unless you will be including the 'when %b is true' in panther,
can i have some help on how to make it?

Code:

when: t1
    t1 ifTrue: [^ true].
    ^ false

OK i'm not the best squeaker but something like that should work!

EDIT: this is more for ('%b is true') boolean. It works, I've used it. made it myself and it still works!

NOTE: has no real purpose.

Last edited by Joeman592 (2010-06-12 00:25:32)


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#602 2010-06-10 22:23:52

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

Re: Cool custom blocks in Scratch

LS97 wrote:

@nXIII:
thanks!

although, i have one more question. how do you make the nested blocks repeat until a boolean comes true?

That's an already-defined special-form, I believe #doWhile, maybe?


nXIII

Offline

 

#603 2010-06-11 03:48:56

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

nXIII wrote:

LS97 wrote:

@nXIII:
thanks!

although, i have one more question. how do you make the nested blocks repeat until a boolean comes true?

That's an already-defined special-form, I believe #doWhile, maybe?

hmm... i suppose so.
i'll play around with those forms.

Offline

 

#604 2010-06-11 04:04:39

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Bingo 1.1.0 is out!
now includes:
[blocks]
>> 2 new operator blocks
>> a new ''%b confirmed in dialog?'
>> Polished the skin a bit, folder pictures are now Vista-style
>> big change, Added compatibilty function; with it the categories disappear and Bingo becomes exactly like scratch
>> An 'Open' shortcut button next to the save and the language.
>> A 'last opened project' in the file menu that saves the path to the settings file
[/blocks]
Hope you all enjoy bingo, downloadable at
This Page

Last edited by LS97 (2010-06-11 04:05:39)

Offline

 

#605 2010-06-11 10:22:23

Zorbak42
Scratcher
Registered: 2009-01-27
Posts: 100+

Re: Cool custom blocks in Scratch

Thanks for the mod EXE tutorial, do you know how to make it ask for a file type other than .sb? My mod's files are saved as .zp, and it only lets you choose a .sb file to convert to EXE.

Offline

 

#606 2010-06-11 12:35:44

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Zorbak42 wrote:

Thanks for the mod EXE tutorial, do you know how to make it ask for a file type other than .sb? My mod's files are saved as .zp, and it only lets you choose a .sb file to convert to EXE.

I can't hack into the EXE file, sorry.
but i can give you a solution:
simply type the project name in and it will use that name regardless of what default extension was defined.

Offline

 

#607 2010-06-11 12:40:53

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 can I ask you a question.

in squeak you have the code 'self' and then some code,
so in Panther you can have 'self setVar: () to: ()', do you know how I could do 2 of these in 1 block?


You can now reach me on Twitter @johnnydean1_

Offline

 

#608 2010-06-11 13:03:30

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

LS97 can I ask you a question.

in squeak you have the code 'self' and then some code,
so in Panther you can have 'self setVar: () to: ()', do you know how I could do 2 of these in 1 block?

two of thse what?
if you mean two 'self', no problem - simply add a dot (period, full stop, whatever) at the end of the line.

but i don't think that's what you mean. correct me if i'm wrong  smile

Offline

 

#609 2010-06-11 13:52:38

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Yes your right, thank you so much. Ive been wondering how for ages!


You can now reach me on Twitter @johnnydean1_

Offline

 

#610 2010-06-11 15:53:13

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

Yes your right, thank you so much. Ive been wondering how for ages!

well, glad you learned it. it's a key thing in Squeak pogramming  smile

Offline

 

#611 2010-06-11 16:09:17

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Well, I forgot how, lol. See I learnt it, went on holiday, got back and forgot it. Ive been trying to work it out ever since  big_smile


You can now reach me on Twitter @johnnydean1_

Offline

 

#612 2010-06-11 16:32:30

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

Well, I forgot how, lol. See I learnt it, went on holiday, got back and forgot it. Ive been trying to work it out ever since  big_smile

oh. lol. could've asked straight away!  smile

Offline

 

#613 2010-06-11 16:34:22

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

True, but I like trying to do things myself  wink


You can now reach me on Twitter @johnnydean1_

Offline

 

#614 2010-06-11 16:36:56

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Ohh and 1 more thing:

You declare variables like this:

|t1 t2|
and sooo on

But how do you set t2 to 2 or something?


You can now reach me on Twitter @johnnydean1_

Offline

 

#615 2010-06-11 16:45:02

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

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

Ohh and 1 more thing:

You declare variables like this:

|t1 t2|
and sooo on

But how do you set t2 to 2 or something?

t2 = 2? Thats how its normaly done in other programming languages.


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

 

#616 2010-06-11 16:57:03

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Dnt worry me and MP56 worked it out!


You can now reach me on Twitter @johnnydean1_

Offline

 

#617 2010-06-11 17:15:57

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

Dnt worry me and MP56 worked it out!

no you didn't.
here's how:

"declare them first"
| t1 t2 |

"then set them"
t1 _ 'something'.
t2 _ 'something else'.

the _ should appear as an arrow.
as for what key it is, it's a normal underscore.

EDIT:
to report what the variable is, use ^ (appears as arrow).
to use the variable in if statements, use the equal sign ( = ) like this:
t1 = false ifTrue: [do this]
             ifFalse: [do that].

Last edited by LS97 (2010-06-11 17:18:17)

Offline

 

#618 2010-06-12 03:58:34

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

How to repeat code a number of times like the repeat block.


You can now reach me on Twitter @johnnydean1_

Offline

 

#619 2010-06-12 04:56:51

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

How to repeat code a number of times like the repeat block.

XX timesRepeat: [YY].

replace XX by the times you want to repeat, YY by the command that's repeated. you can add more than one command in the YY bit, like this:

10 timesRepeat: [World doOneCycleNow. viewerMorph updateCategorySelectors.]

separate the two commands by a dot and you're done!

Offline

 

#620 2010-06-12 04:59:28

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Thank you sooo much. This will allow me to meake a block to get the friends of a user (using CYOB on Panther)!


You can now reach me on Twitter @johnnydean1_

Offline

 

#621 2010-06-12 13:24:36

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

Re: Cool custom blocks in Scratch

LS97 wrote:

johnnydean1 wrote:

Dnt worry me and MP56 worked it out!

no you didn't.
here's how:

"declare them first"
| t1 t2 |

"then set them"
t1 _ 'something'.
t2 _ 'something else'.

the _ should appear as an arrow.
as for what key it is, it's a normal underscore.

EDIT:
to report what the variable is, use ^ (appears as arrow).
to use the variable in if statements, use the equal sign ( = ) like this:
t1 = false ifTrue: [do this]
             ifFalse: [do that].

@EDIT:
Just pointing this out: (I've seen some very inefficient code like this)
this:

Code:

t1 ifTrue: [^ true].
^ false

is the EXACT SAME THING as this:

Code:

^ t1

and it won't throw an error if t1 isn't a boolean.


nXIII

Offline

 

#622 2010-06-12 13:57:10

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

nXIII wrote:

Just pointing this out: (I've seen some very inefficient code like this)
this:

Code:

t1 ifTrue: [^ true].
^ false

is the EXACT SAME THING as this:

Code:

^ t1

and it won't throw an error if t1 isn't a boolean.

i know, i know,
but it was to show the use of the = sign as an example.

Last edited by LS97 (2010-06-12 13:57:32)

Offline

 

#623 2010-06-12 13:59:58

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

nXIII he was showing me how to do some squeak I forgot lol.


You can now reach me on Twitter @johnnydean1_

Offline

 

#624 2010-06-12 18:22:14

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Cool custom blocks in Scratch

markyparky56 wrote:

Go ask Jens if there is a way of editing the imagefile, but he said that he removed the Editor from BYOB, I guess so people couldn't steal the BYOB interface

No, no, we just want people to steal one we're proud of -- right now the code is not in distributable condition.  By the time of the Scratch conference in August we'll have an official release and it will have a dev menu with access to a browser.

Meanwhile, if all you want to do is add a simple block you can probably do it using Elements, which is Jens's Scratch-like drag-and-drop interface to the Smalltalk code.

Personally I'd be very happy if every Scratch modder includes BYOB in their mods!  I want to take over the world!  I want BYOB in Scratch 2.0!

Right now people are finding bazillions of bugs, and the program is incredibly slow, and you really don't want it in this condition, trust me.  We're truly grateful to all the alpha testers who've been putting up with the annoyances of 2.99 and reporting bugs.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#625 2010-06-12 18:25:12

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Cool custom blocks in Scratch

bharvey wrote:

markyparky56 wrote:

Go ask Jens if there is a way of editing the imagefile, but he said that he removed the Editor from BYOB, I guess so people couldn't steal the BYOB interface

No, no, we just want people to steal one we're proud of -- right now the code is not in distributable condition.  By the time of the Scratch conference in August we'll have an official release and it will have a dev menu with access to a browser.

Meanwhile, if all you want to do is add a simple block you can probably do it using Elements, which is Jens's Scratch-like drag-and-drop interface to the Smalltalk code.

Personally I'd be very happy if every Scratch modder includes BYOB in their mods!  I want to take over the world!  I want BYOB in Scratch 2.0!

Right now people are finding bazillions of bugs, and the program is incredibly slow, and you really don't want it in this condition, trust me.  We're truly grateful to all the alpha testers who've been putting up with the annoyances of 2.99 and reporting bugs.

To hack BYOB: make a turn fillscreen off block in the elements editor.

Offline

 

Board footer