Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screep Newbie Question #2

Open
InternetMedicineMan opened this issue Feb 19, 2015 · 4 comments
Open

Screep Newbie Question #2

InternetMedicineMan opened this issue Feb 19, 2015 · 4 comments

Comments

@InternetMedicineMan
Copy link

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.

@WelpThatWorked
Copy link

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

@Garethp
Copy link
Owner

Garethp commented Dec 20, 2016

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

@theskull4028
Copy link

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

@Garethp
Copy link
Owner

Garethp commented Jun 29, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants