Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Iziak
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Iziak

    @Iziak

    3
    Posts
    692
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Iziak Follow

    Posts made by Iziak

    • RE: Why does role not get loaded onto creep's memory

      I actually moved it into my spawn check, and It is only called immediately before I try spawning any new creeps.  This reduces it's checks and fixed the problem.  Good suggestion though @Amadox

      posted in Help
      Iziak
    • RE: Why does role not get loaded onto creep's memory

      You nailed it, still had the leftover dead creep memory clean from the tutorial and was wiping during my creep spawn.  Set to check if creep spawner was spawning before doing the memory wipe - all good thank you!  I will check out the Channel, much appreciated.

      posted in Help
      Iziak
    • Why does role not get loaded onto creep's memory

      Can anyone tell me when why this code is able to spawn a creep but does not have its role saved in memory?

      var maintainCreeps = function(){
      var minHarvesters = 1;
      var minBuilders = 3;
      var minUpgraders = 2;
      var creepWorkerBody = [WORK,WORK,CARRY,CARRY,MOVE,MOVE];

      var harvesters = _.filter(Game.creeps, (creep) => creep.memory.role == 'harvester');
      console.log('Harvesters: ' + harvesters.length);

      if(harvesters.length < minHarvesters) {
      Game.spawns.Spawn1.createCreep(creepWorkerBody, 'Harvester'+(harvesters.length+1).toString(), {role: 'harvester'});
      }

      var upgraders = _.filter(Game.creeps, (creep) => creep.memory.role == 'upgrader');
      console.log('Upgraders: ' + upgraders.length);

      if(upgraders.length < minUpgraders) {
      Game.spawns.Spawn1.createCreep(creepWorkerBody, 'Upgrader'+(upgraders.length+1).toString(), {role: 'upgrader'});
      }

      var builders = _.filter(Game.creeps, (creep) => creep.memory.role == 'builder');
      console.log('Builders: ' + builders.length);

      if(builders.length < minBuilders) {
      Game.spawns.Spawn1.createCreep(creepWorkerBody, 'Builder'+(builders.length+1).toString(), {role: 'builder'});
      }
      }
      module.exports = maintainCreeps;
      posted in Help
      Iziak