Discuss Scratch

rontinn
Scratcher
85 posts

Non-number values in slider variables

In slider variables you can only have numbers, and I think that you should be able to put letters or words in them. I suggest that when you go to change a sliders range there should be a button that says other values, and you can use that to select how many values you have and what they are. Example:
Value 1: red
Value 2: orange
Value 3: yellow
This could be used for yes or no, choosing a background in a game, mountain, canyon, ocean, field, numbers that aren't in order, 1, 3, 5, 7, 9.

Last edited by rontinn (Nov. 30, 2020 14:20:33)

NanoPIex
Scratcher
500+ posts

Non-number values in slider variables

When would you need this? The point of sliders is so that scratchers can change the numerical value of a variable. I don`t know what it would do with words and also this seems too complex for newer scratchers.
pavcato
Scratcher
1000+ posts

Non-number values in slider variables

NanoPIex wrote:

When would you need this? The point of sliders is so that scratchers can change the numerical value of a variable. I don`t know what it would do with words and also this seems too complex for newer scratchers.
It would be pretty simple, you would just do
set value [1] of [variable v] to [word]::variables
but I guess this could easily be worked around with lists.
rontinn
Scratcher
85 posts

Non-number values in slider variables

NanoPIex wrote:

When would you need this?
You could use it for changing colors or other customization things

pavcato wrote:

I guess this could easily be worked around with lists.
How?
gosoccerboy5
Scratcher
1000+ posts

Non-number values in slider variables

Support. I've felt like I would like to set a slider to yes/no before but it doesn't let you do that. I'd like that to happen.
pavcato
Scratcher
1000+ posts

Non-number values in slider variables

rontinn wrote:

pavcato wrote:

I guess this could easily be worked around with lists.
How?
You could make a slider that corresponds with a list like putting a word on a list item, then showing the list thing when you reach a desired number on the slider:
if <(slider) = [1]> then
set [variable v] to (item (1 v) of [list v] :: list)
end
gosoccerboy5
Scratcher
1000+ posts

Non-number values in slider variables

pavcato wrote:

rontinn wrote:

pavcato wrote:

I guess this could easily be worked around with lists.
How?
You could make a slider that corresponds with a list like putting a word on a list item, then showing the list thing when you reach a desired number on the slider:
if <(slider) = [1]> then
set [variable v] to (item (1 v) of [list v] :: list)
end
So is the slider variable hidden or not? If it is hidden, I don't see how you can change the slider. If it isn't hidden then you have two variables in the place of one. Not pretty. Plus that means you need to make an extra variable (I have variable OCD )
rontinn
Scratcher
85 posts

Non-number values in slider variables

pavcato wrote:

rontinn wrote:

pavcato wrote:

I guess this could easily be worked around with lists.
How?
You could make a slider that corresponds with a list like putting a word on a list item, then showing the list thing when you reach a desired number on the slider:
if <(slider) = [1]> then
set [variable v] to (item (1 v) of [list v] :: list)
end
I tried this already, it doesn't work
rontinn
Scratcher
85 posts

Non-number values in slider variables

bump
rontinn
Scratcher
85 posts

Non-number values in slider variables

bump
fdreerf
Scratcher
1000+ posts

Non-number values in slider variables

pavcato wrote:

rontinn wrote:

pavcato wrote:

I guess this could easily be worked around with lists.
How?
You could make a slider that corresponds with a list like putting a word on a list item, then showing the list thing when you reach a desired number on the slider:
if <(slider) = [1]> then
set [variable v] to (item (1 v) of [list v] :: list)
end
There's a more efficient workaround that requires no if statements at all: https://turbowarp.org/457308316, however, it requires an extra variable and a list. Personally, I never found that one extra variable was a big deal, and obviously, you'll have a list of items to select through anyway, though I can see how in certain situations one extra variable can be monumental. I think that it would be much easier to just use a list for the selected items as it can be changed with code and in much simpler ways. You could right-click a variable and make it a slider like normal, but there'd be an extra option besides setting min and max to “link” a list to the slider.
rontinn
Scratcher
85 posts

Non-number values in slider variables

fdreerf wrote:

pavcato wrote:

rontinn wrote:

pavcato wrote:

I guess this could easily be worked around with lists.
How?
You could make a slider that corresponds with a list like putting a word on a list item, then showing the list thing when you reach a desired number on the slider:
if <(slider) = [1]> then
set [variable v] to (item (1 v) of [list v] :: list)
end
There's a more efficient workaround that requires no if statements at all: https://turbowarp.org/457308316, however, it requires an extra variable and a list. Personally, I never found that one extra variable was a big deal, and obviously, you'll have a list of items to select through anyway, though I can see how in certain situations one extra variable can be monumental. I think that it would be much easier to just use a list for the selected items as it can be changed with code and in much simpler ways. You could right-click a variable and make it a slider like normal, but there'd be an extra option besides setting min and max to “link” a list to the slider.
If you did this and you wanted it to look like the slider you'd have to put it over the slider

Powered by DjangoBB