Change images within Rules?

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Working with GS (Mac)
I want to set it up like this;
Rule: When game.attribute = 0
Change Image to picture0
OTHERWISE
Rule: When game.attribute = 1
Change Image to picture1
OTHERWISE
Rule: When game.attribute = 2
Change Image to picture2
ETC...

This doesn't work.
I have to make the change image behaviors within individual rules...

Any idea why?

Comments

  • FloridaGamesFloridaGames Member Posts: 328
    Do dont the otherwises, just make a separate rule for each image change.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi DrGlickert; my guess is that you've made your game.attribute as boolean instead of integer. Or possibly you've not nested the otherwise's properly maybe?

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

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah dont use otherwise. just make sepertate rules when attribute=1 change image to image1 then another rul when attribute =2 change image to image to and keep going wiht the rules
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi TacoStand and John P: what have got against using otherwise?

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

  • DrGlickertDrGlickert Member Posts: 1,135
    I really like using OTHERWISE because it keeps things nice and neat. The attributes are integer attributes. I use a lot of OTHERWISE when I've got other integer attributes that do various things based on the number in that specific attribute.

    Also, I was under the impression that every individual rule eats processor however, rules within rules (like in OTHERWISE) are not "AS BAD" on the processor...(I use the term "AS BAD" loosely).
  • FloridaGamesFloridaGames Member Posts: 328
    gyroscope said:
    Hi TacoStand and John P: what have got against using otherwise?

    I've had bad experiences trying to use the otherwise feature, they never seem to work right for me...
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Otherwise nesting has always worked fine for me but a neater way I've just remembered, originally from CodeMonkey (where'd he go?) and tshirtbooth is:

    When touch is pressed
    Change Attribute game.Att To ((game.Att + 1)%3)

    when game.Att = 0
    Change image

    etc; in this example, up to 2

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

Sign In or Register to comment.