Navigation

    forum

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

    AdeptOfNone

    @AdeptOfNone

    16
    Posts
    1823
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    AdeptOfNone Follow

    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