How i can add an attribute to another attribute
amarillovegan
Member Posts: 3
Hi im making a characteristic system, so i made a button to calculate life points whit a random value and i need to add to this value the fortitude value, and everytime that the fortitude value changes the life points must change.
for example.
I throw the dice to calculate life points and that value was "10"
and i have a value of 3 in fortitude so the life points is equal to 13. but during the game the fortitude raises to 4 and the life points must change too.
How i add an attribute to other.
Thanks
for example.
I throw the dice to calculate life points and that value was "10"
and i have a value of 3 in fortitude so the life points is equal to 13. but during the game the fortitude raises to 4 and the life points must change too.
How i add an attribute to other.
Thanks
Comments
The constrain isnt adding the value it changes the value.. perhaps im doing wrong?
Hi @amarillovegan with respect to @DepressedPanda Constrain isn't really helpful here, I'm thinking; instead I'd suggest using a Change Attribute behaviour.
Secondly, if it were me, because you are adding the value of two different things, I'd make the programming clearer by making a third integer attribute, being the sum of those other two.
So in your button to calculate life points, something like
When touch is pressed
Change Attribute Life to random(1,10) --- guessing this is the sort of thing you have
Change Attribute LifeFort to scene.Life+scene.Fortitude
Display Text "Life "..scene.LifeFort --- maybe you're doing this?
As long as your Fortitude attribute is a scene or game one, when it's changed at a future time, it'll be automatically taken into account with the above Rule. Hope that sorts it for you.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps