Toggle button events

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I have two events:

    1) Condition

    Button (btConnect) clicked
    +(btConnect) internal flag 0 is off

    1) Action

    (btConnect)
    Change Text to "&Disconnect"
    Set internal flag 0 ON


    2) Condition


    1) Condition

    Button (btConnect) clicked
    +(btConnect) internal flag 0 is on

    1) Action

    (btConnect)
    Change Text to "&Connect"
    Set internal flag 0 OFF


    Why is this not working? It was two different clicks on the button. The "Only one action when event loops" condition will not make it work properly and it doesn't matter what I do.

    How can I simulate a toggle button event like the one above?
    Thanks.

  • All you have to do is make a counter and when they clik the button to turn the flag on, keep adding to the counter until it's like 5. And if the counter is five and they click to turn the flag off, keep subtracting from the counter until it's 0, and then they can press the button again. That's all I can think of right now. Sorry if I'm not very clear. ;)

    Working as fast as I can on Fusion 3

  • It's not working because MMF2 reads the events from top to bottom. As soon as the condition (flag is 0) has triggered, the flag is now 1 and the condition (flag is 1) will trigger :)

    I made the "Condition ID restriction" object to tackle this problem- you can find it in the Released extensions forum.

  • Thank you. It may work.
    As a workaround, I made a Disconnect button at the same position of the Connect button and when I click on one of them I hide the other.

    But I wonder if the problem I mention won't affect event-driven applications rather than games. Sometimes, depending on the order of the conditions I get different results. If I have an event with 4 or 5 conditions, sometimes MMF will evaluate only the first.

    Are there any docs about the inner working or condition priority rules of the MMF2 engine? I'd really like to be familiarised with the engine.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!