I suspect that your client and the code you see there is out of sync with what is actually on the server. Try to restart your client. Log on using your browser or do something that can force an update.
Posts made by SandGrainOne
-
RE: empty code and memory but still getting errors
-
RE: Issue with assigning Math.random() to a variable (getting undefined).
let
gives us the same scope asconst
I personally still don't understand how this can work. I just did a simple test where I defined a variable with
var
at the scope of my main and not even that is working. Trying to use it from the console still gives an error indicating that the variable is undefined.You are using some kind of magic and I feel left out.
Edit: I thought about it some more and I see now that the console command you tried in the screenshot still doesn't work for you either. Your issue was with your script and you tried to copy the statement to the console.Was the error you got in the script, temporarily, exactly the same as the one you got when you tried running the statement in the console window?
-
RE: Can I build a spawn in an extra room I took over, which just has RCL 1?
@ffmathy Yes, at room control level 1 you can build one spawn.
-
RE: Power Creeps - Others can enable power in my reserved rooms
@mrfaul The experience is probably wastly different for different players. From my standpoint it isn't the experienced players that new players should be concerned about, but the players starting at roughtly the same time in the same area. Those are generally more agressive in order to secure expansion options.
-
RE: Any way to either rename a spawn or make creeps refer to a spawn by the ID isntead of the name?
I haven't verified your code, but it seems to be trying to print som text next to your spawn. This is probably unrelated to the issue you describe in your original post where you talk about the behaviour of your creeps.
What do you mean when you say "creeps randomly abandon my spawn". Maybe you can include some code snippets of the related code?
To answer your original question more specifically. There is a function called
getObjectById
on the Game object you can use to get any game object by its id. The only limitation is that the game object has to be in a room that is visible to you. -
RE: Pathfinding with collision detection, any tips?
The default behaviour of the moveTo function for creeps is to reuse the same path for 5 ticks. You can change the tick count with the reusePath option.
My own strategy is to generate a path with other creeps ignored and to keep the path for 100 ticks. If the creep is stuck, then I let it get a new path where other creeps are treated as obstructions. This is crude, but suprisingly effective.
-
RE: Creep memory object inconsistent?
@4nytime You probably also have some logic using those memory values. Double check them for the mistake mentioned by Donatzor.
-
RE: My Side Panel is gone.
The tooltip that pop up when I hover over the button covers almost all of it. It gets in the way of the click and cause the button-hover-event to deactivate. This creates an annoying flickering where the tooltip comes and go.
There is a small stip on the bottom of the button where you can point without getting the tooltip in the way.
It would be nice if the tooltip could be moved away from the button itself. The tooltip is basically anchored on the wrong side of the button.
-
RE: creep.room.name not being updated correctly
I suspect that you have encountered the same issue with path finding as many before you. The creep bounce back and forth between rooms because the moveTo action returns "ERR_NO_PATH" the first tick in the new room.
https://screeps.com/forum/topic/1352/err_no_path-when-creep-moveto-flag-in-another-room/16
-
RE: ERR_NO_PATH when creep moveTo flag in another room
That is a little weird, I agree. Try to move the target position a few tiles into the room. Just 2-3 tiles. A few tiles of swamp shouldn't matter. I have also seen issues when the target position is too close to an exit and the creep must travel along the exit tiles to avoid swamp.
I still think this is a coding challenge and not a technical thing that support can help us with.
-
RE: Matryoshka creeps
What about containers? Is it normal to have two containers in the same spot?
-
RE: ERR_NO_PATH when creep moveTo flag in another room
I have had this problem in a few rooms and it has always been related to having some swamp in the way. The chance for it to happen increase with the amount of swamp in the room.
I have assumed the path logic tries to find alternative routes to avoid the swamp. If it spends too much time on this it can finally give up. It doesn't need to be a lot of swamp. Just a few tiles thick. It is equally important that it takes the logic a lot of time to find alternate routes.
My solution up til now has been to build roads across the swamps that has introduced the issue. The plan is to build more logic around movement that can handle the situation better.
A quick test for you might be to temporarily move the flag closer to tile where the creep enters the room.
-
RE: creeps not spawning even though createCreep returned the provided creep name
Another long shot.
If you are trying to spawn two creeps in the same room during the same tick it could be that you have energy only for one of them. You get OK from the function because the room have enough energy for the creeps individually, but when the intents are being executed one of them fails.
-
RE: Possible issue with getUniqueName
I've seen that a few times. It has always resolved itself after a few ticks.
-
RE: creeps not spawning even though createCreep returned the provided creep name
A very basic question: Are you absolutely certain that you don't call createCreep more than once?
-
RE: ERR_NO_PATH
I think this happens more frequently with the default path finding logic. I have had this in many rooms where there are swamps in the way. I think the path finder simply gives up after a while. I usually "solve" it by building roads, but the long term solution will be to add smarter path finding. One such option is to activate the PathFinder module and start making your own cost matrix.
More about that here:Â http://support.screeps.com/hc/en-us/articles/207023879-PathFinder
-
RE: Hard Reset
If it happened only once you probably don't need to worry.Â
More about our CPU limit and resets can be found here:
http://screeps.com/forum/topic/316/Clarification-request-on-Cpu-limit-abusing-
-
RE: What does RESOURCE_POWER refer to?
RESOURCE_POWER refers to the resource type "power". It is a resource type you can harvest from randomly spawned power banks in the corridor rooms.
The "store" property is an object with properties just like Game.creeps is. This means you can loop the content of store just like you probably do with creeps.
for (var creepName in Game.creeps) {
var creep = Game.creeps[creepName];
}
For store it would be like this:
var total = 0;
for (var resourceType in structure.store) {
var amount = structure.store[resourceType];
total = total + amount;
}
With that being said. In screeps we have access to a set of utility functions from a library called lodash. You should look at the _.sum() function. My loop above can be written like.
var total = _.sum(structure.store);
Â