Navigation

    forum

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

    yanamal

    @yanamal

    3
    Posts
    759
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    yanamal Follow

    Posts made by yanamal

    • RE: filter on findClosestByPath doesn't work as intended?

      ... Further fiddling suggests that the filter function *does* always resolve as true right before I try to assign the job to the screep; so perhaps this is a problem with ramparts specifically fluctuating between full/not full, after all.

      posted in Technical Issues and Bugs
      yanamal
    • RE: filter on findClosestByPath doesn't work as intended?

      Erm. It also doesn't work if I make the function call correctly:

      r = Game.creeps.Anthony.room.find(FIND_MY_STRUCTURES, {filter:(s)=>{return (s.hits < s.hitsMax);}})
       
      (which is the way I'm doing it in my actual code, anyway)
       
      Since I'm making the calls so closely to each other, I don't think that it's a matter of the rampart degenerating and being repaired in between calls.
      posted in Technical Issues and Bugs
      yanamal
    • filter on findClosestByPath doesn't work as intended?
      My repair creeps don't want to move on from ramparts they've fully 'repaired' on to walls that haven't been repaired yet. My logic calls for looking for a structure that has less than the max hit points using findClosestByPath with a filter.
       
      I've distilled the problem to the following two console calls:
       
      var r = Game.creeps.Anthony.pos.findClosestByPath(FIND_MY_STRUCTURES, (structure)=>{return (structure.hits < structure.hitsMax)})
      undefined
       
      r.hits < r.hitsMax
      false
       
      I'd expect the second call to return true, because of how it's the same exact logic as the filter!
       
      Is this some kind of nasty javascript scoping issue? I don't seem to have any stray global variables interfering that I can tell.
      Similar filtering seems to work fine for delivering energy to multiple sources (spawner, extensions, ...)
      posted in Technical Issues and Bugs
      yanamal