Navigation

    forum

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

    Cactus

    @Cactus

    4
    Posts
    842
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Cactus Follow

    Posts made by Cactus

    • RE: Thoughts on Changelog2015-07-27

      Hmmm i also changed my code again so probably that was not helping also 😉

      But if the upkeep costs are up and this put against the benefits of having roads ... .... maybe the links are not so bad whit 3% 😉

      posted in General Discussion
      Cactus
    • RE: Thoughts on Changelog2015-07-27

      jep i wake up with all my roads gone 2 ... ...
      Maintenance was more than my simple maintenance creep was able to maintain after the change...

      posted in General Discussion
      Cactus
    • RE: Repair (STRUCTURE_)ROAD

      Well i am still learning... tnx for the advice and suggestions for the code improvement.

      I was doing a quicky 😉 on SR (just sort for STRUCTURE_ROAD) it allows me to faster programming and i know what i mean ... when i make a not proper var. "of course when i 'll share the work next time i'll take a extra look".

      PS. it is a old bad habit for my (basic time) to even use single Capital letters as a variable "like if A = X then C+B=A end if just a sample plz dont kill me ;-)"

      Ohw how would this do on CPU movement control?

      if(!creep.pos.isNearTo(roadsToRepair)) {
      creep.moveTo(roadsToRepair);
      }
      
      posted in General Discussion
      Cactus
    • Repair (STRUCTURE_)ROAD

      ###Code for repairing roads.
      improvements are welcomed

      module.exports = function (creep) {
      
      if(creep.energy == 0) {
              var spwn = creep.pos.findClosest(FIND_MY_SPAWNS);
              creep.moveTo(spwn);
                  if((spwn) > [199]) {
                  spwn.transferEnergy(creep);
                  }}
          else{
      
      var SR = creep.pos.findClosest(FIND_STRUCTURES, {
                         filter: function(object){
                             if(object.structureType != STRUCTURE_ROAD ) {
                                 return false;
                             }
                             if(object.hits > object.hitsMax / 3) {
                              return false;
                            }
                             return true;
                         } 
                      });     
          creep.moveTo(SR);
          creep.repair(SR);} 
          };
      
      posted in General Discussion
      Cactus