Reading off from a large .txt file

0 favourites
  • 3 posts
From the Asset Store
Convert multiple Excel files into JSON files and import them into construct3.
  • Hi, I'm currently making a rythm game with mechanics similar to Stepmania and DDR. I want construct to be able to load a .txt file, read it line by line, and execute commands based on the last 4 digit number it analyzed.

    I have uploaded the .txt file to the "files" folder, but I'm having a hard time getting ajax or xml to access it. Would someone kindly explain to me how to access a text doucument in the "files" folder?

    Also, does anyone have any advice on how to once per tick make Construct scroll one line down in this .txt file, and output the value of the 4-digit number it just analyzed?

    If I nail this I got all the core mechanics down for my game project. Any help would be very appreaciated!

    -Tinimations

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's an example of both loading a project file via Ajax, and displaying 1 line of it at a time. I load the file's data into an instance variable, but it could be loaded into an array, or other type of object depending on your objective.

    Annotated Capx

    Also, if you're making a timing based game, I recommend you don't base the timing on the game's frame rate as it can vary. You're better off using a "Ever X seconds" condition rather than "Every Tick".

  • Thanks you very much! Will definately check it out!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)