Comments (2)
Are you sure you aren't using reusePath
and the creep has a memorized path that hasn't expired yet?
from engine.
I have noticed similar issue. So far it seems that the problem comes from the fact that the path finding for this function returns unfinished path if the location is blocked.
If you are 10 tiles away from your location and only all tiles in range of 1 are blocked the path finder will provide you with path...but it will be one tile short. And your creep will move...1 tile short of its initial destination.
If you are however in range of 2 tiles and all tiles in range of 1 are blocked the path finder will not give you any path...resulting in ERR_NO_PATH being given.
However, this implementation works for sources and other structures on which you can't walk over without providing range:1
property to moveTo
.
if(creep.harvest(source) === ERR_NOT_IN_RANGE){ creep.moveTo(source) }
This currently works...you will be given a path 1 tile away from the source...move to it..and stop receiving ERR_NOT_IN_RANGE.
However if this fix is to be implemented such code will return ERR_NO_PATH since there is no path that leads to the exact location (x,y).
In addition if you were to add default range:1
then when moving to flags or containers or any other walkable object...you will stop 1 tile short.
from engine.
Related Issues (20)
- Engine using newly deprecated method HOT 1
- Engine uses a *slightly* older version of lodash than the rest of Screeps HOT 1
- Spawn.spawning.setDirections() unable to change number of directions HOT 6
- TypeScript?
- Unclaim doesn't remove room from user's list of rooms HOT 1
- inactive orders (amount = 0) have wrong price
- Spawning not being set to null after spawning HOT 2
- RoomPosition.findClosestByPath ignores range option - always uses range 1
- [Optimization] processor/roads/tick HOT 1
- Creep.prototype.attackController wastes CPU using _getActiveBodyparts
- creep.moveTo calculates new Path when creep fatigued and reusePath and visualizePathStyle is used HOT 1
- How to debug VMs
- Upgrade to Latest Node Versions HOT 2
- Destroying structure by invoking `Structure#destroy` is not logged by `Room#getEventLog`
- Refactor recommendation for Structure.isActive
- NPM Outdated
- Request: Remove minimum resource amount for StructureTerminal.send() HOT 4
- RoomPosition#createConstructionSite needs supports for name parameter HOT 2
- Construction site removal broken, completely locking up rooms on IVM private servers. HOT 2
- Creep.moveTo tries to path through walls where there is no room exit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engine.