0 Favourites

Large .txt files

  • Hello guys, big C2 fan here. Little help needed. I'm working on a �My Collection� type of app. Every item has like a 3 page description in a .txt file which I need to load when I click on item.

    If I Use the Ajax request it prompts me to select .txt file manually from a list of project files which doesn't help.

    The CSV table loads just fine and I tried storing �item1.txt,item2.txt,...,itemN.txt� then parse the table and load ".txt" value as a variable but I can't use said variable to �load from URL�

    I guess I could paste the text for each item in the CSV table as a value, but multiple pages for each, more than a 100 items, separated by comas just doesn't seem right. And it would be a huge, unmanageable table in the editor, right?

    So, how should I do this? I had the same issue with .jpg image files for the each item and I worked around it, as suggested, by loading them as animation frames but I just can't figure it out what to do for the texts.

    Thanks a lot!

  • Why do you need to select a txt file for your ajax action.

    If you know the filename in the project files, just use a URL request like "item1.txt". Or if you dynamically want to go through all elements, you could use "item"&variablenumber&".txt" as filename and change the variablenumber each time.

    I'm not sure where you are stuck, especially since you bring up csv.

  • If you're using Ajax my suggestion would be to just have a PHP script serve the text you want.

  • mindfaQ:

    Thanks for reply. I can't find "load from URL" for .txt files. I only have that option when loading images. Also Ajax prompts me to a list of set project files to choose from manually. I want the user to be able to click on item and bring up the text description of item in new layout.

    nusbaumc:

    i have no idea what that is but i will look it up right now. Thank you!

    Edit: It looks like PHP works with mysql and seems quite complicated for something like bringing up a text from a project file. Oh, and i dont know if it's relevant but my app needs to work offline.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I use php a lot, and it could easily do what you want (it is not just for mySql), although it does require a web server - so I guess that is not the way for you to go.

    Keep reading through the manual - I am sure there is a fairly easy way to do it!

  • xum - just use 'Request URL' instead of 'Request project file', and enter a filename based on an expression.

  • Ashley

    Thanks, that worked like a charm. And wow! Thanks for taking time to answer such a beginners question. I wish you all the best!

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