If attribute is changed.

Hi,
I have two attributes that I'm using for my game. Is it possible to make so the first one of them is changed (no matter to what) the second changes to something different. The only other option I can think of is having a timer, but that ain't efficient at all.

Thanks in advanced! :)

Comments

  • TheGabfatherTheGabfather Member Posts: 633

    I don't quite understand fully your question, but anyways:
    You can always have a Rule for your second Attribute, like...
    if attribute2 == attribute1 //change attribute2's value

  • ImNiklasImNiklas Member Posts: 103

    @TheGabfather said:
    I don't quite understand fully your question, but anyways:
    You can always have a Rule for your second Attribute, like...
    if attribute2 == attribute1 //change attribute2's value

    That wasn't quite what I meant. If Attribute 1's value is 20 and something changes it to 28, 83, 69 (any value), I want Attribute 2's value to become Attribute 2 + 1 for example.

    If Attribute 1 changes
    Change Attribute 2 to Attribute 2 + 1

    Basically what I'm asking for is a way to detect if an Attribute changes.

  • TheGabfatherTheGabfather Member Posts: 633
    edited March 2014

    You can either (1) have a third Attribute that checks if its value is no longer the same as Attribute1's, and then you fire the Rule to copy Attribute1's current value to Attribute3, and then change Attribute2's value (order of Rule execution is important),

    or (2) you can just change Attribute2's value in the same Rule which changes Attribute1's value.

    Whichever works for your game better.

    I hope it works, I'm using my office laptop right now so I don't have access to Creator to test it out. Go ahead and see if it does :) should be a quick fix.

    edit: Yup, method (1) works. I was able to test it just now :) you only need 2 Rules.
    One to change Attribute1's value, and one to change Attribute3's and then Attribute2's (in that order).

Sign In or Register to comment.