Navigation

    forum

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

    Topics created by AmazingDreams

    • Cannot claim controller ERR_NOT_IN_RANGE
      Technical Issues and Bugs • • AmazingDreams

      2
      2
      Posts
      3214
      Views

      I've checked your script, this was because you use FIND_HOSTILE_STRUCTURES before selecting the controller. We've changed the Room.find method so that FIND_HOSTILE_STRUCTURES doesn't match a neutral controller anymore. Your creeps have succesfully claimed both controllers after that.
    • pos.findClosest fails on objects stored in memory
      Technical Issues and Bugs • • AmazingDreams

      4
      4
      Posts
      5103
      Views

      Easiest way is to implement your findClosest wrapper on the RoomPostion prototype; something like this: ```javascript RoomPosition.prototype.myGetClosest = function (targets) { var me = this; if (!targets.length) { return null; } var mapToPos = _.map(targets, function(t) { var pos = t.pos || t; if (!(pos instanceof RoomPosition)) { //assume JSON pos pos = new RoomPosition(pos.x, pos.y, pos.roomName); } return { original: t, range: me.getRangeTo(pos) }; }); return _.first(_.sortBy(mapToPos, "range")).original; };