User Tag List

Results 1 to 6 of 6

Thread: Condition based on contents of a string?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module

    Join Date
    Dec 2008
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Condition based on contents of a string?

    I'm trying to make an unlockable feature for a game, which is based on the contents of a file containing a word. I want it to load the file, then read the word, and if there is a specific word, it runs a condition. How can I do this?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Condition based on contents of a string?

    Hmm. Can you explain more about what the file might contain? It's unclear what exactly you're trying to react to. Is this a file that may or may not be there (therefore the result will be "targetword" or nothing), or are you searching in a larger file for a specific word?

    To answer the question in the topic title, you can look at the contents of a string by using the "Compare two general values" condition, and selecting "Alterable string" in the text object as one of the sides of the equation.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export Module

    Join Date
    Dec 2008
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Condition based on contents of a string?

    Okay, the real problem seems to be that I don't know how to load the contents of the file into the program. How do I take the file and put its contents into a string?

  4. #4
    No Products Registered

    Join Date
    Aug 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Condition based on contents of a string?

    You could load the file into an Edit box. Then you could use the "Compare two general values" condition to compare the contents of the file with another string.

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Condition based on contents of a string?

    Quote Originally Posted by fawfulfan
    Okay, the real problem seems to be that I don't know how to load the contents of the file into the program. How do I take the file and put its contents into a string?
    Probably the best way is the ini++ object (you'll need to encrypt the file so the user can't edit it). or the Associative Array (AssArray) object, also supports encryption. You'll need to download those two objects separately as they aren't included with MMF2. But you have the object load the file, then read the values directly from the ini/array object. Just use the compare two general values and check the item in the ini file and compare it to the string. So, basically, is ini value = to string value? If so, unlock this feature.

    Just to not cause any confusion you use either the ini++ or AssArray objects. You don't use them both. And since these objects hold the values in memory when you load them, you don't need to put anything in an edit box or whatnot.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Condition based on contents of a string?

    If the file has a format you can't control, eg it may have NULL characters, you should use one of the several binary objects.
    Working as fast as I can on Fusion 3

Similar Threads

  1. [bug] String Paragraphs: 0 or 1 based index??
    By Bipolar_Games in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th August 2012, 04:03 PM
  2. contents file.txt in to the "string"
    By daniele in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 19th November 2011, 04:24 PM
  3. 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
  4. Help reading screen contents
    By lembi2001 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 7th May 2009, 04:22 PM
  5. comparing the contents of two listboxes...?
    By ClickerGuy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th October 2007, 02:45 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
  •