LiteSnacks's Recent Forum Activity

  • Hello Nepeo

    If you have the time I was wondering if you might expand a little more on POSTing binary data to a server via AJAX plugin?

    From my research and testing the data is POSTed to a PHP enabled server as an array, however after my different attempts to interpret the data, it all returns an empty array, (& unpacking returns an empty string). Am I missing something?

    Thank you for any help you're able to give :)

  • When you POST Binary Data (image) to a php server via Ajax, where is that binary data placed on the server? do I set the URL to a folder? or a php file that handles the data? I realize this questions is beyond Construct 3 data handling; I just need to be a able to request the binary data back via URL in AJAX.

    Thanks for any help.

    Tagged:

  • AshleyMagistross Works thanks again. Although some images i'm testing w/ simply do not load from the string, and then others do. Is there a reason you can think of why this is happening? All the files are jpg.

    What i'm doing is sending the base64 string via AJAX POST to a .php file which writes the string to a text file. Then requesting the data back w/ a .php file echoing the text file.

    Like I said it works with a couple .jpgs, but not all of them.

  • Ashley Exactly what I was looking for thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the response! I will try that when I get home.

  • There's another thread like this but it's about a year old an the answer wasn't exactly clear.

    How would I go about loading an image via Base64 string from a variable or server side?

    Using the "Load image from URL" and inputting the Base64 string does not work. Is there a formatting issue i'm missing or maybe a step I may have overlooked?

    Thanks for any assistance.

    Tagged:

  • Magistross I know it's been a while but would you be able to expand a little more on the URI format you provided?

    I have the base64 string saved to a var. Would I be able to load from that? Or directly from the Server?

    Thanks

  • I meant to include "https", but the issue ended up being the SSL certificate wasn't properly configured. Thanks for the reply :D

  • I have a solid understanding of how AJAX works. My question is to get help eliminating road blocks I have overlooked; right now AJAX is returning error.

    Here's what my event attempting to "read" a text file looks like:

    Button: On Clicked ---> AJAX: Request "http://fileLocation/textfile.txt

    AJAX: On completed ---> requestStatus.text: Set text to AJAX.LastData

    AJAX: On error --------> requestStatus.txt: Set text to error

    - I do have do CORS authorization on my web server

    My web server is php enabled if that helps out.

    Any thoughts? Thank you in advance for any help :)

    Tagged:

  • try:

    on [shoot button] pressed

    repeat 5 times

    ---> create object (bullet)

    ---> set angle (bullet) to "gun.angle + random(-15,15)"

    this example creates a bullet, then sets its angle to no more than 15 degrees off the direction the gun is pointing. repeated 5 times. a bullet behavior will automatically move the bullets forward the set angle.

  • omg that's perfect, i can't believe using two different rooms for lobby & gameplay didn't cross my mind. Thanks for your input; very helpful.

  • how are your conditions set up?

    if i had to guess, you are having the jump animation begin playing while the jump button is down; like so:

    "[jump key] is down ---> play animation (from beginning)".

    if this is the case, the animation is starting from the top 60 times a second while the jump key is down, & as consequence you are only seeing the first frame; there are many solutions, but here are a couple basic ones:

    1. change "[jump key] is down ---> play animation (from beginning)" to "[jump key] pressed ---> play animation (from beginning)

    2. add a "trigger once while true" condition to "[jump key] is down ---> play animation (from beginning)" condition

    these both accomplish the same task, but option 1 is much better practice.

    hope that helps

LiteSnacks's avatar

LiteSnacks

Member since 16 Jun, 2016

None one is following LiteSnacks yet!

Trophy Case

  • 8-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies