Anything in F2.5 thats like the old Read/Data?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • In my quest to learn this package I decided to make a few programs. One of those programs was to do with enemy waves and how to make them.

    What I wanted to do was to use something like Read-Data statements found in other languages.
    For those of you who dont know what Im talking about here is a simple "Basic" loop:

    For t = 1 to 20
    Read x
    Print x
    Next t
    End
    Data 1,1,0,4,9,8,3,5,6,7,23,1,4,6,8,3,2,8,8,9

    I know that Read-Data is NOT in Fusion, so I wanted to make a txt file that holds the type of enemy and then to read that txt file in and depending on the number found to put the correct enemy ship at the correct X and Y.

    So......... The txt file would look something like this:

    1,320,200,2,300,150,5,100,100........... Etc Etc Etc.... you get the picture!:)

    Now can anyone help me in to how to read in a txt file and then to extract the numbers?

    I know that it may not be possible to use a txt file like the one above with comma's in it, and it may have to look more like this...

    1
    320
    200
    2
    300
    150
    5
    100
    100

    ...to be able to read each number set individually.

    But any help would be very much appreciated...thanks in advance :)

  • You can! I use the List object for this, which has a visual component but you can turn it off and use it as data storage instead. It has the ability to load files from disk - you can either load a straight list in like your second example and read it line by line, or use something like the String Parser or String Tokenizer object to split each line into data elements and then read them that way.

    Please login to see this link.
    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!