Skip to content

PaterFrog/Screeps-Tutorial-Complete-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScreepsTutorialCodeComplete

I went through all five tutorials and gathered together the snippets you would enter into the Console, as well as all the script code.

The console snippets have been commented and put into snippets.js.

The scripts (main.js, role.builder.js, etc.) have been compiled into their "strongest" form after combining all five tutorial versions. These have also been commented. If you've done the tutorial you will be familiar with this code, so it should be easy to use for a simple start.

What to do after finishing the tutorial?

After selecting a spawn, your next project should perhaps be to automate the spawning of builders and upgraders. You could then follow that up with basic tower/fortification spawning. Automatic safe-mode activation, too.

Use the official Screeps documentation and API, you were linked many times during the tutorial. The more familiar you are with reading the documentation, the less time you'll have to waste on it.

If you are very new to coding, please do not make the mistake of creating whatever perfect function you think of before you have what I call a viable "vertical slice":

Your highest priority is to have your colony automatically set up a simple base that has all the most basic tools for survival. It's fine if it's weak, as long as it can offer a token resistance - it'll end up dying anyway, and this is expected. You will, and should, lose your initial colonies all the time. This is why you want to have the building of a new base automated before you worry about form over function. So spend this time figuring out how to automate basic operations, how people and NPCs will attack you and how your units will react based on your code. Learn what you want your workers to do, etc. You'll frequently come back to your base and find you need to select a new spawn - this is very normal.

Once you have this "vertical slice", this base with barely functional bits of only the neccessary, then you can go and make each bit more streamlined, more beautiful, more perfect. Don't worry about making your code especially nice at first - but do make sure to clearly comment everything. That will save you a lot of pain when you come back later to clean everything up and make it perfect.

A few more things:

If you are entirely new to coding, it can be very tempting to go and install the popular IDE to help you code better, with linting, with everything. Maybe this is the right thing for you, but maybe it isn't. Regardless of what experienced developers and players may tell you, it's not good to overwhelm yourself with new stuff and quit out of frustration or paralysis.

Until you feel that the ingame IDE (that's the console and scripting tab) is holding you back, just stick with it. If you want backups of your code, you could use github for that - or just a simple .txt on your desktop. Whichever you feel least resistance with. Keep it simple, keep it easy, keep it enjoyable. The advanced stuff can wait for later, when your current tools feel like they're starting to restrict you and you enjoy the thought of growing out of them.

Once you are at that point, go give the Screeps Discord server a call. :)

About

Completed code compiled from all the Tutorials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published