Diving in to Code: Preparing for the Matrix

Coding sounds more complicated than it actually is. Coding, in reality, is as easy to learn as is setting up the Super Matter. However, it does take longer to learn than setting up the SM.

Let’s get on with the basics.

How exactly do we code?

Coding can take place in any text editor. You can use Microsoft Word or Google Docs. It’s not recommended as those are meant for things like Essays, Reports, and general Formatted Documents. It’s also annoying when they auto-format text or replace parts of your code with actual words. Because that’s what it’s made to do.

I personally use Visual Studio Code. It’s free, and very robust.

An added bonus of VSC is that you can get an extension that adds Discord Rich Presence, so others can know when you’re coding.

You can download extensions made by the community to help you with different coding languages.

If you don’t want to install anything, for some reason, and still want to code, you can use Notepad. Yes, that works. Or any text editor.

I highly recommend that you get an application that is made for you to code on. For reference, those applications can be referred to as an IDE.

An IDE is a Integrated Development Environment.

Coding Languages

Not all coding is the same. There are Low level coding languages and High level coding languages.

For this guide, we’ll be using high level programming languages. To be specific, we’ll be using Python.

Final Preparations…

We’re using Python because of its simplicity and the fact that it is close to how you code in BYOND.

You can download Python from here.

When installing Python, you want to make sure that the option Add Python [Version#] to PATH is checked. Like so:

The image was taken from this website, which I recommend you use this guide if you’re unsure what to install or how to install it.

If you haven’t installed an IDE yet, I highly recommend you do. As I said earlier, I would advise that you use Visual Studio Code.

Hello World

Once you have your text editor, or IDE, we need to make a file. Find a designated place where you would want to put the file. You can use your desktop or documents folder. I personally commit a war crime and put big project folders in the root of my hard drive.

Sorry for making the guide targeted towards Windows users but I recommend you make a “Code” folder in your Documents. Then make another folder Called “Hello World”
Once you know where you are going to make and place the file, go to it if you aren’t there already.

Now, first you need to enable the ability to see filename extensions.
Do that really quick using this short guide. Once again, sorry if you aren’t using Windows. If you’re using Linux, fuck off, you probably already know all of this and how to do the Linux equivalent.

Now that you have the option enabled, create a new Text file in your coding directory. When it’s created it should be named New Text Document.txt. You need to rename the file to Hello_World.py.

Once you do that, Congratulations! You just made your first Python file!

We’re nearing the end here. To edit the file, right click on it while it’s selected and choose the option Open with Code.

VSC should open soon after, and in the bottom right, it will probably tell you that some extensions are recommended for this file/workspace. If it ever asks you if you want to install an extension that regards Python, you should install it. Mine asked me to install some after I had some code in it.

If you’re not using VSC, open the file with whatever you’re using. If you’re using Notepad, there should be an Edit option when you right click it. If not, rename it back to a .txt file and open it normally.

Now that the file is open, our goal is to get the file to print out Hello World.
To do that, simply type this in:

print('Hello World!')
input('Press ENTER to exit')

Save the file by going to File > Save or just press Ctrl + S. Once that is done You can go to the file explorer and open the file. When it opens you should see

If you’re using Notepad, just save the file, rename it to a .py and then open it.
You’ll see the same thing as the other people.

At this point, pat yourself on the back! You just made your first “Hello World” program!

We’ll go over what print and input mean, what they are, and how to use them in the next guide.

This guide is not complete and will be updated at the soonest convenience.
Please send me DMs on the forums or on Discord if any part is confusing so I can edit the guide accordingly.

Discord: KerbinFiberAMassiveGraytider#5439

3 Likes

Some examples of IDEs are brackets (http://brackets.io/) and notepad++ (https://notepad-plus-plus.org/)
These are both completely free, but serve different purposes.
Brackets is more web oriented, whereas notepad++ is effectively an everything goes.

One of the most useful features you should look for when considering an IDE is auto-complete (referred to as Intellisense by Microsoft).
It is very useful because when coding, you won’t be able to remember all of the syntax, and as such, auto-complete steps in the way and helps you out. Further more, it speeds up coding by a lot because certain syntax can become extremely long, and have to type it multiple times will get annoying.

It should be noted, that sometimes IDEs have roughly the same features & thus it boils down to preference of what you find the most comfortable.

As a general statement for when it comes to programming, don’t think googling is a bad thing, this is how you learn better algorithms & structures and solve your errors. You’ll notice that most of your answers will come from stack overflow, our holy grail of programming.

Some related links:
https://wiki.beestation13.com/view/Understanding_SS13_code (Basics)
https://wiki.beestation13.com/view/Downloading_the_source_code#Hosting_a_server (You will need this to test your additions)
https://wiki.beestation13.com/view/Coding_Standards (Probably the toughest challenge there will be to overcome)

I wish you the best of luck.

Considering Kerbin_Fiber is looking after this thread, I’ll leave this post up to his discretion entirely, whether to remove it, integrate it into his own or keep it.

1 Like