Code

For questions about using Classic.

Post » Wed May 25, 2011 2:05 pm

Hey! I have a question. Is there any way I can compile .cap file into a c++ code? Waiting for answers. 8)
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Wed May 25, 2011 3:54 pm

[quote="MastaZavr":1hv1660o]Hey! I have a question. Is there any way I can compile .cap file into a c++ code? Waiting for answers. 8)[/quote:1hv1660o]

If you download the source code for Construct, and look at the code that is generated for each condition and action you use (along with the objects in the layout editor), you should be able to piece together the pure C++ code.

That said, it's a lot of work, and probably will be less optimised than the exported exe from Construct itself :?
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Wed May 25, 2011 5:29 pm

[quote="MastaZavr":szptydzi]Hey! I have a question. Is there any way I can compile .cap file into a c++ code? Waiting for answers. 8)[/quote:szptydzi]

Nope :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed May 25, 2011 5:36 pm

[quote="Jayjay":16ojirbw]If you download the source code for Construct, and look at the code that is generated for each condition and action you use (along with the objects in the layout editor)[/quote:16ojirbw]

Wait... that can be done? I wasn't aware of that. Could you show us how?
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed May 25, 2011 6:42 pm

[quote="MrMiller":2r2y20qc][quote="Jayjay":2r2y20qc]If you download the source code for Construct, and look at the code that is generated for each condition and action you use (along with the objects in the layout editor)[/quote:2r2y20qc]

Wait... that can be done? I wasn't aware of that. Could you show us how?[/quote:2r2y20qc]

I haven't grabbed a copy of the source yet, but I think it can be done, yeah.

Since the whole thing is open source, you just find the code used during compiling of a cap to exe, and stitch it together manually (then fill in the data your cap tells it to). Unfortunately this would require replacing of the parameters and values of each subroutine with the hardcoded information you store in the cap file itself.

In effect, you have to run the code "inside your head" to find what executes when in the final program, and then you write the code just for your game. It's alot of effort, but maybe a program can interpret Construct conditions/actions and generate the C++ automatically someday.

If I get time to toy around with the source, I'll try and see if it's possible, but that probably won't be until late August though I think :(
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Wed May 25, 2011 7:19 pm

Oh, I see. I thought you meant there was a way to somehow directly expose the code running the events. It would've been a cool way to see what makes our event codes tick.

The Express Game Maker exposes the C# code for xna inside of another program window while you're creating. I always thought that was cool to see how what you're doing with the events and stuff playing out in C#.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed May 25, 2011 7:38 pm

[quote="MrMiller":1v7sfg32]Oh, I see. I thought you meant there was a way to somehow directly expose the code running the events. It would've been a cool way to see what makes our event codes tick.

The Express Game Maker exposes the C# code for xna inside of another program window while you're creating. I always thought that was cool to see how what you're doing with the events and stuff playing out in C#.[/quote:1v7sfg32]

Ah yeah, that would be cool. Thanks for telling me about that program though, it looks pretty cool :)
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Thu May 26, 2011 8:03 am

it would probably take less effort to write the code in c++ then to trace back all everything through construct source and stitch it together that way.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri May 27, 2011 7:52 pm

[quote="Jayjay":gyr8ctet]Since the whole thing is open source, you just find the code used during compiling of a cap to exe, and stitch it together manually[/quote:gyr8ctet]

Even though construct is labeled open source i have found there is actually quite a few official plugins and behaviors that have code which is not available.

That is just official things and there is then 3rd party plugins which are closed source so you would also have to make your own versions of those plugins or avoid the use of any plugins other than the ones available the SVN.

Technically it is possible though but as lucid says it would probably just be better to write new code. I am guessing some people making games will use programs like construct to make quick prototypes for games before coding them.
B
2
S
2
G
1
Posts: 121
Reputation: 1,092

Post » Fri May 27, 2011 8:54 pm

[quote="zeno":288g256k]Even though construct is labeled open source i have found there is actually quite a few official plugins and behaviors that have code which is not available.

That is just official things and there is then 3rd party plugins which are closed source so you would also have to make your own versions of those plugins or avoid the use of any plugins other than the ones available the SVN.

Technically it is possible though but as lucid says it would probably just be better to write new code. I am guessing some people making games will use programs like construct to make quick prototypes for games before coding them.[/quote:288g256k]

Yeah, it's not really a good solution at all. That said, if someone really needed to try and convert their game into C++, I think this would be the only way to do it at the moment.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests