Only 9 clones allowed?!?



I have this game I was making and my worst enemy came along! A clone glitch!!!! So, you can tap somewhere and a block will appear. But this can only happen 9 times!!!!! Whyyyyyyyy?!? It took me a while to think of a name for it, and now a glitch is here!!!! Help me get rid of this glitch! Pleeeaaasseee it's the only game someone is interested in! More specifically, @Phase_Studios. Please help me @Ian, @Liza, whoever can! Please! :cold_sweat:

Help With Clones and Deletion of Clones

Are you doing a pressed or tapped rule? @Hoppertoscotch


@Phase_Studios tapped.


Ok @Hoppertoscotch, so in your tapped rule, make sure you have the make the clone and set poistion x and y last touch in that rule. Make a new rule and make it when (character is cloned) then inside of it have an (set position; (last touch X) ; (last touch Y). Do it.


That's what I did!



@Hoppertoscotch, Oops, delete the rule for when the character is cloned. I think it will work. And first of all, what are you making?


Oh, it's the thing I talked about and you wanted to beta test. Also, the Chinnchilla thing was I just made a project to see if it was a glitch and took a picture of that.


Wait I just realized what I'm supposed to do, but why could I only do 9 clones anyways?


I do not know? You should email The Hopscotch Team about team about that, it is very weird and bad.


Oh and what I thought I was supposed to do was even more glitchy. I will email the hopscotch team. I guess I can't make this for a while. Sorry, @alish!


So, @Hoppertoscotch, did you get a good answer, or do you still have a question about this? I haven't looked at your code, but i see "9" and i immediately think "512". And the reason that is relevant is that 2^9 is 512, and 512 is the limit on how many clones you can make in Hopscotch.

When i had a similar problem, i learned that i needed to have a way to make sure i was just "cloning" the original character, instead of cloning it and every clone that had already been generated. I can show you a fix, if you still need one.


Yes, I need a fix. I discovered that it is technically 8, but 9 if you count the base charecter that makes the clones. Please tell me the fix!



Well, I learned from Alish or Ian or maybe somebody else that a similar problem that I ran into could be solved by first making the thing that you want to clone have its invisibility set to a specific value. Then you would use an "IF" block to clone only that (original) character that has the invisibility value that you set. Seems kind of strange, I know. But it works. I'll lay-out two examples.

Example 1: Suppose you didn't want the "original" object to be visible at all, but you wanted to use it for cloning. I usually do that. You could then start with a "Set invisibility" value of 100% on the "when play button is pressed" block for the original object. Then, when you produce clones (I would assume that you want them to be visible) you'll just let them pop into existence and remain with invisibility of 0%. The trick is that in your "when [such and so] is tapped" (or whatever) block, you don't just "create a clone". That would clone EVERYTHING, including any clones already in existence. What you do is stick a "If Invisibility as a % = 100" inside of the "when [such and so]..." and you create your clone inside this "If..." structure. That way, the only object that gets cloned is the original, with its invisibility set to 100%.

Voila! One tap, one clone.

Ok, but you might not like that example, because it has the original set to be invisible. So, then...

Example 2: You start out with the original getting its invisibility set to the smallest possible value, which I assume to be 1%. Ok, so then the rest of the approach is the same as in the first example, except that you just use "If invisibility as a % = 1" and "create a clone" inside of that. Of course the clones will default to 0% invisibility, so, again, the code can distinguish the original from the clones.

Hopefully that gets you going.


It worked! But, I have a question, how does it work? The cloning charecter always is 100 % invisible! So, how did that work? This is out of curiosity.


I am glad to hear that this has solved your problem. It works for me as well.

To respond to your question, any time we ask, "why?" It kind of sends us on a journey down some rabbit hole or into a nested set of "why" questions. I suppose the real answer can only be found in the source code for Hopscotch itself. As far as why it should work the way it does, I guess the cloning operation has to be thought of as cloning the object as it exists in your code editing screen, and not as it may exist due to things that happen after you press the start button. Another way of saying that is that we are not cloning the invisibility of the original character, when we clone the character. That seems kind of illogical to me, too, since we're calling the generated object a "clone", and a clone is dupposed to be identical to its source, but the explanation seems to hold.




What's your username? And what's the game name


@friendship2468 oh, no thanks. It's all fine now. But thank you for offering.