Construct 2 games and projects in WordPress

Discussion and feedback on Construct 2

Post » Sun Apr 01, 2012 2:27 pm

@DrNickTo, I see your point and Joomla being one of the big 3 CMS, it definitely sounds like a good idea for integration. It's just that I don't really have the time/desire to pursue that particular one. Hopefully someone will take up that task though, it'd be nice to see C2 integration with all CMS.

@mammoth, I understand and I think the key point is simplicity, making it as easy as possible for someone to utilize a C2 project in WordPress. That's why I was stressing an exporter that exports a WordPress plugin.

@Velojet, I think I was unclear about what I was getting at. I meant that it would be best to have an exporter for C2 that exports a WordPress plugin, the same way this tool does. :)
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Sun Apr 01, 2012 9:01 pm

[QUOTE=Ugotsta]I think I was unclear about what I was getting at. I meant that it would be best to have an exporter for C2 that exports a WordPress plugin, the same way this tool does. :)[/QUOTE]
@Ugotsta: I wonder if that's what you really mean? A WP plugin is an add-on that WP users only need to do a one-time install into their WP setup, like this Flash plugin that enables Flash movies (or in our case, C2 games) to be embedded into WP-generated posts/pages. Talk of having C2 export a WP plugin just doesn't make sense to me.Velojet2012-04-01 22:10:12
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Mon Apr 02, 2012 3:16 am

@Velojet, the tool and the method I described does indeed provide an add-on where users would only need to do a one-time install, of their particular C2 project. It's on a per-game basis.

The type of plugin you're describing would likely allow for the uploading of any C2 exported project and would then make it easy to include the project in a WP page. It's just a different type of plugin, though they're both technically plugins. The use cases are just different.

The plugin I'm talking about here allows a game developer to make their single project available very easily to the WP community. For instance, if someone made an alarm clock with C2, they could package it up in a plugin so WP users could use it on their site.

With an exporter in C2, it would be that much easier for the developer to achieve. And this is very useful for game makers wishing to make their games easily available to the WP community.

I'm not at all saying this needs to be done, an exporter like that seems likely to take a bit of time away from C2 developers. I'm just saying, if anyone's interested in making such an exporter, I'll gladly assist however I can.

That said, it's possible to make a plugin that lets users upload their C2 projects (likely best done by uploading a zip file), at which point the plugin would provide an easy way to use that project. I've been considering how that could best be done, myself. However, I'm also having a hard time seeing how that would be as useful unless someone was intending to open their very own arcade site (a broader market).

On a side-note, in case you're not familiar with it (I've met quite a lot of folks who weren't aware of this one), WordPress can now use particular embeds without any additional plugins.

More on that here: http://codex.wordpress.org/Embeds
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Mon Apr 02, 2012 8:54 am

[QUOTE=Ugotsta]The type of plugin you're describing would likely allow for the uploading of any C2 exported project and would then make it easy to include the project in a WP page.[/QUOTE]
@Ugotsta
Yes, that's exactly what I mean, and what qualifies as a WP plugin in my book.

It seems to me that all the handwork required by your form/tool could/should be automated by a generalised WP plugin for C2 HTML5 exports. For example ...

[QUOTE=Ugotsta]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.[/QUOTE]
... you don't need to regexp search the original c2runtime.js for height/width (they're not there anyway), much less ask users to type them in - they can be taken from the C2 generated index.html (after all that's essentially what the c2runtime.js does).Velojet2012-04-02 20:08:30
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Mon Apr 02, 2012 2:41 pm

And size is not per-layout. The window size set in the project properties is what matters here.
As velojet said, just check the size given to the canvas tag in the index.html of exported project to see the designed size of the game.
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,998
Reputation: 57,791

Post » Mon Apr 02, 2012 11:20 pm

Right, the index.html has the canvas size, but I didn't want to ask users to paste in yet another piece of text. I've opted to ask for the height and width because there are some additions I'm planning to add regarding them, like a fluid wrapper, so the game could resize when used with a responsive theme.

The height/width are indeed contained in c2runtime.js as well though. It's just a tough process of grabbing that data from the runtime as opposed to index.html.

[QUOTE=Velojet]It seems to me that all the handwork required by your form/tool could/should be automated by a generalised WP plugin for C2 HTML5 exports. [/QUOTE]

Yes, it could be automated as such, though the dynamic between these 2 plugin concepts is different. As I mentioned earlier, if a developer wanted to release their game, let's say it's just a simple tic-tac-toe game, to the WP community, they could package up their project with the tool and do so.

This would be preferable to them giving instructions on installing the generalized WP C2 plugin and then downloading and installing their zipped project, for example. It's just a step easier for those wishing to use just that one game/app.

Incidentally, I just threw together a WP plugin that allows for easy integration of Inform 7 games and it provides the sort of generalized support you're referring to here regarding C2. The thing is though, it doesn't currently support games with extra resources, like images and sounds. That actually is the tricky thing about this type of C2 plugin too.

It takes quite a bit of consideration as to how to store such resources in WordPress. One would most likely use the Media Library to store resources (after unzipping process) and then store the locations of the relevant files in the database. I'm pretty sure that would be the optimal way to go about it, though I've not yet tackled that.

EDIT: I only just realized these resources could be stored in sub-folders in the plugin folder, though I'm not so sure of the implications of that. The plugin would need to provide a robust uninstall process as well.

If anyone's interested, the code behind the tool I made is available both in the javascript on the page as well as in the WP plugin code (PHP). Portions of it could come in very handy should anyone want to tackle this plugin idea themselves.
Ugotsta2012-04-02 23:23:40
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Tue Apr 03, 2012 12:16 am

[QUOTE=Ugotsta] Right, the index.html has the canvas size, but I didn't want to ask users to paste in yet another piece of text.[/QUOTE]
Definitely not my idea! I was trying to indicate that your plugin code should extract the width and height, without any user intervention.

[QUOTE=Ugotsta]... Yes, it could be automated as such ...[/QUOTE]
Not only 'could', but 'should' :) Make it a real tool that relieves WP users of attending to all those details that can/should be attended to by a sufficiently smart plugin.Velojet2012-04-03 02:46:08
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Tue Apr 03, 2012 2:22 am

@Velojet, you mentioned earlier that index.html has the canvas dimensions, thus my response was addressing that.

You mentioned previously...
[QUOTE=Velojet]... you don't need to regexp search the original c2runtime.js for height/width (they're not there anyway)[/QUOTE]

As I also clarified, c2runtime.js does have the dimensions as well, so they can be extracted with a regex search, it's just a tougher one than getting the dimensions from the index.html file.

[QUOTE=Velojet]Not only 'could', but 'should' :) Make it a real tool that relieves WP users of attending to all those details that can/should be attended to by a sufficiently smart plugin.[/QUOTE]

I have to reiterate, there are uses for the tool's method, as in cases where a developer wants to release just their game and not have users download another plugin and have to upload their project file as well.

What you're essentially saying is that this is "not a real tool". But the fact is that it is, and it exports a legitimate WordPress plugin, by definition. It's incredibly useful in specific cases, though obviously not for all cases, such as when someone wants to run their own WP-based arcade.
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Tue Apr 03, 2012 2:52 am

@Ugotsta
Sorry, I think I'm missing something here. I really don't understand why you say ...
[QUOTE=Ugotsta] Right, the index.html has the canvas size, but I didn't want to ask users to paste in yet another piece of text.[/QUOTE]
... when the width and height can be easily extracted by a script from index.html, rather than having "to ask users to paste in yet another piece of text" ??
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

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

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, heliogame, NetOne and 6 guests