Help with attribute, thanks

anotherforestleafanotherforestleaf Member Posts: 5
edited May 2014 in Working with GS (PC)

I'm having this trouble and I can't figure out how to do it, hope you guys can help me, appreciate.

So I have three box stand next together, BOX A - BOX B - BOX C

I create 3 game attribute color_BOX_A, color_Box_B, Color_Box_C (they all have 0 at first)

  • if color_box_A = 1 then change color BOX A to Green
  • if color_box_A = 2 then change color BOX A to Yellow
  • if color_box_A = 3 then change color BOX A to Purple

The same rule for attribute box B and box C

And I create this rules in actor Example B:

when actor Example A collapse with Example B (have green color):

  • if color_box_A = 0 -> change color_box_A to 1

when actor Example A collapse with Example B

  • if color_box_A > 0
  • if color_box_B = 0
    -> change color_box_B to 1

when actor Example A collapse with Example B

  • if color_box_A > 0
  • if color_box_B > 0
  • if color_box_C = 0
  • > change color_box_C to 1

So what I want is, actor Example A need to collapse 3 times with actor Example B to have all box the same color (or 3 different color), but with the rule upward, when two actors collapse at first time, all 3 box change color at the same time.

I kind of figure out where I was wrong, but I don't know how to fix it. Please help me, or show me another way to do this task (please make it detail since I'm new to GS)

Thanks a lot !

Answers

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    edited May 2014

    its because your not changing the other variables back to 0, so heres what you have to do.


    when actor Example A collapse with Example B (have green color): - if color_box_A = 0 -> change color_box_A to 1
    change attribute color_box_B to 0
    change attribute color_box_C to 0

    when actor Example A collapse with Example B - if color_box_A > 0 - if color_box_B = 0 -> change color_box_B to 1
    change attribute color_box_A to 0
    change attribute color_box_C to 0

    when actor Example A collapse with Example B - if color_box_A > 0 - if color_box_B > 0 - if color_box_C = 0 -
    -> change color_box_C to 1
    change attribute color_box_B to 0
    change attribute color_box_A to 0


    now it should work, as before you weren't changing your variables back to 0, meaning gamesalad was getting confused and wasn't sure on what is going on.
    i hope i read the question right, caus i found it abit confusing

  • anotherforestleafanotherforestleaf Member Posts: 5

    @CodeMonster said:
    its because your not changing the other variables back to 0, so heres what you have to do.

    Well I did change it (forgot to mention above), when I create 3 integer attribute with value = 0. The thing is may be, because I put three rules to change box color in 1 actor, so GS review it all and it all works (one after another). So I think I need different way to do this task but can't figure out how.

Sign In or Register to comment.