Screeps icon indicating copy to clipboard operation
Screeps copied to clipboard

Screep Newbie Question

Open InternetMedicineMan opened this issue 10 years ago • 4 comments

Hello. I'm new to Screeps and I found your scripts. When I start it up I'm trying to make it work but continually just keep getting this error:

TypeError: Cannot read property 'find' of null at module.exports (countType:9:18) at Object.module.exports.spawnRequiredScreeps (factory:79:16) at Object.module.exports.run (factory:15:8) at main:7:9

I'm trying to read through the code and see how I might initialize the creeps but it seems as though there is a factory function that should be working, but it never actually starts the Factory because trying to find creeps on a blank board is erroring out. Trying to spawn one still comes up with the same errors.

I'll keep looking but I'm missing something. Any help would be appreciated.

InternetMedicineMan avatar Feb 19 '15 20:02 InternetMedicineMan

I am having a the same issue, trying to find where it comes from

WelpThatWorked avatar Dec 20 '16 01:12 WelpThatWorked

It looks like the error is coming because this script was written for the tutorial, long long ago. The error is coming from

var room = Game.getRoom('1-1');

	var count = room.find(Game.MY_CREEPS, {
		filter: function(creep)
		{
			if(creep.memory.role == type)
				return true;

			return false;
		}
	}).length;

Where room is null, so room.find raises an error. Maybe the room name in Game.getRoom() is wrong, or the way to get the room is wrong. I'm not sure how it's done any more, I haven't played screeps since before it went live

Garethp avatar Dec 20 '16 09:12 Garethp

is there any way that these modules will be updates/fixed?

theskull4028 avatar Jun 29 '17 07:06 theskull4028

Probably not. And if it does, it'll likely just be replaced instead of updated

Garethp avatar Jun 29 '17 11:06 Garethp