User Tag List

Results 1 to 3 of 3

Thread: Picking Random Object Problems

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Picking Random Object Problems

    Hello. I am new to the forums and somewhat adept at MMF2. I just have a problem. I have poked around the program for about 9 days now trying to figure out how to do it. I am making something somewhat like a "Random Sentence Generator". My problem is, I need it to select a sentence at random, but I have more than one different sentence. Here is what it looks like:

    "String 9: This is an example."
    "String 10: This is also an example."
    "String 11: This is again, an example."

    When I click the button I have it needs to pick one of those Strings at random to be put onto the screen. My problem is, is there a way to make them all titled "String 9" (or whatever, doesn't matter) but have different sentences so it could "Pick "String 9" at random?
    i.e.

    "String 9: This is an example."
    "String 9: This is also an example."
    "String 9: This is again, an example."

    The problem is, when I changed their title to "String 9", all the text turn to the same thing like so:


    "String 9: This is an example."
    "String 9: This is an example."
    "String 9: This is an example."

    and not:

    "String 9: This is an example."
    "String 9: This is also an example."
    "String 9: This is again, an example."


    Is there a way to fix that? If not, I tried thinking of a Plan B sort of say where it "Picks an object at random within a specified zone." Is there a way to do that? Now, the objects are not the same. It's this:

    "String 9: This is an example."
    "String 10: This is also an example."
    "String 11: This is again, an example."

    Is there a way to pick one of those strings at random to be put on the screen?

    Please help. And I apologize if I sound like a noob or if there are already posts made for this problem or the answer is so easy I didn't even need this help. Thank you!

  2. #2
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hope I'm understanding you. Sounds like you can accomplish this with one string.

    Add a new string object and you'll see "Paragraph 1: Text" in the Properties toolbar. Add as many new paragraphs as you want for all your sentences. Then add your button.

    User clicks button:
    ->Set paragraph to Random(3)+1

    Strings are funny in that they're base 1 when most number value calculations are base 0, so make sure you stick that +1 in the code or you won't display all your strings.

    Then when you wanna go a little more advanced:

    User clicks button:
    ->Set paragraph to Random(npara( "String" ))+1

    npara stands for Number of Paragraphs. This way you can add or remove paragraphs without changing your code.

  3. #3
    Clicker Fusion 2.5 (Steam)

    Join Date
    Aug 2014
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh I see. Ok. I will test it when I have the chance. Thank you!

Similar Threads

  1. Picking more than one object at random?
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 17th September 2010, 03:37 PM
  2. need help with picking an object
    By method72 in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th September 2009, 01:31 AM
  3. Picking only one object during overlap
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th June 2007, 01:46 PM
  4. Object picking is still disfunctional...
    By Maggott in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 16th February 2007, 06:30 AM
  5. picking an object at random from a restricted zone
    By Larry in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th December 2006, 10:32 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
  •