TGMC:Guide to contributing

Материал из SS220 /tg/station13 (Space Station 13)
Перейти к навигации Перейти к поиску
DMCA Logo.png Эта страница относится к TGMC.

TGMC это билд, созданный на основе CM-SS13 и переделанный под ТГ.


Generic assistant2.png
The New "Coder" говорит:
«Hey, I want to put in this feature that will revolutionized the game! So where do I start?»

You poor, poor soul.

Let’s get you on your way to contributing. This isn’t the guide for hardcore coders. This is for the guy who just wants a thing tweaked. If you’re really into making big feature changes, talk in the #Dev-General channel and get the people there to help you.

What you need to get

You will be getting:

  • A GitHub account
  • GitKraken
  • Visual Studio Code
  • A BLOOD CONTRACT TO SELL YOUR SOUL

Since you’re reading this you’re already on the Discord. Head on over to the #coding channel and look at the top for this link:

This will take you to the Github page. You’ll need to make an account if you don’t have one already.

Image14.png.png

Signed up or in? Great!

The first thing you need to do is “Fork” this Github. This is the fork button.

Fork
A fork is a personal copy of another user's repository that lives on your account. Forks allow you to freely make changes to a project without affecting the original. Forks remain attached to the original, allowing you to submit a pull request to the original author to update with your changes. You can also keep your fork up to date by pulling in updates from the original.)
Image12.png.png

This will take a moment, then it will bring you to your own personal Fork of the TGMC “Repository”

Repository
A repository is the most basic element of GitHub. They're easiest to imagine as a project's folder. A repository contains all of the project files (including documentation), and stores each file's revision history. Repositories can have multiple collaborators and can be either public or private.)


Image26.png.png

With this done, we want to take a step back and get two outside programs.

  1. GitKraken
    1. This is for advanced users of Github.
    2. Allows for much greater control of branches.
    3. As the opening paragraph stated, ask for help with this program.
  2. Visual Studio Code
    1. Very noob friendly. No coding knowledge required to use the basics.
    2. Fast and can be customized to your heart's desire.
    3. Can search the entire folder structure and each files contents for words.
    4. Every plugin you could ever think of.


With Gitkraken and VS installed, we’re almost ready to start making changes.

We need to get our fork of the TGMC repository on our computer.

Since you installed Gitkraken, we’ve got an easy button to use in Gitkraken.

Image11.png.png
Image31.png.png

This will download the Forked Repository to your computer all ripe for modifying.

You can decide where it is put on your computer, but the default Documents/Github/ is perfectly fine.

So we are ready to do some changes!

Coding and Making some Change!

Let’s do something simple. Let’s alter the lobby music.

First we need to find where the lobby music is. And to do that, we should set up VS. So open VS then open the folder where you downloaded the Repository.

Image6.png.png
Image19.png.png

This is your side panel. The file explorer is currently displayed.

Image32.png.png
Generic assistant2.png
The New "Coder" говорит:
«Oh, my God. How am I supposed to find what I need?»

To search for text within files, either click the magnifying glass or press CTRL+SHIFT+F.

Image27.png.png

This will replace your file explorer with a search panel. Typing in the text we want to search for and hitting enter, we get a BIG amount of text with every instance of the word “music” highlighted, along with a small amount of the surrounding text to give it context.

Scrolling down we see that the lobby music is selected in this file.

Image5.png.png

  1. Figure 1
    1. Number of matching words inside a file.
  2. Figure 2
    1. File names. More specifically, this file is where we want to go. Everything indented below a file name are the matches.
  3. Figure 3
    1. Our first match inside this file. All of this is where you do the work, the editor. Something something gaze into the abyss.

The list of lobby songs.

Image23.png.png

Let’s just remove DawsonChristian.ogg from the available selection, even though that is complete heresy of the highest magnitude.

Image1.png.png

And save our work. CTRL+S

At this point, we can look at Gitkraken, and things have changed!

