chuck808's Forum Posts

  • 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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Hi,

    Continuing on from the Facebook integration (http://www.scirra.com/forum/facebook-online-highscore-table_topic60731.html?KW=) I have now attempted to integrate PayPal into a game and I would like someone to test it out and possibly find any errors I have overlooked. Don't worry, it won't cost you anything as it is in sandbox mode and I wall give you ?1500 to play with, please feel free to have as many goes as you like.

    What the program should now do and not do is as follows:

       NOT DO

       Allow users to play the game unless they are both members and logged in

       Only allow logged in members that have paid via PayPal to play the Game

       Not allow players to hit refresh, F5 or back back-page in browser

       WILL DO

       Take a fee off members and redirect them to the game

       If either not a member, not logged in or not paid get redirected    away from game

       If a user tried to hit F5, refresh or back-page they get Kicked off the game and their score isn't counted - helps to prevent cheating

    It is easy to follow, just login with Facebook, hit the Pay & Play button, get sent to PayPal sandbox, put in the details below and get redirected to the game. Please feel free to try and break the system and let me know what is needed, and don't forget to pass this on to anyone you think may be interested.

    test.bmx-tube.com/play.php

    PayPal Details

    damien_1356177523_perndl@hotmail.com

    password: scirratest

    balance: ?1500

    Thanks Damien

  • Hi,

    You linked your pictures wrong, they're all linked to test/images/scirra/gameover.jpg

    I tried your website out and it' pretty neat! I like the idea of people logging in on the website, then playing the game.

    Cheers.

    Hi andreyin,

    Thanks for having a go, and thanks for pointing out my mistake above. Its not just a case of logging in to play the game, its more what is going on behind the scenes.

    There are several tutorials on here that show how to pass the user and score from the game to a database, what I am doing is only passing the score from the game. The username is taken from the user database and then passed to the game (in my example) and then saved into a separate data table to get the highest scores.

    Then from the high scores data table I am able to show the top 100 users and also to let the user know immediately after the game their highest score and rank.

    I now know that I need to set the image size for the leaderboard thanks to you.

    Regards

    Damien

  • Where are my pictures?

    Never mind I did something wrong <img src="smileys/smiley5.gif" border="0" align="middle" />