Change Attribute .... Bug?

CaptFinnCaptFinn Member Posts: 1,828
edited June 2012 in Working with GS (Mac)
I feel deep in my heart I got this right. And I swear it has to be a bug.

I have a Ship and 3 Gems

I have a attribute Gems Integer

Ship has these 3 rules

Ship collides with Gem1 change game.Gems to game.Gems+5

Ship collides with Gem2 change game.Gems to game.Gems+10

Ship collides with Gem3 change game.Gems to game.Gems+15


In the Gem actors if they collide with ship... destroy actors.

Now when I start the preview. The actor that is Displaying Text game.Gems will take it upon itself to start adding and subtracting randoms numbers changing the sum. Even when there is no gems around for the ship to collide with.

Plus the +changes are suppose to be in multiples of 5.

Is this a bug?

Answers

  • EatingMyHatEatingMyHat Member Posts: 1,246
    Sounds strange... for sure you have some logic that subtract gems somewhere, where is it? The only rules that you describe are adding gems, but since you are claiming that some of the random changes are subtractions, there got to be more than just these 3 rules to change the gems count.
  • MotherHooseMotherHoose Member Posts: 2,456
    @Jeffnichols

    the collide rule should be on the gem … not the ship

    on the gemActor:
    Rule: when overlap or collide with ship
    -changeAttribute: game.gems To: game.gems+5 (or 10 or 15 )
    -Destroy

    image MH
  • LumpAppsLumpApps Member Posts: 2,881
    edited June 2012
    Shouldn't it be

    change game.Gems to game.Gems+5

    for each time you hit.
    So not +10 and +15?

    The way you did it: first would hit would make +5, then second 5 + 10 = 15, then third hit 15 + 15 = 30.

    Do what @motherhoose says but with

    changeAttribute: game.gems To: game.gems+5

    NOT +10 or +15
Sign In or Register to comment.