Giving Clones Names

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

Naming clones!

I’d use it for this type of project:

any project that involves lots of clones.

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

It would be much much easier to work with clones, and it would make a more organized code.

Here is an example design I’ve made:

I can’t photoshop, but here’s a design example-

Clone Index (1) = (Name)

You can use it for conditionals as well-

If Clone (Name) < 50 Then

Or even in rules-

When Clone (Name) touches Clone (Name2)

Here’s a wonderful example (made by the amazing @/Awesome_E) of what it could look like~

I’ve seen something similar in another programming languages, it looks like this:

nah

I probably explained this poorly, so feel free to ask questions and I’ll try to elaborate more.

11 Likes

so kind of like this (basically being able to identify clones and use them somehow)?

10 Likes

It’s similar. But I think the two topics are distinct.

6 Likes

yes this is more about identification, which would be really nice

how would it look in the editor? would it be like a separate block?

6 Likes

yesss

Not sure. It would probably be separate block, maybe yellow?
I wonder if it could be implemented into the “Set to” block.

Set (Clone Index (1)) to (Name)
7 Likes

this is already clone identification, so id go with this example:

Set Name to [“”]

and if youre not convinced, just as set position, you dont set another clone/object’s position, you set it to the object running the block rn :))

(but yours is okay too! i was just giving my opinion on this)

5 Likes

It’s more for organization purposes, instead of having to remember the exact id of the clone, you’d just have to remember the name. Also you can assign names to multiple clones and thus create “groups”

5 Likes

Interesting – what about just a more general “Set Name” block? Then, it would be accessible by the existing name trait in the object event parameter[1] selector


  1. (>>Original Object<< X position) ↩︎

6 Likes

Ngl, half of that went right over my head, but it sounds plausible.

I like the idea of a “Set Name” block~

6 Likes

7 Likes

Can you not use variables to store the values? That would be even better than a name since you wouldn’t make typos as easily.

2 Likes

That could potentially be a lot of variables that wouldn’t be needed if naming clones were possible. I’m not sure about other Hopscotchers’ large projects, but my own have way too many variables the way it is.

1 Like