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.
-
@hopgoldy I used @fangxm's repro code because it's referenced in the root post. Just checked again, it does not trigger an exception anymore. If you've found another case, please share the reproduce code and we'll take a look.
-
@o4kapuk But I still have this problem with the code above.
-
I get this error with the tutorial code
-
@lhocke how to reproduce it?
-
@o4kapuk here's my reproduction. Unfortunately I'm using PureScript and I haven't been able to strip down my code to a minimum, but it definitely triggers an error on the very first tick you spawn (no errors when it's not the first tick of spawn, but it could still get annoying.) I'm guessing that the fix that you implemented is dodgy. Please attach some debugger to the runtime and see what's happening so that this bug can be get rid of!
-
@arsdragonfly not like I can do something with the code you provided... well, I'll try to build the minimal reproduction code myself.
-
@arsdragonfly Where do your code running? The bug haven't been fixed in the private server.
-
@fangxm @o4kapuk I just quickly checked, the bug doesn't appear in the simulation room, but for the private server it's indeed still broken.
-
Hello, receive an error.
The code:
I have defined many methods but game don't like only this.
-
The problem is
createCreep
instantiates a creep on success. However, the creep doesn't have anid
or an entry in runtimeData.To avoid these errors the fake creep needs a fake id and an entry in runtimeData. Alternatively, we can just not create a fake creep during
createCreep
. I can't think of any use case requiring the fake Creep, you have to try hard to even find it.
-
So, it means that we can't use logic like this, yes?
-
@silentium_noxe Looping over
Game.screeps
after callingSpawn.createCreep
and accessing any proprety defined here would cause that error. So even simple stuff like.hits
would cause the error.As for the code: nothing wrong with it, I do it all the time. I recommend running your spawning logic after your creep logic (this helps avoid running out of cpu as well, if you have too many creeps you run out of cpu before you can run your spawning logic, which will intern cause you to spawn fewer creeps).
You can also iterate over rooms then iterate over
Room.find(FIND_MY_CREEPS)
, rather than all of your creeps all at once.Finally if you want to iterate over creeps that are spawning. I personally iterate over my spawns and check the spawning property and access the Creep that way, since there a fewer Spawns than Creeps.