AND and OR with Computed Attribute values in a RULE
Hey guys. I was able to get some awesome help on my first question to the forum, and I hope to find an equally impressive answer to my next question.
I have four game variables set up for Front, Left, Right, and Back. Each stores a numeric value between 0 and 1000, but each is set differently at the start of the game: Front=800, Back=200, Left and Right both to 500.
I'm trying to create a rule that will allow me to allocate 10 units to one of these variables FROM the other three values.
My rule needs to do the following:
- Check for the appropriate keystroke.
- Check to make sure that variable isn't already at the maximum value of 1000.
- Check to make sure there's at least 10 units available among the other three values.
It seems that the RULE box has settings that ANY or ALL conditions must be met for the DO portion to occur, but I need to have both possibilities, like this:
If Key = i AND Front <= 980 AND (Left >10 OR Right >10 OR Back >10)
Because I can only specify ANY or ALL, the above doesn't seem possible. I then got the idea that I could make the above work if I slightly changed my thinking:
If Key = i AND Front <= 980 AND Left + Right + Back >10
This would allow the rule to work using all AND's, but now the problem is in how to check for the computed value of the Game Attributes Left, Right, and Back? It seems that it will only allow you to specify one attribute value in the Attribute IF block.
Is there a way I can do this? Thanks ahead of time to anyone who can steer me in the right direction.