ekitabi1129's Recent Forum Activity

  • Thank you for your response.

    When I checked using the debugger tool, it was displayed just as in the example you provided.

    The issue has been resolved.

    Thank you so much for your help this time!

  • Both of you, thank you very much for your detailed responses.

    Where do you see this? Check in the debugger, I bet the values in JSON are all correct.

    Regarding this, as shown in the attached image, I tried displaying it as text on the screen.

    As a result, it shows:

    {"score_table":{"id":1,"position_x":"0","position_y":"0","boss_counter":"0"}}

    I have a thought about why the parent key name in the JSON is score_table, as in the above result.

    Before running this code, I parsed a JSON string named "score_table" using

    Parse JSON string AJAX.LastData.

    Could this be having an effect?

    By the way, when I input set text to position_x to display the text, it correctly shows "2025".

    Apologies for the repeated beginner-level questions.

  • Thank you for your response.

    I apologize for asking so many basic questions due to my lack of knowledge.

    I will look into how to use Firebase with Construct.

    Regarding JSON, I have a question.

    When I added variables to JSON as shown in the example you provided, the numbers all turned into 0.

    Specifically, it looks like this:

    json

    {"score_table":{"id":1,"position_x":"0","position_y":"0","boss_counter":"0"}}

    All values after id are written as 0.

    However, the variable position_x is not actually 0.

    I confirmed that a number was correctly assigned to position_x at the stage when it was being set into the JSON.

    Yet, it still appears as 0 in the JSON output.

    Additionally, username (String type) is not written in the JSON either.

    Do you know what might be causing this?

    Thank you as always!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would like to use AJAX to pass in-game data to PHP and save it in a database.

    However, I don't know how to structure the in-game data as an array.

    The ideal format would look something like this:

    {"score":{"id":1,"position_x":"0","position_y":"0","boss_counter":"0"}}

    I tried implementing it as shown in the attached image, but the variables are not being populated correctly (debugging shows them as empty).

    Additionally, I am unable to set custom names for the keys (only numbers starting from 0 are used).

    If anyone knows how to solve this, I would appreciate your help!

    Tagged:

  • I was able to successfully reflect the data obtained in the game!

    Thank you for your detailed explanation regarding the conversion to numeric types as well.

    My concerns have been resolved, and I’ll continue enjoying game development!

  • I apologize for asking such a basic question.

    Using AJAX, I obtained the following array data:

    {"score_table":{"id":1,"position_x":"0","position_y":"0","boss_counter":"0"}}

    I would like to retrieve each piece of data from this array and store it in variables.

    (For example) Store the value 1 from the array into a global variable named id.

    set id to 1

    From what I have researched, I believe I need to use tokenat(AJAX.LastData,,) but how exactly should I proceed to retrieve the data?

  • Thank you for your reply!

    It was the first time I found out that I needed to process it twice.

    thank you for teaching me!

  • Thanks for answering!!

    Sincerely thank.

    In tutorials, I only found things that store numbers such as Score.

    For bool, if stored as 0 or 1, then

    Should I write an if statement that says "if 0 is false, if 1 is true"? ?

  • I want to store a bool value in WebStorage.

    If you save using a dictionary, it will be saved as 0 or 1.

    Is there a way to save true and false to WebStorage?

    Please help.

ekitabi1129's avatar

ekitabi1129

Member since 4 Mar, 2021

None one is following ekitabi1129 yet!

Trophy Case

  • 3-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

5/44
How to earn trophies