Boolean switcher

Right now I am trying to make a button that you can touch and it changes the image and when it is touched again it switches back, the way i have it set up is that if touch is released and if the button is not already true then make it true, that works fine, but then when I add in the next rule for turning it back off, which is false, it does not work anymore, is there any command that just switches booleans? For example, if it would just say change attribute "game.boolean" to the other true or false

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Change Boolean to not(Boolean)

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Use the mod function. I have a video on it. Click the Guru link in my signature.

  • ncarlson29ncarlson29 Member Posts: 17

    Very helpful video @Lost_Oasis_Games thank you!

  • tmanntmann Member Posts: 278

    or
    Change switch to 1-switch

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2015

    @tmann said:
    or
    Change switch to 1-switch

    He is using a boolean, so 1-boolean won't work, but change switch to not(switch) effectively does the same thing as 'change switch to 1-switch'.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @Socks said:
    He is using a boolean, so 1-boolean won't work, but change switch to not(switch) effectively does the same thing as 'change switch to 1-switch'.

    I think My video many have convinced him to use and integer ;)

  • ArmellineArmelline Member, PRO Posts: 5,407

    @Socks said:
    Change Boolean to not(Boolean)

    If all the button does is switch between two states, then this is the correct answer. Anything else is just overcomplicating matters. There is no faster, easier or more efficient way of doing it than this.

    I'm not sure why the method you were originally using didn't work, though - it should do if you've done what you've said. But @Sock's suggestion is a better way of doing it, anyway.

  • tmanntmann Member Posts: 278
    edited October 2015

    @Socks said:
    He is using a boolean, so 1-boolean won't work, but change switch to not(switch) effectively does the same thing as 'change switch to 1-switch'.

    I never mentioned booleans your honour, was merely chucking out an alternate method :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2015

    @tmann said:
    I never mentioned booleans your honour, was merely chucking out an alternate method :smile:

    Guilty as accused, send him down, Timer: for 10 years.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2015

    @Armelline said:
    But Sock's suggestion is a better way of doing it, anyway.

    It's not suprising you'd think that considering I stole the method from you :wink:

  • ArmellineArmelline Member, PRO Posts: 5,407

    @Socks said:
    It's not suprising you'd think that considering I stole the method from you :wink:

    I stole it from someone else, I don't remember who though!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    @Socks said:
    It's not suprising you'd think that considering I stole the method from you :wink:

    @Armelline said:
    I stole it from someone else, I don't remember who though!

    Hmmm.... I wonder who that could have been? ;)

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @RThurman said:
    Hmmm.... I wonder who that could have been? ;)

    Lmao

  • ArmellineArmelline Member, PRO Posts: 5,407
    edited October 2015

    I'm afraid it wasn't you, @RThurman, I'd have remembered that :D I remember being surprised by the person I learned it from, but I don't remember who it actually was :D I think @ORBZ might have been the first to mention it, but I first saw someone else post about it (after @ORBZ's post, though).

  • Thunder_ChildThunder_Child Member Posts: 2,343

    Just to slim the list down a bit...it wasnt me. :wink:

  • SocksSocks London, UK.Member Posts: 12,822

    @Thunder_Child said:
    Just to slim the list down a bit...it wasnt me. :wink:

    not(Thunder_Child)

  • Thunder_ChildThunder_Child Member Posts: 2,343

    @Socks said:
    not(Thunder_Child)

    Oh no you did NOT just grammar nazi me... :smiley:

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2015

    @Thunder_Child said:
    Oh no you did NOT just grammar nazi me... :smiley:

    Not grammar nazism just a self-referential post modern lexiconic mobius-esque meta-notion, I think.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited October 2015

    @Armelline said:
    I'm afraid it wasn't you, RThurman, I'd have remembered that :D I remember being surprised by the person I learned it from, but I don't remember who it actually was :D I think ORBZ might have been the first to mention it, but I first saw someone else post about it (after ORBZ's post, though).

    You are completely correct!
    @Orbz introduced the use of not(). Unfortunately @Orbz edited the original example and took it out. But here is close to the spot where he first mentions it:
    http://forums.gamesalad.com/discussion/comment/398408/#Comment_398408

Sign In or Register to comment.