Using behaviors to turn behaviors on and off.

zefrofzefrof Member Posts: 26
edited July 2012 in Working with GS (Mac)
What behavior or combination of behaviors would allow me to turn other behaviors on and off? (As is the little button before their name)

Comments

  • ORBZORBZ Member Posts: 1,304
    Use a rule
  • zefrofzefrof Member Posts: 26
    What do I put in the rule though?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2012

    Hi @zefrof

    Personally I'm trying to understand what you're after; have I got it right?:

    OK, we can turn on and off any rules/group of rules in the editor by clicking the on/off button; you want to turn rules off and on exactly the same but while the game is running?

    If that's what you're after, for every behaviour or group of behaviours you want to turn off and on, you'll need a boolean attribute which will act as a switch/toggle.

    So, for instance (I'll make this up as I don't know what your actual rules are, of course:

    When touch is pressed
    ---this next bit to add as new--- when Rules1 is true ---- making sure you check the attribute Rules1 in the attributes section to make it true

    Change attribute..
    Timer: After 30 seconds..
    Particles
    etc

    So on-screen, you need a button to switch off those behaviours; in it's rules, put the following:

    When touch is pressed
    --inside the above Rule: when Rules1 is true
    change attribute to false
    otherwise
    change attribute to true

    Any other on/offs you want make other booleans: Rules2, Rules3, etc; and put similar in the buttons on-screen

    PS I've gone and rejected my own answer! How'd I manage that? Hypnotised by the screen...time I took a break soon... ;-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • zefrofzefrof Member Posts: 26
    edited July 2012
    That is what i'm looking for. I'll try it and let you know if it works or not. Thanks.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    If its what you wanted why did you reject the Answer?
  • zefrofzefrof Member Posts: 26
    @tenrdrmer I didn't. Read his post at the end it says he rejected his own answer.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I apologize I didn't read it all.

    @Gyroscope Thats the dangers of being a sous-chef ;)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598


    @Gyroscope Thats the dangers of being a sous-chef ;)
    Heh, so true, Aaron!!

    Or the benefits.... just think....we can reject ALL of our own answers if we wanted! The power!!!

    (No, I don't know what I'm on about either...) :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Or we can just accept our pointless answers just in a fun Thread jacking sort of way. Mwahahahahaha
  • zefrofzefrof Member Posts: 26
    I got everything to work! Thanks you so much for your help!
Sign In or Register to comment.