Variables to set image

A feature I’d like to see in Hopscotch is:

The ability to put a variable inside of a set image block

I’d use it for this type of project:

Anything where you need to have a whole bunch of characters. For an example look at this project, which uses a bunch of check if else blocks to get the characters for the grid.

Here are some examples of Hopscotch code that could be improved if we had this:

The set image code in the project above.

Here is an example design I’ve made:


Except bariable is an actual variable. I’ll replace it later with a better one

22 Likes

I agree with this. It’d be so useful for character selection and would otherwise only be a use of my shortcut with presets (which if that was the case, would still need updates).


@Petrichor why don’t you just use a Hopscotch bug or JSON editing to model your concept?
IMG_4446

12 Likes

This would be very cool, indeed!

7 Likes

Yes!! I’ve been trying to do this for forever but it never worked : (

6 Likes

I’d still like to have this feature

4 Likes

Yes very braiable

This is a nice idea

2 Likes

Bump

1 Like

You should also be able to use the names of objects, but I think ids should also definitely be an option since strings are very easy to mistype.

4 Likes

This would be cool, have mods seen this?

1 Like

It seems Supreme Leader Petty comes up with many brilliant ideas. I wish this existed.

2 Likes

How do you know which image is correlated to what variable?
Also I’m totally going to play that bingo game lol

Maybe give an image a number, and when the variable becomes that number, it turns into the image?

2 Likes

But you can already set the images that way, is there some sort of new way? I think Petrichor means

Set 1 to (this is a picture)

And the picture’s variable is 1

And then you have set image to 1, and it turns into that image?

2 Likes

Yes, like you said. But you can do it with check if blocks so i guess this would only work if we had strings… but we are getting strings very soon

For those with the beta editor, right? Those without are out of luck.

3 Likes

Yeah, but every beta turns into reality. Non-subscribers will get strings soon.

Just to clarify @Petrichor, you can set image to a variable and an object, which are two separate things, right?

I hope so.

2 Likes

Yea, @Ana, when can we expect a beta feature to become reality? Like how long after becoming beta before it’s reality for all

1 Like

No, I mean set image to some number would be a predefined image, so for example 0 would always equal monkey or something. It’d make sense if they are just the object ids.


Variables would be a number or string that represent an object. So for example circle would always set image to a circle.


I’d assume it depends on how long it takes to get working well enough.

3 Likes