User Tag List

Results 1 to 4 of 4

Thread: Help with some logical troubles

  1. #1
    No Products Registered

    Join Date
    Jun 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with some logical troubles

    Hello, I'm new on this forum. If this post isn't in the right place, so sorry!

    I'm having trouble with a event that allows the "Player" to choose 02 different chars with the same button "ENTER".
    In my app I have a cursor that swipe between the avaliable chars on the screen, and if the player press ENTER the NAME of the char is saved in a
    global string (for now, after this will be in a .ini), and then the player is allowed to choose the second char that will have the NAME saved in another global string.

    I know that is a little confused (and sorry, i'm brazillian and new in MMF)

    The code is like this:

    When the cursor is on CHAR AAA

    Upon pressing "ENTER"
    + Player = 0
    Set CHAR01 = "AAA"
    Set Player = 1


    Note:
    Player is a Global Value
    CHAR01 is a Global String
    CHAR02 is a Global String

    Now, the cursor is on CHAR BBB

    Upon pressing "ENTER"
    + Player = 1
    Set CHAR02 = "BBB"
    Set Player = 2


    Note: I set Player to 2 to prevent the player enter again the this condition


    But the problem is when I press enter the first time the global string CHAR01 e CHAR02 receive the same string of the first char selected.
    like CHAR01 and CHAR02 = "AAA"
    I wanna know how I can do this the right way

    I only want a way that I allow the player to select char AAA with enter, and after select char BBB with the same enter, and I can work with these names in a global string or ini.

    Can anyone help me...
    Thanks!

  2. #2
    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)
    If there are only these two choices (1 & 2)
    to be strictly performed in this sequence and just once,
    you could try inverting the event order:


    Upon pressing "ENTER"
    + Player = 1
    Set CHAR02 = "BBB"
    Set Player = 2


    Upon pressing "ENTER"
    + Player = 0
    Set CHAR01 = "AAA"
    Set Player = 1


    May sound silly, but fact is that events are checked and performed top to bottom,
    so in previous setting, if you set "Player" to 1 in one event,
    and check if player=1 in the following event
    both actions will be performed in the same frame (at the same time)
    while if you invert order
    the "enter" press will trigger only the second condition inside a single frame cycle,
    and the first in following cycles
    (at least, if I got correctly what you're doing)

    If this doesn't work, a sample .mfa may help us pinpoint the issue more successfully

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have experienced this type of behavior, because when you hit enter, even though you tap it once, the computer is rapidly checking that and it will count it as being pressed many times. To get around this, i usually use a timer event to help me out.

    For example,

    Upon pressing "ENTER"
    + Player = 0
    Set CHAR01 = "AAA"
    Set Player = 1
    Set ENTER_TIMER =0

    Add 1 to ENTER_TIMER

    Upon pressing "ENTER"
    + Player = 1
    + ENTER_TIMER>30

    Set CHAR02 = "BBB"
    Set Player = 2

  4. #4
    No Products Registered

    Join Date
    Jun 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks both solutions Schrodinger and Rubes ... They work fine!

Similar Threads

  1. Logical NOT operator
    By SuperDisk in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th September 2016, 11:56 AM
  2. Possible logical OR bug?
    By mobichan in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 20th January 2012, 01:25 PM
  3. Possible logical OR bug?
    By mobichan in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 18th January 2012, 02:57 PM
  4. Difference between OR and OR (Logical)
    By wizkidweb in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th September 2009, 12:19 AM
  5. logical NOT
    By kornelijepetak in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 15th November 2007, 08:24 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
  •