User Tag List

Results 1 to 8 of 8

Thread: Events Not Working Right

  1. #1
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Events Not Working Right

    Shouldn't these events alternate the hidden cursor variable each time the button is clicked?

    thingy.png

    It changes from 1 to 0 the first time I click it. But it never changes back to 1.

    Thanks.

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    No, it's like I explained before - MMF2 processes events one line at a time, so it executes the actions on the first line before it tests the conditions on the second line.

    MMF2 starts with the first line:
    Hide_Cursor = 0, and the player has just clicked, so the action is triggered - that means Hide_Cursor is set to 1.

    MMF2 then moves on to the next line:
    Hide_Cursor = 1, because we just set it to 1 in the last event, so the action is triggered - that means Hide_Cursor is set to 0 again.


    Instead, you could toggle a flag, or you could switch a value back and forth between 0 and 1 like this:

    + Player clicks
    -> Set Hide_Cursor to Abs(Hide_Cursor - 1)

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I explained this problem HERE and also best solutions / workarounds. Francois has a very clever solution.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Yeah I always used the toggle flag method until I found that solution on the boards where you can just subtract 1 from the value to get either 0 or 1.

    I think flyoffacliff's issue is that they are thinking the two red events are only triggering 1 event per loop instead of both in order. It might be the red text throwing them off, but the red text merely indicates those events are triggered first/immediately. It doesn't mean they can't be all triggered in one loop. It's the same as just having two events like:

    Value = 0
    - Set value to 1

    Value = 1
    - Set value to 0

    The value will always be 0 at runtime.

  5. #5
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    No, it's like I explained before - MMF2 processes events one line at a time, so it executes the actions on the first line before it tests the conditions on the second line.

    MMF2 starts with the first line:
    Hide_Cursor = 0, and the player has just clicked, so the action is triggered - that means Hide_Cursor is set to 1.

    MMF2 then moves on to the next line:
    Hide_Cursor = 1, because we just set it to 1 in the last event, so the action is triggered - that means Hide_Cursor is set to 0 again.


    Instead, you could toggle a flag, or you could switch a value back and forth between 0 and 1 like this:

    + Player clicks
    -> Set Hide_Cursor to Abs(Hide_Cursor - 1)

    Oh sorry, I did not really understand when you explained it before. I did not ask for clarification because I did not want to sound like an idiot and/or waste your time. I understand why it was not working now, but as for solutions...
    Option 1 - Toggle A Flag: That would work, but I need it to be global so it can be read on another frame, and flags are not global. So I would have to toggle the flag, and then set the flag to a global value. This would work, but its kind of a hassle for something so simple.
    Option 2 - Use "Set Hide_Cursor to Abs(Hide_Cursor - 1)": This seems to work, but I am not sure how. What does "Abs" mean? And the -1? I changed it to Abs(Hide_Cursor-5), and then it back and forth between 1 and 4.

    Thanks a lot.



    Quote Originally Posted by Ryan View Post
    I explained this problem HERE and also best solutions / workarounds. Francois has a very clever solution.

    Thanks. But I don't really understand that, and it seems more complicated than MuddyHole's suggestions. But I will save it for future reference. Thanks.



    Quote Originally Posted by Konidias View Post
    Yeah I always used the toggle flag method until I found that solution on the boards where you can just subtract 1 from the value to get either 0 or 1.

    I think flyoffacliff's issue is that they are thinking the two red events are only triggering 1 event per loop instead of both in order. It might be the red text throwing them off, but the red text merely indicates those events are triggered first/immediately. It doesn't mean they can't be all triggered in one loop. It's the same as just having two events like:

    Value = 0
    - Set value to 1

    Value = 1
    - Set value to 0

    The value will always be 0 at runtime.

    Okay, thanks. I understand now.

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Abs() means "Absolute Value" which just means the value is always positive... So if you did Abs(-5) then the returned number would be 5.

    So with "Abs(Hide_Cursor - 1)" if Hide_Cursor is 0, then Abs(0-1) would return be Abs(-1) which returns 1. If you then have Hide_Cursor as 1, then Abs(1-1) would return 0.

  7. #7
    No Products Registered

    Join Date
    Feb 2013
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Konidias View Post
    Abs() means "Absolute Value" which just means the value is always positive... So if you did Abs(-5) then the returned number would be 5.

    So with "Abs(Hide_Cursor - 1)" if Hide_Cursor is 0, then Abs(0-1) would return be Abs(-1) which returns 1. If you then have Hide_Cursor as 1, then Abs(1-1) would return 0.

    Cool! I get it now! Thanks a lot!

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    ...Although Francois's method (1-Hide_Cursor) does exactly the same thing and is a bit simpler (don't know what I was thinking really )

Similar Threads

  1. OUYA controller events not working as they should?
    By Diablohead in forum Android Export Module Version 2.0
    Replies: 5
    Last Post: 29th June 2013, 08:49 PM
  2. [bug b28] Timer events not working?
    By StingRay in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 14th May 2012, 03:44 PM
  3. What would make overlap events stop working?
    By JohnC in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th October 2010, 07:04 PM
  4. Events not working at all.
    By pikzilla in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd April 2009, 06:08 AM
  5. Layer Problems and events not working
    By Sabata24 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 2nd August 2008, 01:32 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
  •