Brilliant! Thank you!
Posts by SpaceKoala
Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
Apparently with upgrading PHP 8.1 a lot of the commands in the score saving php script that Jeff wrote have been depreciated (or annoyingly changed from mysql... to mysqli... and some arguments needing to be added to certain commands.)
I do not know anything about php or coding in general but I have been trying to update the script by reading the error log, googling the error and changing the line.
I have fixed most of the errors but now the only errors I get are related to these two array keys not being defined and I have not been able to solve this via google.
Code[27-Jan-2023 06:41:32 America/Chicago] PHP Warning: Undefined array key "status" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 78 [27-Jan-2023 06:41:32 America/Chicago] PHP Warning: Undefined array key "gameid" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 87 [27-Jan-2023 06:41:57 America/Chicago] PHP Warning: Undefined array key "status" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 78 [27-Jan-2023 06:41:57 America/Chicago] PHP Warning: Undefined array key "gameid" in /home1/(my server name)/public_html/apps/scores/score_script.php on line 87
I have pasted the code with my fixes below. Does anyone have any knowledge of PHP 8.1 and able to help out?
Code
Display More<? // header("Access-Control-Allow-Origin: *"); /////////////////////////////////////////////////////// // Online Score Script // Jeff Vance // Version 1.4 ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// // WARNING AND READ THIS! // You don't need to edit this file // The only file to edit is config.php // Don't edit this unless you know what your doing :) // This works out of the box -- your error must be in config.php ///////////////////////////////////////////////////// // Get Configuation file require("config.php"); // Connect to your server $db=mysqli_connect($mysql_host,$mysql_user,$mysql_password) or die (mysql_error()); @mysqli_select_db($db,$mysql_database) or die (mysql_error()); ////////////////////////////////////////////////// // Check for the existing table if its not found create it // This is really just here to make the life of new users of the script eaiser // They won't have to go thru the script and create the table ///////////////////////////////////////////////// if(!mysqli_num_rows( mysqli_query($db,"SHOW TABLES LIKE '".$tname."'"))) { $query = "CREATE TABLE `$tname` (`id` int(11) NOT NULL auto_increment,`gameid` varchar(255) NOT NULL,`playername` varchar(255) NOT NULL,`score` int(255) NOT NULL,`scoredate` varchar(255) NOT NULL,`md5` varchar(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;"; $create_table = mysql_query($query)or die (mysql_error()); // Preload table with 10 scores $date = date('M d Y'); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','100','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','99','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','98','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','97','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','96','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','95','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','94','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','93','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','92','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); $query = "insert into $tname(gameid,playername,score,scoredate) values ('1','Space Koala','91','$date')"; $insert_the_data = mysql_query($query)or die(mysql_error()); } /////////////////////////////////////////////////////// // Status Checker /////////////////////////////////////////////////////// if ($_GET['status']) { echo "online"; exit; } //////////////////////////////////////////////////////// // Run some checks on our gameid //////////////////////////////////////////////////////// $gameid_safe = mysqli_real_escape_string($db,$_GET['gameid']); // Check the gameid is numeric // If its not numberic lets exit if(!is_numeric($gameid_safe)) { exit; } /////////////////////////////////////////////////////// // Upload new score /////////////////////////////////////////////////////// // Test for the variables submitted by the player // If they exist upload into the database if ($_GET['playername'] && $_GET['gameid'] && $_GET['score']) { // Strip out | marks submitted in the name or score $playername_safe = str_replace("|","_",$_GET['playername']); //Unsafe name checker $unsafe = explode("\n", file_get_contents('banwords.txt')); $playername_safe = str_ireplace($unsafe, "",$playername_safe); $playername_safe = mysqli_real_escape_string($db,$playername_safe); $score_safe = mysql_real_escape_string($_GET['score']); $date = date('M d Y'); // Check the score sent is is numeric // If the score is not numberic lets exit if(!is_numeric($score_safe)) { exit; } // this secret key needs to be the same as the secret key in your game. $security_md5= md5($_GET['gameid'].$_GET['playername'].$_GET['score'].$secret_key); // Check for submitted MD5 different then server generated MD5 if ($security_md5 <>$_GET['code']) { // Something is wrong -- MD5 security hash is different // Could be someone trying to insert bogus score data exit; } // Everything is cool -- Insert the data into the database $query = "insert into $tname(gameid,playername,score,scoredate,md5) values ('$gameid_safe','$playername_safe','$score_safe','$date','$security_md5')"; $insert_the_data = mysqli_query($db,$query)or die(mysql_error()); } /////////////////////////////////////////////////////// // List high score /////////////////////////////////////////////////////// // Return a list of high scores with "|" as the delimiter if ($gameid_safe) { $query = "select * from $tname where gameid='$gameid_safe' order by score desc limit 10"; $view_data = mysqli_query($db,$query)or die(mysql_error()); while($row_data = mysqli_fetch_array($view_data)) { print($row_data['playername']); print "|"; print ($row_data['score']); print ("|"); print($row_data['scoredate']); print("|"); } // We limit the score database to hold the number defined in the config script // First check to see how many records we have for this game $query1 ="select * from $tname where gameid = '$gameid_safe'"; $countresults = mysqli_query($db,$query1)or die(mysql_error()); $countofdeletes = mysqli_num_rows($db,$countresults); if (mysqli_num_rows($db,$countresults)>$score_number) { $query2 ="SELECT * FROM $tname WHERE gameid = '$gameid_safe' ORDER BY score DESC Limit $score_number,$countofdeletes"; $Get_data = mysqli_query($db,$query2)or die (mysql_error()); while($row_data = mysql_fetch_array($Get_data)) { $id_delete = $row_data['id']; $query3 = "Delete from $tname where id = $id_delete"; $Delete_data = mysqli_query($db,$query3)or die (mysql_error()); } } } ?>
-
Thanks Yves. Number 1 fixed it.
Out of curiosity, how did you work out that sound was the problem?
-
Thanks for having a look Gigatron.
I am on Build R293.10 (I have the steam version so I am beholdant to the automatic updates that are pushed out.)
That's good to know about Firefox. I had only tried edge and chrome
What leads you to suspect the sound might be the problem? (and is there anything I can do about it?)
I have mostly used .ogg files in the .mfa but some .wav and .mp3 have slipped in there out of lazyness (would that be a problem though as CF converts files to .ogg and .mp3 on build?)
-
I have spent the holidays building this app to run over the web but it only loads on ios. On other platforms it hangs a quarter of the way through the preloader.
I thought maybe it was too big (16mb) so I saved one frame as its own html5 build (4mb) and but it still produces the same error. Has anyone encounted this kind of bug before?
Here's the one frame html5 build: Please login to see this link.
Here's a link to the mfa of the one frame version: Please login to see this link.
-
I'm not strong in css or html, could you post an example of how to do this?
-
Being able to embed font ttf files would be amazing.
-
On Android tablets and smartphones, the audio does not work, it must be forced with a button initially, after which it works regularly.
Do you mean that after doing Gigatron's edit to banks.js, you need to have a button on the first frame that plays a sound for it to work on android?
Is this in addition to commenting out
//this.silentSound = new CSound(this);
//this.silentSound.loadSilent();
in the app's runtime.js? -
As noted by many in the HTML5 export forum. There is a bug that makes html5 programs either crash on waiting for touch on ios browsers or not play sound if you bypass the waiting for touch option. We haven't heard from any Clickteam developers on the issue. Can this be worked on for the next update?
It seems a lot of forum members on that forum are using the HTML5 export for our jobs.
-
So if they are viewing the site in desktop mode that solves the sound issue?
Tricky for me to get young kids to set their ipad browser to desktop view. Does anyone know of a html tag or script that will do this automatically? I have had a look online but could not find any examples.
-
Yes, I have been waiting on this all year as well. It seems the problem was reported on these forums sometime in 2020.
The school I work at exclusively uses ipads in the classrooms so I have been building html5 games for the students to practice their listening skills for Japanese. Its a bit of a shame there doesn't seem to be a work around for it.
-
-
Thanks for the help. I've followed your instructions and got it to work.
I did not know about the "for each" function so that's a huge game changer for me.
-
Hi All,
Maybe you can help me with this problem I have always had with clickfusion. In my game that teaches Japanese you have to drag a Japanese letter over it's English counterpart. To save time I have used qualifiers so that I do not need to make a collision test for each letter but I have found when I run my game it only detects the first object I have created but ignores the rest. Here's a video demonstrating this:
Please login to see this media element.
The letters should snap into place but they only do this for the first object I created the other's just sit where they were dropped.
Also my win condition which is that each Japanese letter tile is colliding with it's English counterpart does not trigger (I'm only testing it with the first 5 but even that many does not trigger).
Please login to see this attachment.
I know I need to use fastloops somehow but even using them how the tutorials suggest doesn't seem to work.
Please login to see this attachment.
(targets = Japanese letters, doors = english letters)
Is there anyway you can suggest that would be a better way to handle these kind of events?
-
Ah I see what's wrong. I had..
Button Text$( "Group.Buttons", 1 )
..when it should have been..
Button Text$( "Group.Buttons", 0 )
Thanks for that.
Just out of curiosity, what does the value at the end mean?
-
Hi,
I am building some html5 quizzes for my students and I have run into a bug which only occurs in the html5 build and not testing in Clickfusion.Please login to see this attachment.
What is meant to happen is that the user clicks on the button with the button qualifier and that copies the contents of the button (a Japanese letter) to the textbox. It works in fusion but not in the browser.
My plan was to do it this way so that I don't have to code each button and I can just change the buttons when I make a new quiz.
These quizzes are meant for primary school aged students so I want to use this option rather than the students having to use a Japanese keyboard input.
You can see the quiz here Please login to see this link.
Does anyone have any ideas around this so I don't have to write code for each button?
-
Hi Fernando, thanks for your reply.
So this screen happens after the game is finished. It displays your high score as a counter object and the idea was to display the top score from the leader board only and when clicked on, it would bring up the leaderboard ui.
It sends the player's score to the leaderboard at the start of the frame but I don't think that's the problem as on the title screen of the game I try the same call but without sending a score to the leaderboard.
The leaderboard never finishes loading when I bring up the ui (even after 10 minutes) either on this screen or on my title screen so I'm assuming I'm not calling it properly.
-
Hi All,
I'm having a bit of trouble with the google play games extension. I'm sure I've done the dev console part correct but when I try and access scores it just shows up an infinite loading screen in my app.
Please login to see this attachment.I'm also trying to change a string to the name of the top scorer for the game and a counter object to that player's score. (Is this something I am able to do?)
Could someone please have a look at my code below and let me know if I am calling it correctly? (I wasn't sure if it is a good idea to publicise the entire code for the leaderboard so I have blanked out half of it.)
Please login to see this attachment.If you need more information, please let me know.
-
-
Hi all,
Here's a game I have been working on for about 6 months. (It actually only took a week to get the base game down and then the rest of the time getting friends to beta test and refining the game based on their experiences.) I had just got an Android phone around then and wanted to create a simple time waster app for myself, but then had people telling me to put it up on the Google Play store (which was a learning experience itself!)
The game is a ball physics based block breaking game. Levels are procedurally generated.
Tap the screen to launch the ball. Break all the boxes with an X to move to the next level.Launch video Please login to see this link.
Demo version Please login to see this link.
Paid version ($0.99) Please login to see this link.