User Tag List

Results 1 to 2 of 2

Thread: Comparing more than 2 global values

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2013
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Comparing more than 2 global values

    I'm trying to do a questionaire currently. I have set up one page to ask the questions, and another page to give the results.

    The first page asks many questions with 4 answers to each question. Each answer adds one point to one of the 4 named counters. After all the questions are completed, the counters are stored to 4 Global Values, which will be brought over to the next page

    Now, the tricky part happens. I must compare the 4 values all at once. There doesn't seem to be a default condition for this, nor does there seem to be a plugin/extension that will do this.

    I don't really know how to set this up.

    The basic idea is this:

    The Global Value with the highest value is selected.
    However, if there is a tie in global values, a new question will be asked, adding 1 to one of the 4 counters
    If a tie still occurs, another question will be asked, adding 1 to one of the 4 counters
    If a tie is still occurring (by this time, all 4 counters will equal the same value), a final question will be asked, with an answer that will add one to one of the 4 counters, ending the tie once and for all.
    Thereafter, a game piece that resembles your traits will be selected for you based on the answers you have selected.

    This is part of the code (but cannot be programmed in this fashion)

    Compare the Global Values R, L, S, AND M
    If global value R is greater than Global Values L, S, AND M, set Global String A to "R"
    If global value L is greater than Global Values R, S, AND M, set Global String A to "L"
    If global value S is greater than Global Values R, L, AND M, set Global String A to "S"
    If global value M is greater than Global Value R, L, AND S, set Global String A to "M"
    Else, break the tie with a new question
    Repeat above.

    I am hoping someone can enlighten me on how to program this.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS 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
    Jun 2006
    Location
    England
    Posts
    3,511
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Not elegant, but one way to do it is something like:

    [EVENT 1]
    On loop "check"
    - Set Global String A to ""

    [EVENT 2]
    On loop "check"
    + Global Value R is greater than L
    + Global Value R is greater than S
    + Global Value R is greater than M
    - Set Global String A to "R"

    [EVENT 3]
    On loop "check"
    + Global Value L is greater than R
    + Global Value L is greater than S
    + Global Value L is greater than M
    - Set Global String A to "L"

    [EVENT 4]
    On loop "check"
    + Global Value S is greater than L
    + Global Value S is greater than R
    + Global Value S is greater than M
    - Set Global String A to "S"

    [EVENT 5]
    On loop "check"
    + Global Value M is greater than L
    + Global Value M is greater than R
    + Global Value M is greater than S
    - Set Global String A to "M"

    [EVENT 6]
    On loop "check"
    + Global String A is ""
    - Ask tiebreaker question
    .:::.Joshtek.:::.

Similar Threads

  1. Question: Comparing Hash values
    By Hydra in forum Fusion 2.5
    Replies: 1
    Last Post: 5th March 2015, 01:04 AM
  2. Is comparing values faster than comparing strings?
    By Erkabubben in forum Fusion 2.5
    Replies: 9
    Last Post: 13th January 2015, 11:36 AM
  3. comparing values on overlap
    By itsa_doozy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th March 2013, 06:19 PM
  4. [BUG] PROBLEM COMPARING FLOATING VALUES
    By Fernando in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 6th August 2011, 05:40 PM
  5. Comparing 2 global values question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th January 2009, 04:23 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
  •