Problem experienced with clones



Continuing the discussion from What tutorials do you want?:

Hi @oio and @CreativeCoder, I think this isn't a problem but it's more to do with how clones work.

Clones on Hopscotch follow all the rules of the original, excluding When the play button is tapped and When this character is cloned.

So if you have a rule with When the iPad is tapped then all of the characters' clones will execute the code inside that rule.

When the iPad is tapped
    Create a clone of this character

So at the start you have only one character. When you tap the iPad screen, you get 1 extra clone and the value is increased by 1.

Now you have two characters on screen. When you tap the iPad screen again, that rule will execute for both of them, so they will each produce 1 extra clone and increase the value by 1. The overall effect is that there are now 2 extra clones, and the value is now equal to 3.

When you tap the iPad screen again, all four characters will execute that code, so they all produce more clones and they all increase the value by 1. Since there are four of them, you can see that in total the value is increased by 4 and that's why it ends up at 7.

With all these clones producing copies of themselves and doubling, you can see why the value is equal to 2n-1. Also, Hopscotch capped the maximum number of characters on screen at 512, so when you saw you had 511 it didn't include the original.

Hope that explains a bit about why the clones work like that. Hopscotch is planning to add some "self" values to help distinguish between clones and the original :smiley:



Cheers, and thanks for your kind effort to ■■■■■■■ this question. I also think it's cool how you split this off into another thread. :sunglasses: Wait... That's odd... For some reason, I cant use the English word "■■■■■■■" beacuse something about a word, meaning "to speak to" or "to give attention to" is deemed problematic by the protect-the-innocent filter. Okay... Thank you for your kind effort to addr3ss my question. Now, wasn't that an advanced and devious circumvention? Whatever. All i wanna do is say "thanks" and to say what it is that I appreciate. :stuck_out_tongue_winking_eye:

Ok, to the point, you have provided a very nice explanation that falls into the "because that's how it works" category. Yep... that's how it works! :yum: Got it.

But here's a fun topic: What if you wanted to do exactly what I described in the text you quoted from me? Is there a way? I dunno. I'll admit, I haven't thought much about the question myself, since posing it. But I am no closer to an answer now, than when I first asked and @alish replied, so there's a bunch of stuff I just can't do, even though it seems like the whole limitiation boils down to something that is conceptually primitive.

Now, even though the banner on my account says "Hopscotchin' since October 2014" i haven't messed with this language at this point for more than three weeks. So, I sure don't know all the tricks that others know. I want to. i like learning tricks. Hence... the question. Can you think of a way to generate exactly one more clone or copy, when the iPad is tapped? I am not claiming that it is really a "problem" that I can't seem to do that. I regarded as a "limitation", if not of the language, then of my understanding of it. I think, if I could make on-demand clones, it would open up some interesting possibilities in the making of games. The only thing that would be missing at that point would be an "ability" to make a clone expire. I am fairly certain that this is not an option, although I do have a workaround to simulate extinction, even without the "self" properties. I won't get into it here, because this is not an "improvements" thread. Here, I am only asking for information, a.k.a. a "tutorial." :smiley:

Clones are spawning in bunches

@oio how about making a rule that starts with When Character is Cloned set invisibility to 1%. So all clones (but not the original) will be ever so slightly invisible (you'd never see the difference)

Then in your When iPad is tapped rule, check once if invisibility = 0 and only then create clone.


That way only the 0% character (of which there is only 1, the original) will clone, and thus every tap will yield only one more character



Ooooooo, @alish! That sounds clever. I need a minute to get my head around it…

Yes! You are using invisibility as a way of tagging a clone or the original. That's exactly the same thing that I did, when I made those simulated three-dimensional widgets that I published a week or so ago. Have you seen those, by the way? If you haven't, and if you have access to a dark room, and if you don't mind looking at your iPad with only one eye, you... really should! It's trippy. :stuck_out_tongue_winking_eye:

Just to be sure that I get what you have in mind, would it be rude of me to ask you to create an example, based upon what you have said, and to upload it? That would be cool of you!


EDIT: haha, you beat me to it. Thanks for posting the above images. They weren't there, when i started typing. :smile:


This topic is really useful, so I am reviving it for people who are having trouble with clones. :smile:


:D :D :D
Revive! :D