Rules based on attribute triggers inconsistently
imjustmike
Member Posts: 450
Hey guys - I'm working on a maths game at the moment, where a lot of different things are triggered by attributes, but I'm running into some problems where the triggering of rules seems to be quite inconsistent.
The game is quite simple, you player is given a target value, and a handful of different numbers to make up the target value using another attribute called current value. If the player gets the target value, then the round is reset and new numbers are displayed by using a rule if current value = target value, then change attribute reset to true.
In the number actors, there is a rule that when reset is true, do somethings like change colour and movement - but this rule doesn't always apply, sometimes it does, sometimes it doesn't, and I can't see any pattern. I've tried adding a timer, so the reset attribute is kept 'on' for a second, rather than instantly changing back, but this still doesn't seem to work.
The number values are drawn from a table, but unless I'm mistaken, this should really impact on the reset function, since they're not part of the rule.
Just wondering if anyone has had any similar experiences and managed to find workarounds?
The game is quite simple, you player is given a target value, and a handful of different numbers to make up the target value using another attribute called current value. If the player gets the target value, then the round is reset and new numbers are displayed by using a rule if current value = target value, then change attribute reset to true.
In the number actors, there is a rule that when reset is true, do somethings like change colour and movement - but this rule doesn't always apply, sometimes it does, sometimes it doesn't, and I can't see any pattern. I've tried adding a timer, so the reset attribute is kept 'on' for a second, rather than instantly changing back, but this still doesn't seem to work.
The number values are drawn from a table, but unless I'm mistaken, this should really impact on the reset function, since they're not part of the rule.
Just wondering if anyone has had any similar experiences and managed to find workarounds?
Comments
*Make a backup before you do this since I don't know if you can Undo a Revert to Prototype.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I probably should have mentioned that I'd added a debug to the reset attribute - that's how I know that it's not always firing!
Essentially there is a self attribute called 'used' to determine if the actor has been used. When it has been used, the colour is swapped to black and touching disabled so that the player doesn't use the same number once. However, once the current value = target value, the self attribute used should change back to off. And actually it should change back for ALL actors since they're all locked, even if it was already off. What seems to be happening is that the 'used' attribute doesn't always reset. Sometimes actors with used already off don't have it reset, but the player doesn't notice because there's no rules to kick in, but occasionally an actor with used 'on' doesn't reset, which means it stays black and unclickable...
And I just can't figure out why
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
And very very use for future reference, I keep forgetting that rules need a little time to kick in!
Thank you very much @tatiang