Starter Kit score online Website - Problem showing list ingame

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.
  • Hi everyone,

    i've just purchased the Please login to see this link. by Hardsoft Project and i'm facing a problem.

    I'm using the example game provided and just changed the parameters to see it in action on my website and the scores are online, so submission is working as expected.
    The problem is getting the high scores list in game: the list shown starts from 2nd position, the 1st one is missing.

    There's this line of code in the List object:

    Code
    Add line listGetAt$( "String Parser", LoopIndex("list") + 2 )

    I thought that changing that number would do the job, but weird things happen when i change it.

    In author's contact page there's no email, so i'm stuck with a broken product on the clickstore.

    Is anyone willing to help me, please?
    If i can't find a solution, i think i have the rights to ask a refund.


    Thanks in advance.

  • just found the developer contacts in another thread of a user with the same problem, but there's no answer there (user didn't answered to dev's questions).

    Hope the dev can fix the 1st place and special characters (àèìòù etc.) issues.

  • Hi Esbol thank you very much for your feedback.
    It has to be something related to the database, then.
    Maybe the first row is read as a header...

    Don't you experience problems with special characters like è for example?

    Would you share your settings? Or maybe the hosting you're using?

  • Ok solved my problems with 2 workarounds.


    I'm reporting here, maybe someone else will find this little guide useful.


    Problem 1: First record (position) doesn't appear in the ingame hiscore table


    1. Create a fake line in the db


    Go the database and manually create a new line with score value as high as possible (2147483647 in my case). Name and other fields doesn't matter since the order is score based. This fake line will be the first one and won't be shown in the game hiscore table. The second record will be now shown as the first one.


    2. Fix hiscore entries number in the ingame hiscore table


    Ingame hiscore table will now report an extra record (the fake one) so we need to tell that number of rows = row - 1


    send_data.php


    change this line from:


    $num_row = mysqli_num_rows($res0);


    to


    $num_row = mysqli_num_rows($res0) - 1;


    New problem occurs: fake line appears in the web hiscore table


    3. Hide the fake line in the hiscore web page via css


    index.php


    add this line in the <head> section to hide the second row of the table (first one is the header with icons):


    <style>table tr:nth-child(2) { display: none !important; }</style>


    4. Fix hiscore entries number in the web hiscore table


    index.php


    change this line from:


    <div id="container_number_score"><i class="fa fa-star fa-lg" aria-hidden="true">&nbsp;</i><?php echo $num_row ?> High Scores</div>


    To:


    <div id="container_number_score"><i class="fa fa-star fa-lg" aria-hidden="true">&nbsp;</i><?php echo $num_row - 1 ?> High Scores</div>


    New problem occurs: gold trophy disappear


    5. Fix trophies assignment


    index.php


    fix trophies assignment increasing the position value by one, so the gold one will be correctly assigned to the second row (first is now hidden) and so on.


    if ($position == 2){
    $trophy = "<img src='./img/trophy1.png'>";
    }
    if ($position == 3){
    $trophy = "<img src='./img/trophy2.png'>";
    }
    if ($position >= 4){
    $trophy = "<img src='./img/trophy3.png'>";
    }


    Problem 2: input a special characters will report a blank name (empty field)


    This is not a real solution, because it got rid of the special characters rather than fix the db.
    I messed with utf-8 encoding stuff on the db (general-ci, unicode-ci), but no way to fix it.
    This won’t return a blank name, at least:


    Solution 1 (Universal)


    Make the input field read only and use a custom entry system to write the name as in the old arcades or with a custom keyboard so you can exclude special characters.
    Then using variables you can make the text of the input field = characters pressed.


    Solution 2 (Windows only)


    Make the input field read only and use the Substring Replace Object to replace any special characters with its standard character (eg.: replace è with e)


    A tedious job, nonetheless, but I have a working online score system now.


    EXTRA: show the position number


    By default this solution doesn't show the position number. If you want to show it both in game and on the web:


    Ingame


    send_data.php


    After


    while (NULL !== ($check = $res0->fetch_array(MYSQLI_BOTH)) )
    {


    Add this


    $position = $position+1;
    echo $position;


    Webpage



    index.php


    1. Add the position th to the table (first line in black with the hashtag icon)


    echo"<table>
    <tr>
    <th><i class='fa fa-hashtag fa-2x' aria-hidden='true' ></i>&nbsp;</th>
    <th><i class='fa fa-trophy fa-2x' aria-hidden='true' ></i>&nbsp;</th>
    <th><i class='fa fa-list fa-2x' aria-hidden='true'></i>&nbsp;
    </th>
    <th><i class='fa fa-user-circle-o fa-2x' aria-hidden='true'></i></th>
    <th><i class='fa fa-calendar fa-2x'aria-hidden='true'></i></th>
    <th><i class='fa fa-clock-o fa-2x' aria-hidden='true'></i></th>
    </tr>";



    (WITH the above fix for the first line missing applied - go to the next red title if you don't have the first line missing problem)


    2. Add this line before the line $position = $position+1;


    $realposition = $position;


    3. Add the position td to the html table (first line in black)


    echo "
    <tr>
    <td>".$realposition."</td>
    <td>".$trophy."</td>
    <td>".$check['score']."</td>
    <td><span>".$check['player_name']."</span></td>
    <td>".$check['date_upload']."</td>
    <td>".$check['heure_upload']."</td>
    </tr>
    ";


    (WITHOUT the above fix for the missing first line applied - hiscore table is ok by default)


    If you doesn’t experience the problem of the first line missing, but want to add the position number:


    index.php


    2. Add the position td to the html table (first line in black)


    echo "
    <tr>
    <td>".$position."</td>
    <td>".$trophy."</td>
    <td>".$check['score']."</td>
    <td><span>".$check['player_name']."</span></td>
    <td>".$check['date_upload']."</td>
    <td>".$check['heure_upload']."</td>
    </tr>
    ";


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!