User Tag List

Results 1 to 6 of 6

Thread: Need help with random counter with reference to a paragraph in a string

  1. #1
    Clicker Fusion 2.5

    Join Date
    Nov 2015
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with random counter with reference to a paragraph in a string

    Hey Guys,

    I have this counter that I set at Random(5)
    I also have a string with 6 paragraph
    At one point in the program I am setting the string to display the paragraph associated with the random counter value: "paragraph$( "MessagesList", value( "Hasard" ) )"

    If I do that, the string displays the paragraph next to the chosen value (eg. if random(5) = 3 then paragraph = 4

    So I changed the formula in order to assign the string to the random value minus one: "paragraph$( "MessagesList", value( "Hasard" ) - 1 )"

    In this case most of the time the good paragraph is displayed except in the one instance where the counter has a 1 or 0 value. In both case the first paragraph will be displayed.

    My assumption was that the default association should have been like this:

    random = 0 then para = 1
    random = 1 then para =2

    and so forth

    Can anyone help me figure this out?

    Regards

    Mike

  2. #2
    Clicker Fusion 2.5

    Join Date
    Nov 2015
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any hypothesis to suggest on my issues folks? I need a little help here.

    Thanks in advance

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    String paragraphs are 1-indexed
    so paragraph count will start from index 1


    <= 0 : no match
    1 : first paragraph
    2 : second paragraph
    and so on

    You should set the string to Random(6) +1

    because random(6) will give you a random number ranging from 0-5

  4. #4
    Clicker Fusion 2.5

    Join Date
    Nov 2015
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for the info schrodinger. I will go from there


  5. #5
    Clicker Fusion 2.5

    Join Date
    Nov 2015
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One more thing... In the value is 0 I take it that no paragraph should be selected right?

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I think so, (from memory) when you set a non valid index it should remain the last one you've set,
    but give it some testing to be sure

Similar Threads

  1. Set Edit Box to String Paragraph
    By Brosephus in forum Fusion 2.5
    Replies: 1
    Last Post: 21st August 2016, 02:59 AM
  2. Number of a paragraph based on a counter
    By ffomega in forum Fusion 2.5
    Replies: 1
    Last Post: 11th March 2016, 10:29 PM
  3. Replies: 3
    Last Post: 18th November 2015, 11:35 PM
  4. Trigger events with string paragraph?
    By Warmachine in forum Fusion 2.5
    Replies: 4
    Last Post: 8th July 2015, 07:27 PM
  5. Paragraph in string
    By pnekdo in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 21st March 2010, 09:54 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
  •