Discuss Scratch

jay11vad
Scratcher
30 posts

Need new block.

I really NEED this block:
(costume name)

Is there another way?

Last edited by jay11vad (Dec. 22, 2020 20:31:28)

jay11vad
Scratcher
30 posts

Need new block.

I need
(costume name)
.
I would use it like this:
when green flag clicked
if <(costume name ) = []> then
hide

end
Is there an alternative way because I can' find any other way.?
Monna-Uka
Scratcher
1000+ posts

Need new block.

jay11vad wrote:

I need
(costume name)
.
I would use it like this:
when green flag clicked
if <(costume name ) = []> then
hide

end
Is there an alternative way because I can' find any other way.?
You can do with costume numbers. Also that block exists at the end of the ‘Looks’ section.
Monna-Uka
Scratcher
1000+ posts

Need new block.

jay11vad wrote:

What do I do instead of this: because this is not a real block???
'
when costume switches to [ v]


???

or:
'
If costume switches to [ v]

jay11vad wrote:

What do I do instead of this: because this is not a real block???
'
when costume switches to [ v]


???

or:
'
If costume switches to [ v]
if <(costume [name v] ::looks) = [random costume lol]> then

end
Monna-Uka
Scratcher
1000+ posts

Need new block.

jay11vad wrote:

Also this:
If [ left-up v] pressed together then 
You mean
if <<key [ v] pressed?> and <key [ v] pressed?>> then

end
or
Makey Makey icon|when (left up v) pressed in order ::pen hat
best-games-ever
Scratcher
500+ posts

Need new block.

Put all of your block suggestions in the “Suggestions” forum please. This topic doesn't belong here.
codinglah
Scratcher
100+ posts

Need new block.

bjmoore2007 wrote:

codinglah wrote:

bjmoore2007 wrote:

can i sugest an block ? it takes 2 or more lists and one var and it compares how many letters each word has from all items in an list if the var is an sentence it breaks it down into words this would be really helpfull in making an chatroom that bans on bad language or then requires u to us savechat it could be an basic AI block that could be implemented into scratch if developers feel like it
Actually, cloud chatrooms are not allowed on Scratch. But yes, I think that would be useful. A workaround would be:
when green flag clicked
set [counter v] to (1)
repeat (length of (sentence))
if <(item (counter) of (sentence)) = [ ]> then
set [length v] to (length of (word))
add (length) to [lengths v]
add (word) to [words v]
change [counter v] by (1)
if <(words) contains (bad words :: list)?> then
say [Oops! A bad word is detected. Please re-phrase your sentence.]
stop [this script v]
end
else
set [word v] to (join (word) (item (counter) of (sentence)))
change [counter v] by (1)
end
end
thx i will try this sometime in an chatbot maibe ? actually you could use this to detect the category an word is in like greetings info jokes fun and so on
No problem! Just a reminder, chatroom projects are NOT allowed on Scratch.
coderpilot72
Scratcher
28 posts

Need new block.

LionOte wrote:

You want a
previous costume :: looks
block? Yeah, something like that would be better in the Suggestions category. Try posting there.

Here's a simple workaround:
switch costume to ((costume #) - (1))



Well you can do that but if you are at costume 4 and you want to get to costume 2 you can do this:


when green flag clicked
switch costume to ((costume #) / (2))


or some thing like that!
GamerMarcus646
Scratcher
100+ posts

Need new block.

jay11vad wrote:

This:
switch costume to [((costume name) - (1)) v]

…Only works once. I did try that but I've got 29 costumes for my sprite. It was on ‘flying cat 1’ and it did work - when I pressed space it went to ‘black cat’ - which was good, but then when I pressed space again, it did not switch to the costume ‘white cat’. Is there another solution?

Name all of your sprites numbers. For example: name costume 1 “1” and costume 2 “2”. Use the code below to switch to the previous costume.
switch costume to ((costume #) - (1))
Next costume:
switch costume to ((costume #) + (1))
Monna-Uka
Scratcher
1000+ posts

Need new block.

GamerMarcus646 wrote:

Name all of your sprites numbers. For example: name costume 1 “1” and costume 2 “2”. Use the code below to switch to the previous costume.
switch costume to ((costume #) - (1))
Next costume:
switch costume to ((costume #) + (1))
Not necessary.
GamerMarcus646
Scratcher
100+ posts

Need new block.

Monna-Uka wrote:

GamerMarcus646 wrote:

Name all of your sprites numbers. For example: name costume 1 “1” and costume 2 “2”. Use the code below to switch to the previous costume.
switch costume to ((costume #) - (1))
Next costume:
switch costume to ((costume #) + (1))
Not necessary.
It’s just what I do when I run into the problem OP has, but thanks for letting me know that I’ve been doing things wrong! Writing clean, optimized code is kind of hard.
jay11vad
Scratcher
30 posts

Need new block.

I need a text box that moves and that is transparent.
jay11vad
Scratcher
30 posts

Need new block.

…not one that is stuck in one place

Monna-Uka
Scratcher
1000+ posts

Need new block.

jay11vad wrote:

…not one that is stuck in one place

I don't think that's possible here.
jay11vad
Scratcher
30 posts

Need new block.

Ok then, never mind. But how do I hide this;?

(current [ v])
SparshG
Scratcher
500+ posts

Need new block.

jay11vad wrote:

What do I do instead of this: because this is not a real block???
when costume switches to [ v]

If costume switches to [ v]

forever
if <(costume [name v] :: looks) = [cat]> then
...
end
end

for picking random BETWEEN two numbers

(pick random ((1) + (1)) to ((10) - (1)))//random between 1 and 10
(pick random ((var1) + (1)) to ((var2) - (1)))//random between var1 and var2

for switching to previous costume

switch costume to ((costume [name v] :: looks) - (1))

If you want more blocks, you can look into hacked blocks: https://scratch.mit.edu/projects/453337690/

Last edited by SparshG (Dec. 26, 2020 05:19:09)

Monna-Uka
Scratcher
1000+ posts

Need new block.

StampDanFan wrote:

Sorry, but currently, Scratch can't bring you to another scratch project using code,
or apply code to multiple sprites. You could request these in the “Requests forum”.

For the pick random of two numbers block, you could use a workaround, like making a list of the two numbers, and picking a random one:
(item (pick random (1) to (2)) of [list v] :: list) 

Hope this helped.
((number 1) + ((pick random (0) to (1)) * ((number 2) - (number 1))))
^ better workaround, without lists.
jay11vad
Scratcher
30 posts

Need new block.

I found this block in a project:
create (15) clones of [ sprite3v]

Is this a hack block?

Last edited by jay11vad (Dec. 31, 2020 16:17:12)

Ihatr
Scratcher
1000+ posts

Need new block.

jay11vad wrote:

I found this block in a project:
create [15] clones of [ sprite3 v] :: control

Is this a hack block?
Where is the project?
the2000
Scratcher
1000+ posts

Need new block.

Ihatr wrote:

jay11vad wrote:

I found this block in a project:
create [15] clones of [ sprite3 v] :: control

Is this a hack block?
Where is the project?
I was gonna call for this thread to be closed, but this has me intrigued. Link please? (It's unlikely, but what if this is another one of those hidden blocks? I love using those to optimize my code far beyond a necessary amount)

Powered by DjangoBB