LoobyLoo's Recent Forum Activity

  • Hi oosyrag, I'm still learning the loop part. Could you please be more specific?

  • I'm simplifying my question now. This differs from my initial query in this thread. Rather than starting a new thread, I'm posting it here.

    The logic I applied here is to create buttons, place them dynamically side by side with padding, and adjust their positions according to the base. The aim is to center their alignment in real-time, similar to how we handle the text alignment, but here, instead of text, it is the sprite.

    Please download the C3P file and preview it. This will make it easier for you to understand what I'm trying to say.

    The below code I've written is functioning,

    I attempted it using a function, but it didn't work

    Also, this part

    Is there a way to further simplify this? Currently, for each of the n numbers of buttons, I need to apply the compare logic separately. Is there a more efficient approach?

  • Okay.

  • I encountered a bug in C3 while saving the project. I had an image named "SpriteTest" in C3, which I then renamed to "EnemySprite" directly within the layout. After making some changes in the event sheet, I hit the save button, waited a few seconds for the save to complete, committed it to git, and then shut down my machine. However, today when I opened the project, I was greeted with the following error message:

    "Failed to open project. Check if it is a valid Construct 3 folder project."

    I pressed F12 to open the browser console and found something interesting. The sprite "EnemySprite" (the one I renamed from "SpriteTest") wasn't saved, and I encountered this error:

    "projectResources.js:583 Failed to read file 'images\enemysprite-animation 1-000.png': DOMException: A requested file or directory could not be found at the time an operation was processed."

    I quickly verified the git commit and the project folder. I was confirmed that the "EnemySprite" sprite wasn't saved. The previous "SpriteTest" sprite was still present in the images directory.

    After renaming the old sprite to "EnemySprite," the event sheet updated with all the relevant code involving the "EnemySprite." However, upon saving, C3 didn't update the image directory but saved all the changes in the layout and event sheet. When I examined the git commit history, I confirmed that "layout.json,", "eventsheet.json,", "project.c3proj," and "project.uistate.json" were all updated, yet there was no indication of "SpriteTest" being renamed to "EnemySprite."

    When attempting to replicate the issue, I couldn't do so. It seems to be random, but I stumbled upon a community post where people faced the same problem.

    I'm asking the more experienced users: Have any of you faced this before? Can it be avoided? Since it's not easy to recreate, fixing it might be tough for the C3 team. But if anyone manages to reproduce it, please report the issue.

    By the way, Thanks to DOP2000. His post literally saved my project from corruption.

    Edit: Someone in GitHub posted a similar bug (the error occurred when the layer is deleted).

    Tagged:

  • Hi, Have you got the solution?

  • Wow, I never thought this would work this way, Thanks!

  • Thank you for the detailed explanation! :) Now, I understand.

    Edit: Event sheets don't store arrays...? You're definitely misunderstanding something.

    😅 No, what I meant to say was about the Array Code, as shown below.

    + System: On start of layout

    -> AJAX: Request MY_JSONArray.json (tag "My_Array")

    + AJAX: On "My_Array" completed

    -> My_Array: Load from JSON string AJAX.LastData

  • 😅 Okay

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I do not understand your situation. Arrays are global. It doesn't matter what event sheet you refer to it from.

    Is it mandatory to place any action that depends on or fetches data from an array after this particular action?

    + AJAX: On "My_Array" completed

    -> My_Array: Load from JSON string AJAX.LastData

    If the answer is yes, then I've been mistaken all along, because I consistently store my arrays in a separate event sheet named "Array," without mixing them with any other code. :/

  • If I may, could you please assist me with this?

  • But in some cases, the array is stored in a separate event, and we need to call it from a different event sheet. In such situations, what is the recommended approach?

  • I have a particular function/action that I need to call multiple times, say x times. While I can manually achieve this by creating a button and clicking it x times, how can I set up a loop to accomplish the same?

    Tagged:

LoobyLoo's avatar

LoobyLoo

Member since 10 Jul, 2023

Twitter
LoobyLoo has 1 followers

Trophy Case

  • 1-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

6/44
How to earn trophies