Image7.png.png

We can see that we’ve changed one file, and what the specific change was. Red for removal, green for addition.

Test Your Change!

Generic assistant2.png
The New "Coder" говорит:
«Oh boy! All done right?»

Wrong! These changes have only happened on your computer.


Generic assistant2.png
The New "Coder" говорит:
«So I should just get this online right away?»

Wrong again! We have to TEST our changes to make sure they work.

There are two ways to compile and test your changes. Both requiring you to boot up Byond. Open Byond as if you were going to play a game. We need to be logged into Byond.

Image4.png.png

Testing Through Dream Maker

First, open this file via double click.

Image28.png.png

Second, Compile and host the game.

Image2.png.png

This will take a moment.

Image21.png.png
Generic assistant2.png
The New "Coder" говорит:
«Oh, my god. The thing is not compiling. It's all broken! I've messed up!»


Don't worry, make sure your Byond client is up to date with the Beta Branch. You can find versions of Byond client, should you or others ever need it!, clink on this link that Byond have given us.

No errors? Thank goodness, this has passed the first check.

Image9.png.png

Now you've got the game ready to host, hit that green button to start your local "server" then the yellow button above it to join!

Testing Through Visual Studio Code

In the Visual Studio Code, you can press F5, then select Byond as your environment.

Contribute test 1.png

Contribute test 2.png

Contribute test 3.png

Again, it will take a while to compile.

Generic assistant2.png
The New "Coder" говорит:
«Oh, my god. The thing is not compiling. It's all broken! I've messed up!»


Don't worry, make sure your Byond client is up to date with the Beta Branch. You can find versions of Byond client, should you or others ever need it!, clink on this link that Byond have given us.

No errors? Thank goodness, this has passed the first check.

Time to Test!

Image8.png.png

Oh snap, you’re in game and you’re an admin! Hooray it works! Test your feature/game balance/thing you want.

(in our case, we would keep running and re-running the game to start the lobby music multiple times. Each time checking that the clown.ogg music doesn’t get played.)

Making a Branch and a Git

No need to keep Byond and dream maker open, back to Github Desktop.

Making a Branch

We need to make a “Branch” for our change. We don’t want to change our master if we can help it.

Branch
A branch is a parallel version of a repository. It is contained within the repository, but does not affect the primary or master branch allowing you to work freely without disrupting the "live" version. When you've made the changes you want to make, you can merge your branch back into the master branch to publish your changes.

Image25.png.png

Image3.png.png

Image29.png.png

Our changes are good, but first, we need to “Commit” them to the branch.

Give your update a name and a brief description in the bottom right corner.

And hit that “Commit to No-Clown-Musak” button.

Making and Managing a Git

Next we need to publish the branch moving our changes online to our fork

Gitkrakenpush.PNG

Image18.png.png

It’s now online! Let’s go to our Github fork on the Github website.

We’ve even got a nifty button all ready for us.

Image13.png.png

Now is the time to give our “Pull Request” a proper name and description.

Pull Request
Pull requests are proposed changes to a repository submitted by a user and accepted or rejected by a repository's collaborators. Like issues, pull requests each have their own discussion forum.

Image16.png.png

The title should be a one sentence summary, at most.

The description should give detail, and ingame examples if possible via screenshots hosted on an image hosting website. I recommend imgur.com

Hit the big green “Create pull request” button and jobs a good one!

Bask in the glow of accomplishing something grand!

Image22.png.png

See it on Discord in the #github channel!

Image20.png.png

Realize you’ve made a terrible mistake!

Image10.png.png

Image17.png.png

Phew, integrity saved!

And that’s the basics of Contributing to TGMC

Remember, the #dev-general and #coding are the places to be for more in depth questions, moral support,

A video!

Guess what, Now there is a video of how to make a gun!

https://youtu.be/o-OvS4tC0N4

If you follow the general steps in this video. you can make your own guns!