A question for fellow programmers

0 favourites
  • 4 posts
From the Asset Store
Logo Quiz with 150 prepared logos and answers, automatic question and answer mixing
  • Hello dudes,

    I would like to ask you something.

    I've made a game for a person who wants to upload it on its server and make an online score database etc.

    The person told me that their current php framework does not allow relative paths, only absolute paths and thus requires him to include all the asses with absolute paths.

    He wants me to make a global variable that will store the absolute path. This global variable will concatenate with the original files emplacement.

    (i added an image)

    [attachment=0:2arydd4r][/attachment:2arydd4r]

    --> the second hyperlink is the stored variable.

    This seems very strange to me. Plus i don't think you can use global variables created in construct externally and If i create one directly in code i am wondering if it will work.

    So is there a better way to do this rather than adding a global variable to all includes/src. (this will go crazy with JSON format)

    Many Thanks!

  • Seems pretty strange to me too...

    Construct2 does not export php code, so it shouldn't care about paths. If you want to pass data back and forth from the game to php/mySQL then you should use the AJAX object to call a php script that will read or write data to a database.

  • Yep I thought this too because cmon php can trigger the index.html i presume but once it's triggered js executes itself. you don't need to load all the stuff with PHP. Am right?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are correct, just make a link to the index.html of the game - it should run fine.

    Once the game is running, then use ajax if you need to pass in any data from the web site, like username (if you have to log in to his site), or high score lists, character profiles or other data from a database that you need to save between sessions..,

    You can also use the Browser object to have the game navigate back to whatever page in his site he wants when the game is over.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)