chuck808's Recent Forum Activity

  • Hi influogames,

    Thank you for the reply. Please accept my apology for the delayed response, apparently it was a better idea to go and stand in shop queue's all day rather than try to sort this problem out - or at least that's what I was told :)

    I have managed to have a go with the code you provided but still no luck, it still doesn't appear to be sending anything via AJAX POST. Yet, if I pre-fill the variables in the php page it posts the information to the database as I would expect.

    I don't suppose anyone has a working version they could post? Not the ones already listed on this site as they don't seem to be working form me. Failing that, any more ideas would be appreciated.

    Thanks

  • Hi Guys,

    This may be a dumb question, but POST via AJAX seems not to be working or at least using the online Leaderboard methods mentioned here and here.

    I have updated the PHP/MySQL to conform with version 7.2 and both the savescore.php and getscores.php seem to be working fine as I can read the scores and names I manually added to the database and when I click the submit button I get a new entry in the database but without a name and just a zero (so not getting the score).

    This is what I have in the AJAX Add Action POST to URL DOMAIN_SCORES & "savescores.php?name=" & txtPlayerName.Text & "&score=" & Score.

    Anyone got an idea of what I'm doing wrong?

    Thanks

  • Hi armaldio,

    No worries, thanks for letting us know.

  • Hi armaldio,

    Downloaded from your website and it doesn't appear to be working correctly. On start-up I get the error message Access to ...........\Plugin Toolbox\info.ini is denied.

    Also, there only appears to be the c2 Pgugin Store visible, not the Plugin Creator.

    Thanks

  • Hi Ashley,

    Thanks for the reply. Yes, I can manage that without much of a problem, however, my use case requires that a user plays a game, on the the game over page there is a button to link to a 'my score' page and isn't allowed to go back to the game. This is handled with php $SESSION with a token. Unfortunately, the iframe doesn't end the session, so users can just hit the browser back button to go back to the game, even though I'm using sandbox="allow-same-origin allow-top-navigation" in my iframe. Basically, the ifram isn't letting go.

    I suppose I could add some javascript to my 'my scores' page to check where the request originated and end the session that way. I just thought it would be a more elegant solution to include the game scripts within the WP environment.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi TELLES0808,

    Thanks for replying. In a normal website you would be right, a typical structure may be:

    Root Folder ¬

    js folder

    css folder

    img folder

    game folder

    index.html

    game.html

    and so on, and as long as you point the src in any page to the game folder everything will work fine.

    However, WP doesn't work that way, in fact it doesn't even create pages as such, just meta data in the database used to build a page. Although a url may say the page doesn't physically exist in the directory.

    A usual practice when including scripts in WP is to use a function to register/enqueue the paths to the files so that WP knows where to look, unfortunately I'm not having much luck with it, that's why I was wondering if there was a way to bypass the way c2runtime.js grabs the url and replace it with a static one.

    Regards

  • Hi Guys,

    As I understand it at the moment c2runtime.js takes the current url to link to the resources, images/media/logo.png and so on, which is great for about 99.6% of use cases <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> . However, not so good for websites using templeting systems or CMS's.

    I am trying to upload a game to a WordPress site (a lot more painful than it should be), if I load all the exported files in the WP root directory and use the code from the game index.html file <body> in the home page, I can get the game to work perfectly. But lets be honest, most of the time that's not where we want the game. Because the url is relevant to the files location http://www.domain.com. If I the create a page in WP called Games the url becomes http://www.domain.com/games/, so c2runtime.js now trying to find a folder in the root directory called games, which obviously doesn't exist. Creating a folder called games and trying to trick it doesn't work either.

    I know I can embed the games using iframes and other methods but that doesn't fully work for what I'm trying to do.

    Is there a way, in c2runtime.js, to declare a static url to the resource folder, ignoring the what the browser says? or to register/enqueue relevant files in the WP functions file?

    Thanks in advance

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

  • 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

  • Mr E Bear,

    Sorry, my bad, I forgot to add the PayPal sandbox credentials, use the details below to first log into sandbox (https://developer.paypal.com):

       SANDBOX

       username: damiennorrisstz@btinternet.com

       password: 123password456

    Then use the following credentials if you want to test the game:

       GAME CREDENTIALS

       username: damien_1356341771_perstz@btinternet.com

       password: scirra123

    spongehammer,

    No worries, as always it is easy to misinterpret the written word, especially forum message boards or emails. My apologies for getting a little p**sy. The system I am working can be broken down so that the PayPal integration could be used on its owns or with an existing login system.

    Miu3,

    This is a sandbox account and therefor not my own account. The email to login is one of my emails but not the one I use for my PayPal transactions nor are any of the passwords the same as I use anywhere else.

  • Where is the login? Facebook only ? No thanks.

    The Facebook login is for something I am working on and is shown here as a demonstration of how the Graph API call is used to integrate with Construct2. Had you logged in you would have noticed that your FB credentials are passed to the game and stored together with your score to be shown on a Leaderboard (http://test.bmx-tube.com/scores.php). The system can work just as well with other Social Auth providers or even your own secure login system.

    What I am showing here is a proof of concept only, which after having read both of my posts again I thought would have been fairly obvious, but may be not. There is also a demonstration of how to integrate your games with PayPal and a method to stop users from refreshing the game thus reducing the chance of cheating.

    The reasons I put this up here are 1)to get some users to both test and and try to break the system 2)to judge if there is any interest in this kind off system 3)to see if it was worth while writing a tutorial.

    However, after being up for several weeks and only having one person test it and two negative feedback comments from people that appear not to have even looked over what I am doing, I see that there will be no need to write a lengthy tutorial and post the code.

    Thanks to those that have had a look.

    Regards

    Damien

  • Thanks for having a go. I have tried logging in using the email and password above and it works fine. Let me know if you are still having problems.

chuck808's avatar

chuck808

Member since 31 Oct, 2012

None one is following chuck808 yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies