Capping resources: Create another abstract resource. (AResource) To give resource: gives X Resource for X AResource To take resource: gives X AResource for X Resource To raise cap: gives X AResource To raise cap AND resource: gives X Resource To reduce cap: takes X AResource
With this, you can also make something that locks at X Resource if you want by making it visible at (Aresource-X) Aresource. Note that this needs a static cap though, I recommend making a second cap resource if you want to also change the cap with it. Also note that you may want to start this cap value decently high, like 1e38 or so, in case you want to add something in the future than locks at 1e38. Then you can add a bigger cap resource at e92, 146, 200, 254, 308 if you need something better. (precision issues)
Here's a quick simple Settings template. (Remove the // before the hide log once your game is done) Settings : resources are visible by default clickables are hidden by default upgrades are hidden by default achievements are hidden by default buildings are hidden by default //hide log //custom stylesheet : enter stylesheet here
If you want to make an upgrade give resources (when bought), make it cost a negative of that resource. To make it give resources per second, make it cost negative of a building that produces those resources. (abstract of course) If you want to make a building that costs capped resources, make it cost a negative of the cap. To lock an upgrade after it's bought, just add locks /*Insert name of upgrade here*/. Note that this will remove the effect of any "multiplies efficiency of" lines in your upgrade once the user refreshes, so you should only use this on upgrades without them! Instead of, like, 235000000000000000000000000, you can just put 2.35e26. It's much shorter and user-friendly! Also, if you want like, 0.00000000000000000000000032, you can use 3.2e-25. I recommend naming all your abstract resources and clickables with pictures, even if it's something like ., so you don't get an ugly message when you have something cost that resource or unlock the clickable.