Navigation

    forum

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

    HoPGoldy

    @HoPGoldy

    6
    Posts
    1517
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    HoPGoldy Follow

    Posts made by HoPGoldy

    • How to access HTTP endpoints bypass CORS

      Im developing a web application for better operate the screeps console on mobile. And I want to know if there is any way to access HTTP endpoints bypass CORS?

      Im using https://cors-anywhere.herokuapp.com/ to achieve this. But I cannot guarantee the reliability of this. Is there any way to be more "official"?

      posted in Help
      HoPGoldy
    • RE: Dev update 2020-01-19: Decorations

      I wonder if this part of the skin can contain unicode? XD

      posted in News & Announcements
      HoPGoldy
    • RE: Help with coding

      I don't know if you have any doubts about the overall design or the specific api usage.

      We can provide more help if you post your completed code.

      posted in Help
      HoPGoldy
    • RE: Error This creep doesn't exist yet with Store

      @o4kapuk Is the problem really solved? I just ran the test code above, but the problem still appears.

      posted in Technical Issues and Bugs
      HoPGoldy
    • Error This creep doesn't exist yet with Store

      Which shard is affected?

      shard3

      What happened?

      After the game update version 4.0. I tried to use the store prototype instead of the previous carry. But sometimes there are some confusing errors when the code is executed. Like below:

      Error: This creep doesn't exist yet
          at data (<runtime>:37632:19)
          at Object.get [as store] (eval at exports.defineGameObjectProperties (<runtime>:1093:9), <anonymous>:7:62)
          at Object.switch (roles.advanced:17:53)
          at Object.CreepExtension.work (mount.creep:46:62)
          at Object.doing (utils:64:18)
          at Object.module.exports.loop (main:9:13)
          at __mainLoop:1:52
          at __mainLoop:2:3
          at Object.exports.evalCode (<runtime>:16037:76)
      

      The corresponding code as follows:

      // Update status based on its carrying
      Creep.prototype.updateState = () => {
          // Get the first resource
          const resourceType = (Object.keys(this.store).length > 0) ? 
              Object.keys(this.store)[0] : 
              RESOURCE_ENERGY
          // Get its amount
          const resourceAmount = this.store.getUsedCapacity(resourceType)
      
          // ....
      }
      

      What should have happened?

      You can use the following code to fix this problem (this fix has been updated by replying from @fangxm):

      // creep.work() will execute every tick
      Creep.prototype.work = () => {
          if (this.ticksToLive === CREEP_LIFE_TIME) return;
      }
      

      How can we reproduce this?

      You can find the reproduce from @fangxm reply below.

      posted in Technical Issues and Bugs
      HoPGoldy
    • Need to update the TypeScript declare at @types/screeps

      The game updated version 4.0, but @types/screeps did not sync.

      New prototypes like Store will not work for players who use typeScript in games.

      Do we have a @types/screeps update plan?

      posted in General Discussion
      HoPGoldy