User Tag List

Results 1 to 3 of 3

Thread: Is there a way to load text into string object?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2019
    0 Post(s)
    0 Thread(s)

    Is there a way to load text into string object?

    I wanted to store dialogue in String object. It all works fine, except I have over 1700 paragraphs - adding new ones works very slow and inconvenient.

    I figured a way to export all 1700 paragraphs to separate file using INI. Is it possible to do the reverse thing - upload 1700 paragraphs from file to string?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleUniversal Windows Platform Export Module

    Join Date
    May 2014
    7 Post(s)
    0 Thread(s)
    Have you tried using the String Parser object?

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Boston, MA
    12 Post(s)
    0 Thread(s)
    Yes, but I wouldn't use INI for that. INI loads really slow after it goes past 64kb & 1700 paragraphs of text will take up much more than that.

    First thing I'd do is save each paragraph as a separate TXT file. Then bring in a List object, an Array (string array), an Edit object, and a Counter. In the list object, load the Filelist of the directory with all the paragraph files. While the Counter is lower than the total number of Lines in the list, use the Edit object's "Load Text File" function to load the text from the file at the current list line into it. Then save the text into the edit object to the Array where X=the line number. It's gonna take a while, but just let it do its thing.

    The reason you'll want to do this with a Counter (or alterable value) instead of a Fast Loop is strictly BECAUSE this will take a while and you want to let it do so. If you try to load 100,000 words into an array in a single CPU cycle, the application will crash.

    Once the array is full, you can use the Save Via Selector function to save the file to one that will be accessible in your game. You'll be able to quickly pull the text from the array when you need it. If you want to optimize this a bit, you might think about saving a separate array for each chapter of your game, rather than cramming them all into one file.

Similar Threads

  1. Load string into list object?
    By ratty in forum Fusion 2.5
    Replies: 3
    Last Post: 3rd November 2016, 12:49 AM
  2. Replies: 3
    Last Post: 18th October 2016, 10:09 AM
  3. Set edit box text to string$("string object") causes long delay
    By MJK in forum XNA Export Module Version 2.0
    Replies: 4
    Last Post: 22nd August 2012, 02:58 PM
  4. Text Bug in String object
    By TheOriginator in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th February 2012, 09:11 AM
  5. Hyperlink text in string object?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th October 2011, 06:02 PM

Posting Permissions

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