Discuss Scratch

Cream_E_Cookie
Scratcher
1000+ posts

costume name

Support
koopa_land
Scratcher
100+ posts

costume name

when GF clicked
delete (all v) of [costume name v]
switch costume to [the first costume v]
repeat (length of costume like 2 if there are 2 costumes ::looks)
add ([costume name v] of [this sprite v]) to [costume names v]
next costume
end

Then Use

(item (costume #) of [costume names v])

or try
when I start as a clone
set [costume name v] to (item (costume #) of [costume names v])

For the clone so I'm unsupport it

Last edited by koopa_land (Aug. 14, 2015 09:43:51)

koopa_land
Scratcher
100+ posts

costume name

stickfiregames wrote:

koopa_land wrote:

Did you mean
(costume name :: looks)

Workaround

([Costume name v] of [wanted sprite (really)  v])
Read the above posts, that workaround doesn't work for clones which is why this was suggested.
Whoops I forgot but I'm going to Unsupport it Because There is a Workaround
Cream_E_Cookie
Scratcher
1000+ posts

costume name

Meese123 wrote:

Technically workaroundable:
set [costume name v] to (item (costume #) of [costume names v]
What if you have a billion costumes.
Support, it doesn't work for clones
Krodon
Scratcher
16 posts

costume name

Support, I need could use it easily for a text engine.

I did use the workaround, but it was a bit confusing and took a few attempts to try and get all the letters, numbers, and spacing working correctly, though I believe Scratch was meant to be simple, and it is logical for a reporter block to be able to check it's own costume name, even if it is a clone.

Last edited by Krodon (Feb. 6, 2016 21:24:22)

rchang0909
Scratcher
26 posts

costume name

support
johnkershaw
Teacher
2 posts

costume name

I'm building a project for my students to help them understand logic gates. I have a gate that can be any of the gates when clicked. Its costumes are named AND, OR, NAND, XOR etc. Why can I not access those costume names directly? Yes, I can create a list and mirror all the names into there, but it's hardly elegant, and adds a tonne of cognitive load my students don't need.

Sprites should be able to access their own attributes directly.
TheLogFather
Scratcher
1000+ posts

costume name

johnkershaw wrote:

I'm building a project for my students to help them understand logic gates. I have a gate that can be any of the gates when clicked. Its costumes are named AND, OR, NAND, XOR etc. Why can I not access those costume names directly? Yes, I can create a list and mirror all the names into there, but it's hardly elegant, and adds a tonne of cognitive load my students don't need.

Sprites should be able to access their own attributes directly.
If Scratch was meant to be a ‘serious’ language for creating ‘grown up’ games/projects then I would agree.

However, I think there is a potential argument that the “cognitive load” might be considered part of the point… i.e. you have to actually think about how to develop a solution to such a problem using the toolset you have.

Personally, I suspect that could be a more generically useful thing to learn than much of the CS teaching that goes on these days, which tries to prepare students for the way modern computer languages work, and they way you're ‘meant’ to use them, ‘best practice’, etc… (Here I'm exposing one of my pet peeves… I guess I might be disagreeing with your statement above, and suggesting that it might be precisely the kind of cognitive load they need, and prepares for a future which could be somewhat different, computationally speaking, from the environment we have today…? Having said that, though, I do recognise that it's going to depend to some degree on what you're trying to do at the time…)


There's a similar question over the lack of a “previous costume” block (though the solution is obviously far simpler in that case, which, again, could be part of the point).


I can't pretend that above was ever really the reason the Scratch Team never included the “costume name” block (even though it does exist internally in Scratch, and works fine, but is just missing an entry in the block palette), but I think it's worth thinking about…


Note that if you're not using clones then you *do* have the blue "([costume name v] of [sprite v])" sensor block available to use for what you want. It's only if you're using clones that you're missing the capability to access the costume name in a clean/obvious way.

Last edited by TheLogFather (April 3, 2017 19:21:57)

Green_yoshi
Scratcher
56 posts

costume name

define (costume #)
set [Costume] to (join [Numer of] (costume #))
say (join (costume #) (join [Means the number of] (☁ The costume number))) for (2) secs
Pezd
Scratcher
100+ posts

costume name

I support this definitely
2011Nintendo3DS
Scratcher
48 posts

costume name

how i can name the costume to the similar costume name
find similar costume name to costume [ v] from sprite [ v]  :: looks
JJtheJJpro
Scratcher
5 posts

costume name

I found a way, and this should 100% work.

1. Go on a different sprite you don't want to use this on.
2. Sensing ->
([costume name v] of [SpriteName v])
and drag that block onto the sprite you don't want to use it on.
3. Set the sprite name to the sprite you want it on.
4. Duplicate that block and put it in the sprite you want.
5. Go to that sprite and you see it there.

Please respond if you got confused.
Botcho_Otkho
Scratcher
1000+ posts

costume name

Green_yoshi wrote:

define (costume #)
set [Costume] to (join [Numer of] (costume #))
say (join (costume #) (join [Means the number of] (☁ The costume number))) for (2) secs
Can you at least try the script before stating it as a workaround?

2011Nintendo3DS wrote:

how i can name the costume to the similar costume name
find similar costume name to costume [ v] from sprite [ v]  :: looks
Don't thread hijack.

JJtheJJpro wrote:

I found a way, and this should 100% work.

1. Go on a different sprite you don't want to use this on.
2. Sensing ->
([costume name v] of [SpriteName v])
and drag that block onto the sprite you don't want to use it on.
3. Set the sprite name to the sprite you want it on.
4. Duplicate that block and put it in the sprite you want.
5. Go to that sprite and you see it there.

Please respond if you got confused.
You may mean “this should 50% work”, since it doesn't work for clones.
___
Support, the workaround only works for normal sprites and not for clones.

Last edited by Botcho_Otkho (April 25, 2018 14:23:50)

zafzaf
Scratcher
1000+ posts

costume name

a
kew11083
Scratcher
1 post

costume name

How to do it?
qwerty_wasd_gone
Scratcher
1000+ posts

costume name

kew11083 wrote:

How to do it?
(costume [name v]::looks)
Also, how did you manage to even find this

Last edited by qwerty_wasd_gone (Feb. 11, 2023 03:57:30)

medians
Scratcher
1000+ posts

costume name

kew11083 wrote:

How to do it?
Please do not necropost. This was implemented in Scratch 3.0. In 2.0, you have to drag the block selecting the same sprite from another sprite/the stage, and it will work.
Or if the sprite was the only sprite/the last created one, you can drag it out from sensing.

Last edited by medians (Feb. 11, 2023 03:07:01)

GUYWHOLOVESCODE
Scratcher
500+ posts

costume name

This block exists already in Sensing.
([backdrop # v] of [stage v])
The second dropdown allows selection of other sprites, giving you options including size, costume, etc. from the first one once you pick a sprite.

TimothyLawyer wrote:

Or maybe add ‘myself’ as an option in the sensing block?
([costume name v] of [myself v])
This block exists in Looks.
(costume[number v]::looks)
That dropdown? Yeah, the other option is “name”
I'm a nincompoop, I didn't look at initial dates. I apologize for joining this and we really need to get this topic closed.

Last edited by GUYWHOLOVESCODE (Feb. 11, 2023 03:29:18)

medians
Scratcher
1000+ posts

costume name

GUYWHOLOVESCODE wrote:

That dropdown? Yeah, the other option is “name”
That didn't exist at the time. In fact this suggestion should be closed because it was implemented nearly 6 years later. At the time there was also no backdrop block (you had to use the sensing reporter to get the backdrop # or drag the backdrop # block to a sprite since it could only be accessed from the stage).

Last edited by medians (Feb. 11, 2023 03:32:52)

Powered by DjangoBB