User Tag List

Results 1 to 4 of 4

Thread: Read/Load paragraphs from text file?

  1. #1
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Read/Load paragraphs from text file?

    While I'm familiar with load & save with INI, I am more looking for a way for a script to load multiple lines at once from a certain text file. In other words, act as an external paragraph format. INI seems to load only 1 line of text/values, which doesn't seem to work in the way that I want to my knowledge.
    Perhaps a way for the new text to replace the current string of paragraph with a new paragraph from a file.

    Also, I am using a custom text blitter script for this, so the fonts/text will eventually become graphics in the end, if that changes anything.

  2. #2
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    166
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    If you store the entire paragraph as one big string and replace each line break with a special character like "/" or "*", you can load the string back in using the INI object, and then use the substring object to replace each character with a line break again. The substring object is Windows only though if that's a concern, and particularly long strings might be an issue.

    Here's a short demo:
    substring example.mfa

    Depending on what you're doing with the text, you could also use a fast loop to load in multiple lines of the INI file and store that in a string object (or multiple string objects using something like qualifiers)

  3. #3
    Clicker Fusion 2.5Android Export Module

    Join Date
    Sep 2010
    Posts
    537
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Maybe I misunderstand you now but can't you load the text file to a listobject and then call which line to display? I do it for dialogs. A simple string object to always display the current line of the listobject

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    The only thing I found close to what I wanted to do for my idea is by using an object called Textfile object. However, it doesn't seem to work on some exporters.

    Basically, the Textfile object does indeed do what I want, though I was trying to find an alternative that could potentially work for all export modules. Or at least most of them if not all, anyway, I guess?

Similar Threads

  1. Replies: 2
    Last Post: 14th October 2018, 08:00 AM
  2. Replies: 0
    Last Post: 11th June 2015, 03:54 PM
  3. How do you load a CSV file in mmf and read from it?
    By blurymind in forum Fusion 2.5
    Replies: 15
    Last Post: 21st March 2015, 02:43 PM
  4. How can I read the contents of a text file?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 3rd October 2011, 03:51 PM
  5. [Request] Read x lines from huge text file
    By Richard_Pikk in forum Extension Development
    Replies: 6
    Last Post: 21st May 2009, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •