Variable randomly de-incrementing?
-
Hello!
I'm using an int variable (lets call it progress) outside the main loop in order to keep track of my colony's progress. I increase it through if statements checking if all of the required items are true in order to continue. The problem is, the progress variable randomly decreases even though it is outside the loop and there is no decrements in my code.
I appreciate any help!
-
Each worker has it's own global, and there are more than one workers. When you're incrementing it in one place the other workers aren't getting that, so they still have the old number.
This article may help more- http://docs.screeps.com/contributed/caching-overview.html