Error Code List
-
Apologies if there has been answered somewhere else, but I can't find a list anywhere.
Is there a list of error codes and meanings somewhere? When I spawn a creep, I know that -6 means there are not enough resources to spawn it. However, I get a -3 quite frequently and I'm not sure what that is. For a while, I thought it meant that the spawn was busy, but I attempted to manually spawn a harvester (2 x work, 2 x carry, 2 x move) while the spawn was idle and got -3.
Is there a list? If not, does anyone know what -3 is?
Thanks,
vt
-
The ERR_ constants near the top of this tall page are your answer.
http://support.screeps.com/hc/en-us/articles/203084991-API-Reference
Also, this would have been hinted at (but not explicitly stated) in the very first tutorial steps. The line that says: "if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE)". It's checking the return value against a constant. You just need to find the definition of the constants.
-
Excellent! Thanks for your help! Not sure I can reconcile the error I'm getting with what the code is, but maybe I missed that name in memory...
Thanks again,
vt
-
suggestion: create a new file where you copy paste the error definitions into.
i did that and can quickly look up what the error/issue is