0 Favourites

How do I change location of game files

  • 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.

  • 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.

  • 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

  • That's what I had understood and answered to.

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

    It answers some of your questions, but I am still having problems with the images folder

  • 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.

  • 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

  • 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

  • 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

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I have some short of the same problem..

    I need my folder structure to be like this

    -Main folder

    -Subfolder "Media" for images and sounds (no problem so far)

    -Subfolder "Source" with the c2runtime file AND the c2runtime to be named "Runtime"

    The rest of the files can stay in their place in the main folder

    This is the structure that they want me to deliver my apps (im doing some apps for another company) and i cant find a way to do that.. Can i do this somehow?

    Thanks in advance

  • not sure that would work, but maybe editing the index.html to change the part where it calls the c2runtime.js to make it call the Source/Runtime.js, and placing the c2runtime.js in the source subfolder and rename it Runtime.js ?

  • Worked Like a charm!

    changed the "c2runtime" from the string to "Source/Runtime" and works Perfectly.

    You are a life saver! Thanks a lot!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
763 305,734
asikanddestroy's avatar
asikanddestroy
Unread hot topic
232 177,700
Tetriser's avatar
Tetriser
Unread hot topic Locked topic
195 16,205
Ashley's avatar
Ashley Construct Team Founder