How to merge 2 projects (Tutorial from SQUALE).

Get help using Construct 2

Post » Fri May 01, 2015 12:57 pm

Hello,

Here is the translation of the Squale tutorial on how to merge two C2 projects.

French version here
-------------------------------------

First, you should make a save copy of your projects to avoid a possible disaster.

We need to work with the project files, not the simple capx. If you have a simple capx, you can just rename the extension .capx by .zip and unzip it to access all the files.

It's better to work with 3 folders : First project / Second project / FinalMerged project (which is an empty project).

Very important : before starting the merge process, be sure to have no duplicate names (layouts / objects / families..Etc)
Layers can have the same name BUT be careful with Global layers. (prefer to give them a different name in each project or you will have surprises)


In the Final folder, we will have to rebuilt the entire project :
(Don't pay attention to .uistate.xml files. They don't need to be copied.)

Animation folder
Copy the folders from the two projects (beware of duplicate names)

Event sheets forlder
Copy the folders from the two projects (beware of duplicate names)

Open with a text editor like Notepad++ and make these modifications if needed :
Give different names
<name>Event sheet 1</name>
If the code targets to another layout, check the names
(But if you already well prepared both projects without duplicate names, you shouldn't have to do this)

Files folder
Must contain the entire files of both 'files' folders.

Textures folder
Must contain the entire files of both 'Textures' folders. (if you have some)

Layouts folder
Copy the folders from the two projects (beware of duplicate names)
<name>layout name identical to the xml name</name>
<event-sheet>Related event sheet name</event-sheet>


Ok, now the hard part.

File.caproj
Open the . caproj of each project with a text editor like Notepad++ and make these modifications :

<used-plugins>
Copy the 2 projects content into the final one(Be careful to only copy the different plugins! Only one of each type.)

<used-behaviors>
Copy the 2 projects content (Be careful to only copy the different behaviors! Only one of each type.)

<used-effects>
Copy the 2 projects content (Be careful to only copy the different effects! Only one of each type.)

<object-folder>
Add all different objects contained between the two beacons <object-folder></object-folder> of each project, one after the other.

<families>
Do the same for the families (if you have some)

<layout-folder>
<layout>Layout name.xml</layout>
<layout>Layout name2.xml</layout>
Insert all the layout file names contained in Layout.

<event-folder>
<event-sheet>Event sheet 1.xml</event-sheet>
<event-sheet>Event sheet 2.xml</event-sheet>
Insert all the event sheet file names contained in Event sheets.

<global-instances> (don't look for you ingame global instances, that's not the same thing. They are contained into the eventsheets.)
Copy the 2 projects content (Be careful to only copy the different instances! Only one of each type.)

<sounds-folder>
Copy the 2 projects content.

<music-folder>
Copy the 2 projects content.

<files-folder>
Copy the 2 projects content.


And voilà.
It should work. But if it doesn't, you will probably get an error message from C2 that indicates the issue line number in the capx. Just go check it and correct it.

Thanx again to Squale for the help. :)
B
72
S
21
G
12
Posts: 314
Reputation: 12,111

Post » Fri Jun 19, 2015 8:29 am

Hi, thanks for this tutorial, wasn't quite what I needed but it comes close.

I have several projects with the same menu/ui, so I've put all menu and UI event in seperate sheets. According to this tutorial I can safely copy event sheet XML files from one project to the other. I've been doing it for some time now and haven't noticed anything strange, but you never know.

The thing I am a little worried about is those
Code: Select all
sid="1369915436515779"
attributes. Are these used for anything specific and can they cause conflicts of some kind?
B
4
Posts: 3
Reputation: 209

Post » Fri Jun 19, 2015 11:04 am

Hello @robbe :)

Well I'm not 100% sure but the SID is a 16 generated number ID for the events. So you shouldn't worry about it.
Getting the same exact SID from two different projects would be very very rare!

I had no problem with it from now. :)
B
72
S
21
G
12
Posts: 314
Reputation: 12,111


Return to How do I....?

Who is online

Users browsing this forum: evillair, Exabot [Bot], LunchboxGames, NumberOne, rekjl and 16 guests