Thank you very much Actium. Is there some way for save data consistently? I read about globals, but if I understand, globals don't work at multiplayer. The only way that I came to them looping and calculate info every tick, but it drain CPU.
zebyja
@zebyja
2
Posts
716
Profile views
0
Followers
0
Following
Posts made by zebyja
-
RE: creepCounter problem
-
creepCounter problem
Hello,
I have script spawner:// UnitsType var HARVESTER = [MOVE, WORK, CARRY]; //200E module.exports = function (spawn) { if (!Memory.creepCount){ Memory.creepCount = 0; console.log("N E W G A M E"); console.log("creepCount set on 0"); } var creepName = 'harvester' + Memory.creepCount; var canCreate = spawn.canCreateCreep(HARVESTER, creepName); if ( canCreate == OK){ spawn.createCreep(HARVESTER, creepName, {role : 'harvester'}); Memory.creepCount = Number(Memory.creepCount) +1; console.log("creepCount is: " + Memory.creepCount); } else { //console.log(canCreate); if (canCreate == ERR_NAME_EXISTS) console.log(creepName + " exists jet"); if (canCreate == ERR_INVALID_ARGS) console.log("body desc is wrong"); if (canCreate == ERR_RCL_NOT_ENOUGH) console.log("control level is low"); } } Log: [1:49:30]N E W G A M E [1:49:30]creepCount set on 0 [1:49:30]creepCount is: 1 [1:49:55]creepCount is: 2 [1:50:25]harvester1 exists jet [1:50:25]harvester1 exists jet [1:50:26]harvester1 exists jet [1:50:26]harvester1 exists jet [1:50:27]harvester1 exists jet
i really don't know why this doesn't work. Please Help!!!