Reading levels on different external files in the same layou

0 favourites
  • 3 posts
From the Asset Store
Convert multiple Excel files into JSON files and import them into construct3.
  • Hi there!

    I'm making a puzzle game that requires lots of levels (around 100 or even more), but all of them have the same basic objects. I could make all the levels manually in different layouts, but it would be much better (and easier) if I could dinamically create levels by reading a .txt file for example, each file for a level. The idea is having only one layout that could handle all stages and loading them using a variable. I tried using AJAX to do this and it works fine, but I can't load a file using a variable's name I guess.

    The idea is that I have a "level select" layout, let's say with 3 levels. All the levels go to to the same "game" layout, but setting a global variable when selected. Then, at the start of the "game" layout, I'd use the variable to know which .txt file I'd open (001.txt, 002.txt, 003.txt, etc) and then I'd create the level using the content of the file.

    The problem is using the global variable name and opening the correct .txt file. Any ideas? Or better solutions?

    Thanks in advance!

  • [quote:ddxkis5r] ...but I can't load a file using a variable's name I guess

    How do I dynamically change the name of a XML file.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks!

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