Navigation

    forum

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

    Posts made by AdeptOfNone

    • Documentation describes room event data returned by room.getEventLog() for event type EVENT_BUILD as follows

      https://docs.screeps.com/api/#Room.getEventLog

      EVENT_BUILD	A creep performed build in the room.
      targetId - the target object ID
      amount - the amount of build progress gained
      energySpent - the energy amount spent on the operation
      
      the actual event data in game contains the following:
      
      targetId,
      amount,
      structureType
      x,
      y,
      incomplete: boolean // gets set to true, if this action completed the site build
      posted in Technical Issues and Bugs
      AdeptOfNone
    • RE: What's the function to calculate creep cost?
      // oneliner with lodash
      const bodyCost = _.sum([WORK,MOVE,CARRY], b => BODYPART_COST[b]);
      posted in Help
      AdeptOfNone
    • RE: Id<T>

      @jbyoshi ta

      posted in Help
      AdeptOfNone
    • RE: Id<T>

      @Coelso Thanks, but calling getObjectById and using the said objects is not the problem. I have a problem with Game.getObjectById(id:string) giving me a warning, for it is marked obsolete. Surely there must be a way for constructing a proper Id parameter for this call from a string + list of known types?

      0_1604338241978_screenshot.png

        let dismantleObject:Structure<BuildableStructureConstant>|undefined;
      
                  while(target.anchorRoom!.$roomCache.dismantle.ids.length > 0 && !dismantleObject){
                      try{
                          const id = target.anchorRoom!.$roomCache.dismantle.ids.shift()!;
                          dismantleObject = Game.getObjectById(id) as Structure<BuildableStructureConstant>;
                          if (dismantleObject){
                              target.anchorRoom!.$roomCache.dismantle.ids.unshift(id);
                          }
                      }catch(e){
                          this.logError(`ERROR ${e}`);
                      }
                  }
      
                  if (!dismantleObject){
                      return;
                  }
      
                  worker.moveTo(dismantleObject, {range: 1});
                  dismantleObject.notifyWhenAttacked(false);
                  const res = worker.dismantle(dismantleObject);
                  this.log(`${worker.name} dismantle res:${res}`);
      posted in Help
      AdeptOfNone
    • RE: Map Visuals

      Map visuals are great. However, one has failed to locate a facility for enabling the map visuals permanently in the steam client. The map visuals are disabled again, once one enters the room and returns to the world map by perusing the "World" button.

      posted in News & Announcements
      AdeptOfNone
    • RE: Id<T>

      OK, let one rephrase one's question. Imagine one was storing a bunch of id-s, let's say for structures to be maintained, and imagine that this list would include walls and ramparts.
      How would one go about invoking the magicks of getObjectById of this list w/o incurring the wrath of tslint (pbuh)?

      posted in Help
      AdeptOfNone
    • RE: Id<T>

      @jbyoshi said in Id<T>:

      How?

      posted in Help
      AdeptOfNone
    • Structure selection menu does not work on mobile

      Browser : brave

      posted in Technical Issues and Bugs
      AdeptOfNone
    • Id<T>

      RE: "@types/screeps": "^3.2.1",

      How does Game.getObjectById(id: Id < T>): T | null; work - how does one construct the id parameter? the obsolete warning of Game.getObjectById(id: string): T | null; is triggering one's PSTD;

      posted in Help
      AdeptOfNone
    • RE: What is up with shard0? The unfairness of slow ticks.

      There is nothing wrong with the so-called "unfairness". Shard0 subscriptions should be increased in price by 37%.

      posted in General Discussion
      AdeptOfNone
    • RE: What is up with shard0? The unfairness of slow ticks.

      NO

      posted in General Discussion
      AdeptOfNone
    • RE: Optimization for checkStructureAgainstController

      yeah, agree with @Tigga , looking at github/engine code makes me believe, that the same mechanism may be in use at MMO server side and addressing the issue may give a boost to overall performance of all the shards.

      posted in Feature Requests
      AdeptOfNone
    • RE: isActive() call extremely expensive.

      @adeptofnone Move to Techincal Issues & Bugs kthx bye

      posted in General Discussion
      AdeptOfNone
    • RE: Allow dismantling ruins

      NO

      posted in Feature Requests
      AdeptOfNone
    • isActive() call extremely expensive.

      Structure.isActive() is extremely expensive due to the inefficient implementation, so one has stopped using it. The effect is extremely pronounced in a room with a lot of rampart structures present. One believes, that the same algorithm is used in the server side for determining the active structures and refactoring the code responsible for determining the active structures vs the controller level, would give a significant boost to the servers' performance.

      ta

      posted in General Discussion
      AdeptOfNone