How do I change location of game files

Get help using Construct 2

Post » Mon Apr 21, 2014 8:19 am

Hello,

I'm trying to put everything after export as html5 to one folder except index and then change path in index file. But the game for some reason does not start.
For example i leave index.html in root and the rest put in game folder so resources are.

game/images/sprite-sheet0.png
/game/loading-logo.png

etc.

I tried changing path in index with game/ and ./game and /game and it did not work. Is there some other way or can you point me to right dirrection.

Thank you.
B
5
Posts: 27
Reputation: 279

Post » Mon Apr 21, 2014 8:29 am

I'm not sure why you would do something like this or if it is even possible.
In the export dialog you can see that there are subfolders name indicated. You could use the same name for both images and medias.

But as for the root, you have to make sure that files like the c2runtime.js file are well linked.
I'm also wondering if they aren't paths directly encoded in that js file which would require you to export non-minified and change those paths manually.

You can always check for errors in your browser and see what the console says about your custom export.

Sounds to me that you're trying to overcomplicate something that doesn't really need to.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
288
S
111
G
94
Posts: 7,332
Reputation: 69,160

Post » Mon Apr 21, 2014 10:02 am

I think you did not understood my question.

When you build from construct HTML5, you get bunch of files and among them index.html. I want rest of this files to put in subfolder and leave index as is and change linking in index.html so instead linking to c2runtime.js i want it to link to /game/c2runtime.js
B
5
Posts: 27
Reputation: 279

Post » Tue Apr 22, 2014 3:11 am

That's what I had understood and answered to.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
288
S
111
G
94
Posts: 7,332
Reputation: 69,160

Post » Fri Apr 25, 2014 2:59 pm

I am trying to achieve the same thing - and have already posted another question (sorry) here

how-do-i-split-html-from-remaining-file-structure_t103342

It answers some of your questions, but I am still having problems with the images folder
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Fri Apr 25, 2014 3:08 pm

Here is your answer. DON'T.

You have only 1 place to change your file references and that's in the export dialogue options. Once exported don't change anything. You might want to, but don't.

1. Everytime you export you will need change the sorting of the files.
2. c2runtime.js has already defined and mapped where those files are located. Moving files will break that.
3. To update the c2runtime.js will need to be updated every export.
4. You will likely break things.

When does anyone go into say a game like Mass Effect and start re-orginizing files?

If you are creating a website front end you don't need to re-orginize the export files.
Create your website front end view. In your html page use an iFrame. Refer to the game index.html into the iFrame.

there you go. no need to change the exported files. Your just going to make your life harder if you go the other way.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Mon Apr 28, 2014 9:06 am

Thanks for the reply @jayderyu

Whilst I agree with everything you say, we are not trying to change a game like Mass Effect - we are trying to build our own app - and as part of that we have an ever increasing number of platforms and locations on which to put them. The limitations you identify do restrict where and how we publish our work. In my case, through a WP site with controlled access. I could use an iframe to place the content in, but then this restricts my ability to provide a full screen option - I do not want my users to use my app in a small window.

The program already allows the possibility to control the file structure in terms of images, it would be nice if you could control the rest at export.

Do you know if it is possible to employ a full screen mode from within an iframe - as this would certainly solve this problem

Again - thanks for taking the time to reply to this post
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Mon Apr 28, 2014 1:04 pm

sainsy wrote:Thanks for the reply @jayderyu

Whilst I agree with everything you say, we are not trying to change a game like Mass Effect - we are trying to build our own app - and as part of that we have an ever increasing number of platforms and locations on which to put them. The limitations you identify do restrict where and how we publish our work. In my case, through a WP site with controlled access. I could use an iframe to place the content in, but then this restricts my ability to provide a full screen option - I do not want my users to use my app in a small window.

The program already allows the possibility to control the file structure in terms of images, it would be nice if you could control the rest at export.

Do you know if it is possible to employ a full screen mode from within an iframe - as this would certainly solve this problem

Again - thanks for taking the time to reply to this post


I guess the browser object's action request fullscreen could do it.

Also nothing prevents you to make a link directly to the index.html for the user to play I would think. Each game being in a separate folder
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Tue Apr 29, 2014 10:43 am

Thanks - I will look into that

What prevented me from directly linking is I need to utilise the security functions within wordpress so that only paid subscribers can access it. I therefore need to 'wrap' the construct generated HTML with the php generated by wordpress. This then generates a URL which doesn't physically exist - therefore it cannot access the javascript or image resources.

Like I said, not strictly a Construct problem

@ashley Don't know if this is something you would consider in a future update - the ability to control exactly where resources are exported and referenced
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Tue Apr 29, 2014 12:41 pm

This really should be just question of paths for game documents that should be changeable nothing else no complications needed this should not be the thing where flexibility breaks.
B
5
Posts: 27
Reputation: 279

Next

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 17 guests