“Create a new object” Control Block

Idea for a new block: Create a new object.
Comes with two object variables: Object Index and Total Cloned Objects. Both of these are identical to their clone counterparts, but with objects


Essentially, it acts similar to create a clone but functions differently with clones, where any clones created by the new object are bound to that object, not the original object.

This means that any “original object” variables will get the data from the new object instead of the original if that clone needs it.


This would be useful for making games like plants vs zombies or tower defense games like Bloons, since it would let you make towers that can use clones to create projectiles, and you wouldn’t need to individually code each tower, or have a limited amount of them.

It’s kinda hard to explain, so tag me if you have questions.
@Teminems_MM, @AwesomeOnion

Good idea?
  • Yes
  • Needs Changes/Additional work (reply)
  • No

0 voters

18 Likes

I would def love this idea implemented!

I have also struggled to make projects with this (objects shooting projectiles) before, and this would be a sweet fix!

7 Likes

Great idea!

6 Likes

Wow you are smart

5 Likes

Yeah, I wanted to make PvZ, but was turned off by that as well.
This would be so helpful!

Thanks lol

6 Likes

Cool idea ! This would be a big help to a lot of my projects that I have had in the past

4 Likes

Same! I still know a way tho

5 Likes

Making an individual object for each plant is tedious

5 Likes

Yeah and annoying

5 Likes

Great idea! And maybe clone specific variables like this:

set pos x (clone index [2]) y (clone index [2])
4 Likes

can’t you just use a separate text object that clones and another object broadcasts a message like “shoot”?

5 Likes

With just one object, (or a group of manually added ones) that could work

The issue is if you want to have a infinite potential amount of placeable projectile shooters that are cloned from an object so you don’t have to make each one manually and have them all fire asynchronously, else you’d need to either individually code each one or have them all fire at same time, which ruins the whole point.

5 Likes

You can already do that

When game starts {
    Clone
}
When object is cloned {
    Set image (image)
    Random code thingy...
}

But i prefer your idea.

2 Likes

I feel like it should be just called the “set original” block, where you control which object is the “original object” during certain times.

2 Likes

It’s basically the same but the difference is if the new object makes any clones the clones treat the new object as the original object.

And it dosent trigger when when object is cloned rules are triggered

Not exactly what it is? Look at the above answer.

4 Likes

Let me rephrase that: it’s basically a way to make new objects within the code that are not clones.
Essentially their own object that are controlled in the first object’s code

5 Likes

interesting I guess

3 Likes

So correct me if I am getting this wrong – since it can be a little confusing:

  • Original Object “Star Girl” has some code
  • Create Clone of Star Girl = clone with index “1” and runs the same ruleset
  • “Create new Object” is like duplicating it in the editor, then running the project, giving the new instance a clone ID of zero. Then when that object runs “create a clone”, their original object will be this “duplicated” Star Girl with Index 0.
  • If the “duplicated” Star Girl with clone index 0 runs “create a new object” again, that next instance will separate from both the “1st duplicate” and “original original” Star Girl.

I really like the idea, but I am not sure how easy it will be to understand. In addition, I am unsure of whether it will even be practical if we can read traits by Clone Index (e.g. Clone 3’s X_position)

5 Likes

That basically sums it up.

Unfortunately true, but it’s just how it is I guess.

The one problem I’ve been having is how to convey one clone’s variables to another clone, which is why I suggested this.
I’m trying to think of a method using strings where I store the variables and then use clone index to read from the string, I just can’t think of what to do once i hit a text cap, and I can’t exactly reset the clone index.

2 Likes

This idea is really interesting, for sure!

3 Likes