How do I Create a New Object From Existing

Just started using Construct 2? Post your questions here

Post » Tue Jan 24, 2017 3:19 am

Hello!

This seems like a very simple task but I am having trouble figuring this one out. I want to copy an object in my tree view so that I can make multiple versions with variations to behavior and instance variables.

For instance, I have an enemy, and I want three types; I'd like to copy the first one and then make changes.

The issue:
When I clone the object in the tree view the cloned object doesn't have the same properties as the original.
How can I create a new object from the existing object that copies over all the behaviors and instance variables?
B
8
S
2
G
1
Posts: 4
Reputation: 1,008

Post » Tue Jan 24, 2017 4:37 am

There is a difference between clone object and copy object (See manual for differences). You'll want to use copy.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Wed Jan 25, 2017 1:15 am

Thank you for the reply.

I can definitely see that what I have tried is wrong, and I have found numerous other ways to do the wrong thing.

Still haven't found a way to accomplish my goal here yet though.

Everything I see on copying, cloning, shortcut key strokes, etc. all lead to creating new instances of an object type.

What I am trying to do is copy the object type to create a new object type. I have explored numerous methods of copying/cloning and researched the manual extensively. Can't believe I haven't found the answer yet, starting to question my research skills.

As you can see in the image below, the only immediately available option on the object is clone. Copy isn't even listed in the dropdown. There is a copy and paste option on the top left of the editor but this just copies the instances.

Image
B
8
S
2
G
1
Posts: 4
Reputation: 1,008

Post » Wed Jan 25, 2017 4:11 am

Oh, I "think" I understand what you are trying to do now. If so, what you need to do is add your object to a layout, and clone it there. All the behaviors and properties will port over to the new object type and you can edit them. If you don't want them in your game layout you can do it in an asset dump layout that isn't connected to an event sheet.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Wed Jan 25, 2017 4:21 am

We just came to the same solution at the same time! :D

I decided to just create a new object type altogether and wasn't able to edit it until I created an instance in the layout. So, same story there. I was coming to share the news when I saw your new post.

The asset dump layout is a smart solution to this strange requirement that I hadn't thought of yet, so you've now saved me more thought and perhaps from having to ask another question.

Many thanks!
B
8
S
2
G
1
Posts: 4
Reputation: 1,008

Post » Wed Jan 25, 2017 5:38 pm

You're welcome. I'm glad you got it all sorted.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests