Construct 2 games and projects in WordPress

Discussion and feedback on Construct 2

Post » Tue Apr 03, 2012 12:59 pm

Right, my mention of index.html was in response to yours and Kyatric's responses. I was addressing the tool in specific, as it doesn't currently ask for the index.html contents.

At that particular point in this discussion, I was not addressing the issue of creating a generalized plugin. I was just referring to the tool under discussion at the time.

@Kyatric, as I've been working on another game, I couldn't help but mention, in C2, dimensions are indeed on a per-layout basis. I'm rather sure they're not used (I've not tried varying layout dimensions), but they are there as parameters in the layout section.
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Tue Apr 03, 2012 1:03 pm

Yes there are parameters for the layout's size in the layout section, but when it comes to the exported project size it has nothing to do with the layout.
Only the window size (in the project's properties) is to account for. You can have 10000X100000 layouts in a 320X200 window, all that will be displayed will be this 320X200 window.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed Apr 04, 2012 12:20 am

[QUOTE=Ugotsta]Right, my mention of index.html was in response to yours and Kyatric's responses. I was addressing the tool in specific, as it doesn't currently ask for the index.html contents.

At that particular point in this discussion, I was not addressing the issue of creating a generalized plugin. I was just referring to the tool under discussion at the time.[/QUOTE]
But shouldn't even "the tool under discussion at the time" be extracting the width and height from index.html?

Two advantages (major goals for all software tools):
1) Eliminate possible errors in user entry.
2) Eliminate tedious handwork for users.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Wed Apr 04, 2012 5:00 am

[quote=Velojet]But shouldn't even "the tool under discussion at the time" be extracting the width and height from index.html?[/quote]

I believe it would be great to auto-extract that and thus I believe it would be best done at the exporter level, where the data is more easily available. That's why I mentioned that.

The tool at my site could do it, it's just that it would require either the user copy-pasting their index.html contents into the form, or it would require a very tricky regex search that could very easily get broken by future C2 versions.

Given those two options, I instead went with a form input that asks for the canvas dimensions. This has an advantage in that I can use a bit of jQuery to handle additional features, like a fluid-width canvas, so a C2 project could resize within a responsive theme. I've actually experimented with that with success in Google Chrome, though the other browsers work strangely differently.

That said, I've always held in deep consideration, making software that is as easy as possible for users to use. I agree those are excellent goals you listed and I always consider these things myself in projects I work on.

However, I think I may have misunderstood you on one point. Are you actually suggesting that a WordPress plugin be made that, itself, exports a WordPress plugin?

If so, I overlooked the possibility you were referring to that.Ugotsta2012-04-04 05:01:18
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Wed Apr 04, 2012 9:29 pm

[QUOTE=Ugotsta]However, I think I may have misunderstood you on one point. Are you actually suggesting that a WordPress plugin be made that, itself, exports a WordPress plugin?[/QUOTE]
No, no misunderstanding. I had in mind a standard WordPress plugin that would be listed in the Plugin Directory.

[QUOTE=Ugotsta] [quote=Velojet]But shouldn't even "the tool under discussion at the time" be extracting the width and height from index.html?[/quote]
... it would require a very tricky regex search that could very easily get broken by future C2 versions.[/QUOTE]
I can't see that. It's just a matter of looking for the <canvas> tag in index.html and extracting the values from its width and height attributes - pretty standard regex stuff. And because C2, exporting to HTML5, is always going to generate a <canvas> tag, there's just no chance that it "could very easily get broken by future C2 versions".Velojet2012-04-04 21:31:09
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Thu Apr 05, 2012 12:03 am

[quote=Velojet]I can't see that. It's just a matter of looking for the <canvas> tag in index.html and extracting the values from its width and height attributes - pretty standard regex stuff. And because C2, exporting to HTML5, is always going to generate a <canvas> tag, there's just no chance that it "could very easily get broken by future C2 versions".[/quote]

I don't think you're actually reading what I'm saying. I was referring to the tool's current method. That's it.

Whether you think it ought to work differently or not is beside the point. The tool is very useful for a specific purpose, a commercial one no less, but a different purpose than what you're referring to.

I'd be more than happy to see a plugin in the WP repo that provides easy and full integration with C2 projects. I just doubt I'd really have the time to pursue that just this moment, myself.Ugotsta2012-04-05 00:04:16
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Sun Feb 01, 2015 1:04 pm

Ugotsta wrote:Hi everyone!

I've delayed far too long in posting this, but here it finally is. I've thrown together a Javascript-based form that helps you to port over exported Construct 2 projects to a WordPress plugin.

The form/tool is available from my Cloud9 IDE account as follows:
https://c9.io/ugotsta/tools/workspace/w ... maker.html

I've used it for quite some time in a number of ported projects, some of which are listed in the article, so I know it works well given my own circumstances.

There's a lot more still to consider though, so please feel free to add your thoughts if you have any. I'll be keeping an eye on this thread as well as the comments on that article (comments are done via Facebook to simplify login/validation).

I'd love to see this type of thing built into the export process, so if I can be of assistance to that effect, please do let me know!

3-30-2012 UPDATE: I've just updated the tool so it now asks for height and width and includes that in the output canvas. I couldn't easily regexp search the original c2runtime.js for height/width, especially since dimensions are per-layout, so I've just added it as a setting in the tool's page.

3-15-2013 UPDATE: Form now available from my Cloud9 IDE account, as the website's currently down. Incidentally, Cloud9 is blazingly faster than my previous host, so it's much quicker to use.

Cheers!
DavidMUgotsta2013-03-16 05:08:50


Hello David

The download link does not work anymore. Do you have an alternative download link?
B
5
Posts: 59
Reputation: 343

Post » Sat Mar 14, 2015 7:38 am

Hey @hrg,

Terribly sorry for that! It's actually still up at Cloud9 but that definitely wasn't the optimal place to post it. It's now up at GitHub but I'll have to look at updating and having it on a GitHub page.

For now, you can find the code here:
https://github.com/Ugotsta/wordpress-plugin-maker-for-construct2

And I've just set it up once again through Cloud9:
https://ide.c9.io/ugotsta/wordpress-plugin-maker-for-construct2

A live-preview link (this will only be available a short time:
https://preview.c9.io/ugotsta/wordpress-plugin-maker-for-construct2/index.html?_c9_id=livepreview0&_c9_host=https://ide.c9.io

Hope that helps for now, I've been planning out a way to allow uploading of the HTML5 files into WordPress so that it automatically makes the game available via shortcode. No ETA, but I'm working toward that, just need to find the time!

Cheers,
David
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Mon Nov 21, 2016 5:21 pm

Hello David,

I know i'm a bit late to the party, are you still doing anything with this Plugin Creator?

I have been trying for several months on-and-off to find a good way to integrate an exported game to WordPress, without much luck. It's fairly straightforward to upload all the files to the root folder and just link to the index (renamed for obvious reasons) file, though this method doesn't wrap the game in the WP core so can't take advantage of the security features.

I did have partial luck creating a custom theme page template and including the generated code from the index file but no matter what i tried i couldn't c2runtime.js or any other assets to open int he page, even when I edited the Construct 2 core files to amend the path to the assets.

I have downloaded the plugin files from Github, run them both on my PC and on a live web server but couldn't get anything out of it. Am I missing something or is it just because C2 has had a few updates?

Any help appreciated
B
4
Posts: 13
Reputation: 426

Post » Tue Nov 22, 2016 9:21 pm

A quick update.

I managed to get it working using MS Edge (weird, I know), it created the .php and .js which appeared to be OK. I then followed the instructions with 2 different games, the first I just dumped all the exported files into the zip file and the second just the new files, images and media folders along with the logo.png.

The plugins installed as expected in WordPress. However, nothing was visible on the page where I included the shortcode, though the page did appear to resize to match the canvas sises I had put in.

It looks as though the links to the assets aren't being generated or recognised.

Any ideas anyone?
B
4
Posts: 13
Reputation: 426

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: TheRealDannyyy and 12 guests