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

Little help #630

Open
pacomms opened this issue Sep 5, 2021 · 1 comment
Open

Little help #630

pacomms opened this issue Sep 5, 2021 · 1 comment

Comments

@pacomms
Copy link

pacomms commented Sep 5, 2021

Hi i am new to screeps and i have setup a private server to learn, i was taking a look and playing with your code however i get the following scrolling in the console

Brain Exception TypeError: Cannot read property 'role' of null
at Object.brain.addToStats (brain_memory:30:36)
at Object.brain.cleanCreeps (brain_memory:79:11)
at Object.brain.prepareMemory (brain_memory:202:9)
at Object.brain.main.execute (brain_main:82:11)
at Object.module.exports.loop (main:27:18)
at __module (__mainLoop:1:52)
at __mainLoop:2:3
at Object.exports.evalCode (:15370:76)
at Object.exports.run (:20808:24)
at global._init.global._start (:16028:22)

Any ideas ? im just using your code btw to learn and see how others have done it :-)

@TooAngel
Copy link
Owner

Hey, sorry for the late reply.

The creeps are defined via an attribute in the memory role. In your case, it seems that it cannot access the memory of the creep.
The method is about saving some stats about the creeps, so it is not soo important.
To properly debug it would be good if you can update to the newest version (if you are still using it).

Otherwise it would be nice if you could close the issue.

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

2 participants