AnD4D's Forum Posts

  • Nice one sizcoz !

    Quick question. Why do you have &"" at the end? I haven't tested it, but I was told by a friend today that if I replaced intval with spritef it would then work.

    Interesting that there are so many ways to get the same result.

    Thanks again! I'll implement it soon!

  • Well... I'm confused then...

  • Wait... intval is referring to integer variables. Might that be throwing things off?

    In the example you provided, they're searching for an ID number, aren't they?

  • Is it a publicly hosted dB? If you post the url we could have a play around - this definitely seems like a solvable problem

    Yeah, I was thinking about that, but unfortunately it isn't :(

    I've altered the php file so that it reads:

    $q = intval($_GET['q']);
    $link = mysqli_connect("$host", "$username", "$password", "$db_name");
    
    // Retrieve data from database 
    $sql="SELECT * FROM drawings WHERE name = '".$q."'";
    //DESC LIMIT 10";
    $result=mysqli_query($link,$sql);
    
    // Start looping rows in mysql database.
    while($rows=mysqli_fetch_array($result)){
    echo $rows['name'] . "#" . $rows['artist'] . "|" . $rows['score'] . "|";

    Along with changing the end of my AJAX request so that it has ".php?q=Pickaxe" on the end (as that's one of the words I want to grab.

    Now, instead of grabbing the database, it's grabbing a comma (,) which it's not done before :D

    Obviously that's not what I was hoping for... but a different result is at least interesting.

  • If I’m reading the following correctly, I’d imagine you append ?q=“3” to the end of your get request to complete your example above

    https://www.w3schools.com/php/php_ajax_database.asp

    Hmmm, I see... So it's not quite that simple, as that's basically searching for the ID. So I need to add a GET command to my php, then have the q command linked to something in the AJAX GET.

  • Thank you for the message, but that's pretty much what I already have. My issue appears to be the Construct 2 side of things. Where/How do I tell Construct to tell the Database what word to search for?

    From that example you provided, how do I tell Construct to only download the row associated with the CustomerName Antonio Moreno Taquería?

    AJAX - Request - "https://address/phpname.php?CustomerName=Antonio Moreno Taquería"

    ?

  • I have a database that is accessed using the following php code:

    // Connect to server and select database.
    $link = mysqli_connect("$host", "$username", "$password", "$db_name");
    
    // Retrieve data from database 
    $sql="SELECT * FROM drawings ORDER BY name";
    $result=mysqli_query($link,$sql);
    
    // Start looping rows in mysql database.
    while($rows=mysqli_fetch_array($result)){
    echo $rows['name'] . "#" . $rows['artist'] . "|" . $rows['score'] . "|";
    
    // close while loop 
    }
    
    // close MySQL connection 
    mysqli_close($link);
    ?>
    

    I'm currently using an AJAX GET command such as: "https://address/phpname.php" to grab the data.

    This was fine at first, but the more data I have, the longer it's taking to download it all.

    Does anybody know what changes I need to make to my AJAX GET and the PHP file to grab a specific row, instead of the entire database?

    Say for example I want to grab the row that is titled "Banana" or "John" or "Penguin". What do I need to change the AJAX GET command to so that it states what it's looking for? As well as the changes required to make it work with the php.

    Sorry if this isn't really the right place for such a question, but I've been searching all over the internet, and can't really see how to tie any of their suggestions into Construct 2.

  • Is there a limit to how much data can be uploaded from Construct 2 via AJAX?

    I've created an online database that can support something like 1mil+ characters, and can manually paste data into there without issue. However, when I try to get C2 to post say 100k characters to it, it won't go through. The code is correct in the sense that I can send 5k without issue, but I was just wondering where I might be getting things wrong.

    Is it the AJAX, or might it be something I've done wrong with my database?

  • I've been trying to get this to work for the past 2 days. The tutorial is a bit odd in the sense that the code is presented in a picture instead of something that can either be downloaded or copy/pasted, but that's fine I guess.

    When I try to use the program, I get an error on my site telling me that something has been blocked. When I grant that permission, I lose my site's https and it's labelled as not secure.

    The issue I have is that I do not know where to put the code. Sometimes I see that you just have to upload it to your server. Sometimes I see that you have to have the php code on the root of your website.

    Do I have to give things special permissions?

  • The template is gone... so I have found it and pasted it here.

    Problem description

    Shadows with a height of zero are meant to be infinite. This is not the case.

    Example CAPX

    https://1drv.ms/u/s!Am3CPIM7woZ9g7Qn-JBJTJHHTAKAgw

    Steps to reproduce

    I have set the ShadowLight's position to the mouse X and Y.

    Move it onto the Xs to see the issue.

    Observed result

    The shadows only appear to stretch on for a short distance.

    Expected result

    The shadows are meant to be infinite. The exact same capx when opened in C3 works as expected.

    System details

    R266, Windows 10, tested on everything.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's hard to make sense of the screenshots. But I would guess it's a bug along the lines of "shadows are meant to be infinitely long but aren't" that was fixed in C3.

    Hi Ashley thanks for replying.

    You're correct that the shadows are not infinite in C2. Am I correct in assuming that there are no plans to fix this bug in C2, and that if we'd like to use effective shadows we need to use Construct 3 instead?

  • You might check to see that you're running webgl on C2.

    Hey newt how's it going? Yeah, WebGL is on in C2. Otherwise you can't have soft shadows.

    This is really annoying me XD

  • Here's a shadow from C3:

    And the exact same capx file opened in C2:

    Is there any reason that shadows simply aren't very good in Construct 2?

    What's the reason that if I get too close to the wall, I can see through the wall? I haven't changed any of the settings on either files.

    The light source has a height of 0 and a radius of 20. If I change the radius to 0, I get longer shadows, but worse visuals. Any radius over 0 gets shorter shadows.

    This isn't an issue in C3. Is it just a bug in C2 that will never be addressed? I brought up this issue years ago, and it's frustrating to see it still here.

  • I was watching one of your streams back, and noticed that you read what your streamlabs chatbot says (notifications).

    As far as I can tell, we should be able to listen out for subscriptions or cheers without the use of an external program.

    Also, as my code is hosted online, rather than offline, I can't use tmi code.

    Without this, we can't realistically create Twitch games that allow donations and the like.

  • Can I ask how you go about checking for bit donations, follows, subs, etc?

    My current code breaks down each sentence into words and feeds those words into a separate array. It will then look for key words in certain positions in the array to determine what it is doing.

    Also, I know what the secret code is for. It allows you to use a bearer token instead of a client-id. This allows you to run 300 checks a minute instead of just 30.

    I'm currently trying to figure out how to make use of api.twitch.tv/helix/webhooks/hub

    Yeah, I'm using helix for all of my stuff instead of kraken, but I can't figure out what scopes are, nor do I understand webhooks.

    I also use websocket to connect to "wss://irc-ws.chat.twitch.tv:443" as my code requires that I read the chat for key words and commands, however, the Twitch API suggests that I ALSO connect to "wss://pubsub-edge.twitch.tv". I'm not sure I CAN connect to more than one at a time.

    This https://dev.twitch.tv/docs/api/webhooks-reference/ unfortunately means very little to me. You're correct in saying that their documentation is a quite poor.