Best way to load array from external file?

0 favourites
  • 3 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Hello,

    I have a character that is saying a new line every few seconds.  I want to get all the lines into an array and loop through them simply:

    -change text to array.at(x)

    • add 1 to x

    -wait

    Working fine with the first few lines as I have added them to array on layout start.  But instead of adding all the lines on layout start I would prefer to load from an external file for two reasons:

    1) So I can edit the lines without having to republish the project

    2) To not use up a lot of command lines as I am using the free version currently (contemplating upgrade)

    On a previous project I have used Ajax/Php/mySQL for a high scores table and could go that route but thought I could cut out a step using JSON or XML, which I am not as familiar with though.

    Project will be uploaded so external file would be uploaded as well.

    So if you were doing something similar how would you go about it?  If there are good examples please point me to the project files.

    (please note, I prefer not to use plugins)

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • These tutorials might help

    https://www.scirra.com/tutorials/328/us ... onstruct-2

    https://www.scirra.com/tutorials/807/ho ... -game-talk

    also populating an array from json is a way..

  • Thanks LIttleStain! After downloading the zip file on the second link I think seeing that example I will be able to get it accomplished similar to his using xml.

    If anyone else has any comments I'm all ears as I am always trying to learn but I think I'm set on this part.

    LittleStain - I see your profile says you are a graphic designer and love to see your designs become interactive - you have any art I can play with? I'm just trying to make small projects right now to learn all the aspects of Construct and it sure would be more fun if it looked nice as opposed to using red and blue squares or any horrible art I made quickly. If you want to share anything I'll make a game inspired by the art.

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