Discuss Scratch
- Unithlees3
-
1000+ posts
Random costume block
I really want a
BTW there is no workarounds for this block
An actual workaround
random costume :: looksblock
BTW there is no workarounds for this block
An actual workaround
Last edited by Unithlees3 (May 2, 2021 17:08:56)
- wvj
-
1000+ posts
Random costume block
workaround
when green flag clicked
switch costume to (pick random (1) to (number of costumes in sprite))
- Unithlees3
-
1000+ posts
Random costume block
Good, but the original block detects the number of costumes. workaroundwhen green flag clicked
switch costume to (pick random (1) to (number of costumes in sprite))
If we had the “maximum costume number” reporter, then it will be possible
switch costume to (pick random (1) to (maximum costume number :: looks))
Last edited by Unithlees3 (May 2, 2021 12:01:24)
- Prime689
-
1000+ posts
Random costume block
Why just do those workarounds?
Also, I don't think that this would be used widely.
No support.
Also, I don't think that this would be used widely.
No support.
- han614698
-
1000+ posts
Random costume block
I would like to note that there is a workaround to test how many costume they are.Good, but the original block detects the number of costumes. workaroundwhen green flag clicked
switch costume to (pick random (1) to (number of costumes in sprite))
If we had the “maximum costume number” reporter, then it will be possibleswitch costume to (pick random (1) to (maximum costume number :: looks))
Here it is (it is complicated, though):
. . .You can't add costumes in projects whilst they're running, so you can manually just use the workaround stated by wvj above because the costume number will always be the same throughout the project. You can probably live with just adding one to the end number everytime.
hide
RWSR::custom stack
show
. . .
define RWSR
set [a v] to [0]
delete all of [list v]::list stack
switch costume to ((costume [number v]::looks reporter) - (costume [number v]::looks reporter))//switches to first costume
repeat until <(costume [number v]::looks reporter) = ((item (length of [list v] :: list) of [list v] :: list) - (1))>
next costume
change [a v] by (1)
add (costume [number v]::looks reporter) to [list v]
end
switch costume to (pick random (1) to (costume [number v]::looks reporter)
Edit - 2024 I removed second workaround because it was stupid.
Last edited by han614698 (March 13, 2024 13:04:31)
- Unithlees3
-
1000+ posts
Random costume block
OkI would like to note that there is a workaround to test how many costume they are.Good, but the original block detects the number of costumes. workaroundwhen green flag clicked
switch costume to (pick random (1) to (number of costumes in sprite))
If we had the “maximum costume number” reporter, then it will be possibleswitch costume to (pick random (1) to (maximum costume number :: looks))
Here it is (it is complicated, though):. . .You can't add costumes in projects whilst they're running, so you can manually just use the workaround stated by wvj above because the costume number will always be the same throughout the project. You can probably live with just adding one to the end number everytime.
hide
RWSR::custom stack
show
. . .
define RWSR
set [a v] to [0]
delete all of [list v]::list stack
switch costume to ((costume [number v]::looks reporter) - (costume [number v]::looks reporter))//switches to first costume
repeat until <(costume [number v]::looks reporter) = ((item (length of [list v] :: list) of [list v] :: list) - (1))>
next costume
change [a v] by (1)
add (costume [number v]::looks reporter) to [list v]
end
switch costume to (pick random (1) to (costume [number v]::looks reporter)
Alternately, you can set the random script to be:switch costume to (pick random (1) to ((foo)))No Support because the workarounds (except the top one, which was hypothetical) aren't that hard.
when [space v] key pressed
if <[Unithlees3] = (username)> then
change [foo v] by (1)//you can run the project and press space every time you add a costume.
end
- han614698
-
1000+ posts
Random costume block
removed
Last edited by han614698 (March 13, 2024 13:04:51)
- Zoomer_X
-
500+ posts
Random costume block
I believe that
when green flag clickedworks
switch costume to (join [r] [andom costume])
- Unithlees3
-
1000+ posts
Random costume block
let me try that I believe thatwhen green flag clickedworks
switch costume to (join [r] [andom costume])
- dertermenter
-
1000+ posts
Random costume block
The workaround is really simple. The workaround is better as if random limit needs changing, you can use a variable to do that, making the workaround more flexible
- Unithlees3
-
1000+ posts
Random costume block
I prefer using the block, not the workaround The workaround is really simple. The workaround is better as if random limit needs changing, you can use a variable to do that, making the workaround more flexible
- han614698
-
1000+ posts
Random costume block
yeah bruh
Last edited by han614698 (March 13, 2024 13:05:23)
- Unithlees3
-
1000+ posts
Random costume block
bruhVs No support, the workaround is too simple.I prefer using the block, not the workaround
Okay!run platformer::custom-arg//scratch loses all educational value and goes bankrupt and you can never use it again
- dertermenter
-
1000+ posts
Random costume block
But the workaround is better, explained in post above ^^I prefer using the block, not the workaround The workaround is really simple. The workaround is better as if random limit needs changing, you can use a variable to do that, making the workaround more flexible
- Unithlees3
-
1000+ posts
Random costume block
OK then, now I prefer using workaroundsBut the workaround is better, explained in post above ^^I prefer using the block, not the workaround The workaround is really simple. The workaround is better as if random limit needs changing, you can use a variable to do that, making the workaround more flexible
Last edited by Unithlees3 (May 2, 2021 17:10:41)