JonathanSafer / screeps

Screeps AI
MIT License
25 stars 7 forks source link

cannot read property 'room' of undefined #207

Closed couchcactus closed 3 months ago

couchcactus commented 3 months ago

mysterious error message appearing that does nothing except prevent using console commands

JonathanSafer commented 3 months ago

Do you have a line number for that error?

couchcactus commented 3 months ago

yes, it was 11049, the code for homeless creeps

couchcactus commented 3 months ago

also i respawned because of this error, but the runner and remote miner seem to do nothing. they just spawned and the runner isn't pulling the miner along

couchcactus commented 3 months ago

image

JonathanSafer commented 3 months ago

Ah it's because you're in a novice zone. Try respawning in a normal area and let me know if the problem persists

couchcactus commented 3 months ago

oh ok lol thanks

couchcactus commented 3 months ago

but anyways for the error message, it happened when a quad was attacking a room, and this is the code line error: _.forEach(localCreeps["homeless"], (creep) => {

JonathanSafer commented 3 months ago

I'll look into this more later today. In the future if you notice that a creep is causing the whole bot to crash, you can "resolve" the issue by suiciding that creep. Of course ideally we'll get to the point where creeps are never able to crash the whole bot :).

couchcactus commented 3 months ago

yeah, it happened when the quad was attacked and lost 2 members. They sat outside the room doing nothing and then the error appeared. I suicided them but nothing happened, could be the memory but it doesn't mention that in the error

JonathanSafer commented 3 months ago

This makes me think that the error wasn't related to the quad. Do you have a link to the history for that attack by any chance? When I take a look at the code later that might be useful for me to get some context.

couchcactus commented 3 months ago

yeah, i don't think i do, i will check though

couchcactus commented 3 months ago

ok so shard 3 W31N24 Tick 58097879 is when the error hit, check out what it did to the colony

couchcactus commented 3 months ago

and shard 3 W34N24 tick 58097679

couchcactus commented 3 months ago

have you got a discord? i think discussing this will be better there