Hours of pain
matarua
Auckland, New ZealandMember Posts: 854
Here's something I have learned in the last 24 hours.
Trying to debug something - and the culprit was rules within a rule.
I had a rule that met condition A
Then inside that rule three more rules, lets call them conditions 1, 2 and 3.
So if A fires and 1 fires it should do A1.
So if A fires and 2 fires it should do A2.
So if A fires and 3 fires it should do A3.
Well it would only do A3 even if the conditions were A1.
I just now extracted the nested rules out and put the A1, A2, A3 rule as conditions and it solved it.
I had protection in there and everything and it was just mental - drove me mental.
Logic not following the logic. Scoured it and tested it so much it came down to it firing the last rule in the list.
So I think it skips things so quick inside the nesting rule it can do things out of sync.
Best not to nest rules by the looks.
Any thoughts?
Trying to debug something - and the culprit was rules within a rule.
I had a rule that met condition A
Then inside that rule three more rules, lets call them conditions 1, 2 and 3.
So if A fires and 1 fires it should do A1.
So if A fires and 2 fires it should do A2.
So if A fires and 3 fires it should do A3.
Well it would only do A3 even if the conditions were A1.
I just now extracted the nested rules out and put the A1, A2, A3 rule as conditions and it solved it.
I had protection in there and everything and it was just mental - drove me mental.
Logic not following the logic. Scoured it and tested it so much it came down to it firing the last rule in the list.
So I think it skips things so quick inside the nesting rule it can do things out of sync.
Best not to nest rules by the looks.
Any thoughts?
Comments
@matarua Also glad you sorted it. :-) But I wouldn't throw nesting Rules out of the window, that's an integral part of programming when required, in lots of other situations....
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS