RPG kinda game problem
Hi! I am creating a game, but I ran into a little problem. I try to explain this as clear as possible. I use example attributes just to make it clearer.
So, let's say I have created attribute "randomTEST" in which I have set rule: every 1 second change attribute "randomTEST"to random(1,150)/100.
I have also attributes "Attack" with a value of 80 and attribute "Defense" with a value of 70. I have also attribute "SCORE" which is displayed in an actor inside my scene.
I've set the rule: When "Attack" is > "randomTEST"*"Defense", then Change attribute "SCORE" to "SCORE"+1
The score works fine when "randomTEST"*"Defense" gives smaller number than "Attack" BUT if the "randomTEST"*Defense is smaller than "Attack" again IMMEDIATELY after that, it won't add score+1. So basically it won't work unless the "randomTEST"*"Defense" becomes greater than "Attack" and only after that it works.. So, I want it to add 1 to score everytime the "Attack" becomes greater than "randomTEST"*Defense.
I don't know if I explained it well and clear enough, I can try to provide more information if needed, but if someone knows how to fix this I would be really thankfull.
So, let's say I have created attribute "randomTEST" in which I have set rule: every 1 second change attribute "randomTEST"to random(1,150)/100.
I have also attributes "Attack" with a value of 80 and attribute "Defense" with a value of 70. I have also attribute "SCORE" which is displayed in an actor inside my scene.
I've set the rule: When "Attack" is > "randomTEST"*"Defense", then Change attribute "SCORE" to "SCORE"+1
The score works fine when "randomTEST"*"Defense" gives smaller number than "Attack" BUT if the "randomTEST"*Defense is smaller than "Attack" again IMMEDIATELY after that, it won't add score+1. So basically it won't work unless the "randomTEST"*"Defense" becomes greater than "Attack" and only after that it works.. So, I want it to add 1 to score everytime the "Attack" becomes greater than "randomTEST"*Defense.
I don't know if I explained it well and clear enough, I can try to provide more information if needed, but if someone knows how to fix this I would be really thankfull.
Comments
You'll need another attribute, most likely a boolean to force the rule to be evaluated again. So after the attack is over, you reset the boolean (e.g. game.readyToAttack) to true and then place the rule you posted above inside of the rule When game.readyToAttack is true. I believe that will work.