Clones don't run before game starts ability

1 sentence description of the problem:
The code in the before game starts ability outside of any rules is only run by the original object
Steps to reproduce the problem every time:
(Start in a blank draft if possible)

  1. Add an object
  2. Outside of rules, set a variable to something that would be different for each clone, such as self’s clone index.
  3. Add a rule to create a clone
  4. When the object is cloned, check if the set value is correct.

I expected this to happen:
Eahc clone to have a different value
But instead this happened:
The variable is onyl ever set for the original object. The clones just inherit that value.

7 Likes

i thought putting variable blocks outside of a rule was just a shortcut to game starts?

4 Likes

It is before the game starts, even more than the first block in a game starts block.

I also think it only ever runs once? Not completely sure about that, though

4 Likes

yeah i thought like

variable blocks outside a rule would function as though they were in a “game starts” rule

which only original objects run & clones don’t

2 Likes

This bug still is bugged with a “random” block – each clone will have the same value. It is not the same bug as Clones have a clone index 0 when they are first created

3 Likes

what does thy meanst by that

2 Likes

If instead of setting the variable to self’s clone index you set it to a random number, each clone will still have identical values. This means that this is not just the same bug as in the other topi

3 Likes

no so like the variable block sets the object variable to a random number. which is outside of a rule so it functions like “game starts” which means the original object runs it before anything else

so lets say random chance decrees the variable is set to 014, & then the original object creates its clones, while its object variable is already set to 014. so the clones wouldalso have that

1 Like

It is a local variable, so I’m not sure if clones inheriting it is even intended. But the main issue is that the clones should run the code themselves as soon as they are created, but they dont

So yes, you are pretty much correct in what i think is going on

4 Likes

i thought that’s what clones are supposed to behave like. as in not a bug

2 Likes

I always thought this was intentional since variables outside of event operators are declared once per project start…

2 Likes