Hi there.
I've been wondering if there's a way to change a validator's value ingame, like via upgrades.
To be more specific:
I've got a building that takes an amount of resources and produces another resource from it via behaviour. That behaviour is disabled via a Validator which checks if the player's got enough resources in the bank to afford that production. If not, the behaviour is removed and can only be applied if the validator turns true. Got this part working so far.
But: The validator seems fixed to that preset amount. So when i upgrade the behaviour to take for instance 8 minerals instead of 4, the validator will still check for 4 and allow production, though the player will only have to pay, say, 6 minerals instead of 8. Since i have that building being upgradeable to produce thousands of resources, this is a major flaw in the system.
Sure, i could go the complicated way and make a behaviour and validator for each of the production levels, but that seems just "unnecessary" to me. I'd love to hear that there's an easier way.
Any help is much appreciated.
Hi there.
I've been wondering if there's a way to change a validator's value ingame, like via upgrades.
To be more specific:
I've got a building that takes an amount of resources and produces another resource from it via behaviour. That behaviour is disabled via a Validator which checks if the player's got enough resources in the bank to afford that production. If not, the behaviour is removed and can only be applied if the validator turns true. Got this part working so far.
But: The validator seems fixed to that preset amount. So when i upgrade the behaviour to take for instance 8 minerals instead of 4, the validator will still check for 4 and allow production, though the player will only have to pay, say, 6 minerals instead of 8. Since i have that building being upgradeable to produce thousands of resources, this is a major flaw in the system.
Sure, i could go the complicated way and make a behaviour and validator for each of the production levels, but that seems just "unnecessary" to me. I'd love to hear that there's an easier way.
Any help is much appreciated.
you need a validator for every behavior
And therefore a new behaviour for every upgrade?
Guess that means back to redesigning the system.
Thanks though.