MattAtlas Posted December 24, 2019 Share Posted December 24, 2019 Github Part of learning how to code is setting up your Github environment to make pull requests. For this guide, we'll be using Gitkraken. There are a myriad of other git clients out there, but this is the one I use and the one I'll teach you how to use. A small foreword: if you're having trouble at any point, please message me on Discord: mattatlas#6970 First of all, download Gitkraken here: https://www.gitkraken.com/download And download Git here too: https://git-scm.com/download/win Install both of them, then make a new folder for your environments. Right click on an empty space and you should see this; Click Git Bash Here and a CLI will pop up. We're going to download the code now, but we can't push our code to the main repo, so we'll need to make our own 'copy', called a fork. Go here: https://github.com/Aurorastation/Aurora.3 This is our main github repo. Make a github account if you need to, then at the top right you should see a Fork button. Press it and wait for it to complete. What you're making is a copy of this repo that's tied to your github account. This is where you'll push your code. When your fork's done, Github should redirect you to it. If it hasn't, click your name at the top right, press "My Repositories", and click Aurora.3. Your link should look like this: https://github.com/NonQueueingMatt/Aurora.3 To download the code, press the green "Clone or download" button at the top right and copy the link there. It'll look like this: https://github.com/NonQueueingMatt/Aurora.3.git Go to the CLI we opened earlier and put this in: git clone https://github.com/YourGithubNameHere/Aurora.3.git It'll now start downloading. Once it's done, right click that folder and you'll have the option to open it with GitKraken. Click that and follow its instructions if needed. You should see something like this: It looks complex, but trust me, it's very easy. On the left, in the Local section, you can see the branches that are physically there in your folder. A branch is basically where you'll be writing your code - a "snapshot" of that version of the code. In the center you can see the branch tree. This helps you visualize all the current branches and their diversion points. For example, if we look at the hunger_tweaks branch, we can see that I made changes to it, so it diverged from the cyan master branch. On the right you can see the commit names. Each time you finish a piece of code and you make it ready to push by staging it, you can give that commit a name. Now, there's still some prep we need to do. On the left, scroll down until you see the icon of a cloud with Remote written next to it. Hover over that with your mouse and you'll see a big green plus. Type in Aurora.3 in the Github section and you should find a repo named Aurorastation/Aurora.3. Put whatever you want as the name and click Add Remote. What we did just now was make GitKraken start tracking the main repo's branches, so you'll never have to update your fork's master branch. You'll be able to directly make branches off of the main master branch, which is very important. That's all for the setup! To test if it's working, you should see this icon in the branch tree: Right click the master name and click Create branch here. It'll prompt you for the branch name and you can put in whatever. After that, you'll see Gitkraken switch to the branch you just made. We're going to be coding in that branch in the next piece of the tutorial. Quote Link to comment
MattAtlas Posted December 24, 2019 Author Share Posted December 24, 2019 (edited) Your Coding Environment Coding is something that's a bit too abstract to teach in a simple forum post. I cannot immediately teach you how to code. You'll need to start yourself and ask for help as you go along. However, I can teach you how to get started. It will come naturally with trial and error. At first, that'll be your only way of doing it if you're not familiar with other coding languages, but that's fine. It's how most of us, and how I too, started coding. You'll feel demotivated at first because your stuff won't work, but that's normal. Everyone felt that, and I did too. If I gave up when I did I wouldn't be a maintainer today. But let's get started: We will use Visual Studio Code as your coding environment. It's where you'll write your code and do some other things that we'll talk about later. For now, let's focus on getting it. Download it and install it - it'll be rather straightforward. Once you're done, right click the Aurora.3 folder and you should have a new option - Open with Code or something along those lines. Click it, and you'll open the folder with Visual Studio Code. The interface looks a bit daunting but it's pretty simple. At the left, in order from top to bottom, you have: Files, Search (this is extremely important), Source Control (think about it like gitkraken, you won't use it since you already have a git client), Debug and Run (useless to us), Extensions (for theming and lang support), Project Manager (useless). To get started, you can try out the search function. You'll see a search bar at the top left, just type in the name of an item that's familiar to you. You'll find out some results and you can click one of them. You'll notice that this looks horrid. The code is all white and unreadable. Let's fix that. Click the Extensions button (the one with four squares) and type in 'DM' in the search bar. You'll get a long list but we only need two: BYOND DM Language Support and DreamMaker Language Client. Install both of them and restart VSC once you're done. These do the following: - syntax highlighting; - autocompletion when you type in functions or defines. These are both extremely handy features that you'll love. Next up, follow the guide here to set up your admin config: https://github.com/Aurorastation/Aurora.3 Now, let's get back inside the Aurora.3 folder. You'll notice this file: Open it. This will launch BYOND's native coding environment, but we'll only be using it to compile and host the codebase. If you press control + shift + T at once, you'll compile the codebase and launch DreamDaemon. That's a lot of words, so let's get into what they mean. Compiling is when your code is put together, elaborated and scanned for errors by DreamMaker. When you change the code you'll need to compile it to see any changes ingame. Hosting is when you launch the server, using DreamDaemon. One more extremely important thing to keep in mind: press F1 in Dream Maker to bring up BYOND's native reference. This is extremely handy and important. You can search around to see definitions of DM's native functions (procs), variables, types, operators, etc. Keep it in mind. Once you get VSC, compiling, hosting and the admin perms working, you're all set. Come on over to our discord in #code_dungeon and get started. Edited April 1, 2020 by MattAtlas Quote Link to comment
MattAtlas Posted December 24, 2019 Author Share Posted December 24, 2019 Pull Requests TBU Quote Link to comment
MattAtlas Posted December 24, 2019 Author Share Posted December 24, 2019 FAQ TBU Quote Link to comment
MattAtlas Posted January 11, 2020 Author Share Posted January 11, 2020 Part 2 is done. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.