Navigation

    forum

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

    Topics created by Bodda

    • Problem with lab code (role.scientist)
      Help • • Bodda

      3
      3
      Posts
      4884
      Views

      oh, wow. Thank you ;X
    • Help with eserving multiple rooms - creep.reserveController
      Help • • Bodda

      2
      2
      Posts
      4581
      Views

      that is the usual hardship of multi-room travel. an idle creep doing nothing at a room edge will bounce back and forth between rooms each tick. the simplest answer for traveling is to use RoomPosition and MoveTo. This example will not have that issue with moving.    let a = new RoomPosition(25,25,'sim');creep.moveTo(a);
    • Only pick up energy?
      Help • • Bodda

      3
      3
      Posts
      9309
      Views

      Thank you for the quick answer, I will try that now. It's weird though, it doesn't show up in yellow in my markup.
    • I need help with a few things
      Help • • Bodda

      5
      5
      Posts
      7523
      Views

      For sources Question: In an early edition of my scripts I used: var source = creep.pos.findClosestByPath(FIND_SOURCES_ACTIVE) Then I added some logic when I noticed they were clustering around one and waiting function rememberClosestActiveSource(creep) { if(!creep.memory.sourceId || Game.getObjectById(creep.memory.sourceId).energy == 0) { var source = creep.pos.findClosestByPath(FIND_SOURCES_ACTIVE, { filter: (source) => { creep.moveTo(source) != ERR_NO_PATH } }) if (source) { creep.memory.sourceId = source.id } }} What I have now is classified, but the gist is this:When the creep is assigned a new job (like repairing a wall, or filling up energy storage) he find the source nearest to that target, stores the id and the path in his own memory. and does the job until its complete .. then grabs another job and repeats.  Lots of little tweaks to save CPU and mem .. but thats the basics